fix: applied formatter (on all import as well :)
This commit is contained in:
parent
8b24456b48
commit
746fa97cf3
@ -1,6 +1,9 @@
|
||||
package enseirb.myinpulse.config;
|
||||
|
||||
import static org.springframework.security.authorization.AuthorityAuthorizationManager.hasRole;
|
||||
|
||||
import enseirb.myinpulse.security.KeycloakJwtRolesConverter;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -13,9 +16,6 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.springframework.security.authorization.AuthorityAuthorizationManager.hasRole;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class WebSecurityCustomConfiguration {
|
||||
// CORS configuration
|
||||
@ -24,8 +24,8 @@ public class WebSecurityCustomConfiguration {
|
||||
private String frontendUrl;
|
||||
|
||||
/**
|
||||
* Configure the CORS (Cross Origin Ressource Sharing -- a security feature) configuration.
|
||||
* The only allowed website is the frontend, defined in the .env file.
|
||||
* Configure the CORS (Cross Origin Ressource Sharing -- a security feature) configuration. The
|
||||
* only allowed website is the frontend, defined in the .env file.
|
||||
*
|
||||
* @return the CORS configuration used by the backend
|
||||
*/
|
||||
@ -35,10 +35,7 @@ public class WebSecurityCustomConfiguration {
|
||||
configuration.setAllowedOrigins(List.of(frontendUrl));
|
||||
configuration.setAllowedMethods(Arrays.asList("GET", "OPTIONS"));
|
||||
configuration.setAllowedHeaders(
|
||||
Arrays.asList(
|
||||
"authorization",
|
||||
"content-type",
|
||||
"x-auth-token"));
|
||||
Arrays.asList("authorization", "content-type", "x-auth-token"));
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", configuration);
|
||||
|
||||
@ -47,8 +44,10 @@ public class WebSecurityCustomConfiguration {
|
||||
|
||||
/**
|
||||
* Configure the authorisation required for each path.
|
||||
* admin endpoints are under /admin/* and entrepreneur are under /entrepreneur/*
|
||||
* If endpoints dont require authentication, they are under /unauth/
|
||||
*
|
||||
* <p>admin endpoints are under /admin/* and entrepreneur are under /entrepreneur/*
|
||||
*
|
||||
* <p>If endpoints dont require authentication, they are under /unauth/
|
||||
*
|
||||
* @param http automatically filled in by spring.
|
||||
* @return a securityfilterchain, automatically used by spring.
|
||||
|
@ -2,12 +2,14 @@ package enseirb.myinpulse.postgres_db.controller;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Administrateurs;
|
||||
import enseirb.myinpulse.postgres_db.repository.AdministrateursRepository;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
public class AdministrateursController {
|
||||
|
||||
|
@ -2,12 +2,14 @@ package enseirb.myinpulse.postgres_db.controller;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.ComptesRendus;
|
||||
import enseirb.myinpulse.postgres_db.repository.ComptesRendusRepository;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
public class ComptesRendusController {
|
||||
|
||||
|
@ -2,12 +2,14 @@ package enseirb.myinpulse.postgres_db.controller;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Entrepreneurs;
|
||||
import enseirb.myinpulse.postgres_db.repository.EntrepreneursRepository;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
public class EntrepreneursController {
|
||||
|
||||
|
@ -2,13 +2,15 @@ package enseirb.myinpulse.postgres_db.controller;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Projets;
|
||||
import enseirb.myinpulse.postgres_db.repository.ProjetsRepository;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
public class ProjetsController {
|
||||
|
||||
|
@ -2,14 +2,16 @@ package enseirb.myinpulse.postgres_db.controller;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.RendezVous;
|
||||
import enseirb.myinpulse.postgres_db.repository.RendezVousRepository;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
public class RendezVousController {
|
||||
|
||||
|
@ -2,13 +2,15 @@ package enseirb.myinpulse.postgres_db.controller;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Sections;
|
||||
import enseirb.myinpulse.postgres_db.repository.SectionsRepository;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
public class SectionsController {
|
||||
|
||||
|
@ -2,12 +2,14 @@ package enseirb.myinpulse.postgres_db.controller;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Utilisateurs;
|
||||
import enseirb.myinpulse.postgres_db.repository.UtilisateursRepository;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
public class UtilisateursController {
|
||||
|
||||
|
@ -3,6 +3,7 @@ package enseirb.myinpulse.postgres_db.model;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.PrimaryKeyJoinColumn;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -2,6 +2,7 @@ package enseirb.myinpulse.postgres_db.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -12,31 +12,6 @@ import java.util.List;
|
||||
@Table(name = "rendez_vous")
|
||||
public class RendezVous {
|
||||
|
||||
@Id
|
||||
@NotNull
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id_rdv;
|
||||
|
||||
private LocalDate date_rdv;
|
||||
|
||||
private LocalDateTime heure_rdv;
|
||||
|
||||
private LocalDateTime duree_rdv;
|
||||
|
||||
@Column(length = 255)
|
||||
private String lieu_rdv;
|
||||
|
||||
private String sujet_rdv;
|
||||
|
||||
@OneToMany(mappedBy = "rendezVousEntrepreneurs", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||
private List<Entrepreneurs> ListEntrepreneurs = new ArrayList<>();
|
||||
|
||||
@OneToMany(mappedBy = "rendezVousAdministrateurs", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||
private List<Administrateurs> ListAdministrateurs = new ArrayList<>();
|
||||
|
||||
@OneToMany(mappedBy = "rendezVousComptesRendus", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||
private List<ComptesRendus> ListComptesRendus = new ArrayList<>();
|
||||
|
||||
@ManyToMany(
|
||||
fetch = FetchType.LAZY,
|
||||
cascade = {CascadeType.ALL})
|
||||
@ -45,6 +20,22 @@ public class RendezVous {
|
||||
joinColumns = @JoinColumn(name = "id_rdv"),
|
||||
inverseJoinColumns = @JoinColumn(name = "id_section"))
|
||||
List<Sections> ListSections = new ArrayList<>();
|
||||
@Id
|
||||
@NotNull
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id_rdv;
|
||||
private LocalDate date_rdv;
|
||||
private LocalDateTime heure_rdv;
|
||||
private LocalDateTime duree_rdv;
|
||||
@Column(length = 255)
|
||||
private String lieu_rdv;
|
||||
private String sujet_rdv;
|
||||
@OneToMany(mappedBy = "rendezVousEntrepreneurs", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||
private List<Entrepreneurs> ListEntrepreneurs = new ArrayList<>();
|
||||
@OneToMany(mappedBy = "rendezVousAdministrateurs", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||
private List<Administrateurs> ListAdministrateurs = new ArrayList<>();
|
||||
@OneToMany(mappedBy = "rendezVousComptesRendus", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||
private List<ComptesRendus> ListComptesRendus = new ArrayList<>();
|
||||
|
||||
public RendezVous() {}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package enseirb.myinpulse.postgres_db.repository;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Administrateurs;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package enseirb.myinpulse.postgres_db.repository;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.ComptesRendus;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package enseirb.myinpulse.postgres_db.repository;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Entrepreneurs;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package enseirb.myinpulse.postgres_db.repository;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Projets;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package enseirb.myinpulse.postgres_db.repository;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.RendezVous;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package enseirb.myinpulse.postgres_db.repository;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Sections;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package enseirb.myinpulse.postgres_db.repository;
|
||||
|
||||
import enseirb.myinpulse.postgres_db.model.Utilisateurs;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package enseirb.myinpulse.security;
|
||||
|
||||
import static java.util.stream.Collectors.toSet;
|
||||
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.security.authentication.AbstractAuthenticationToken;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
@ -14,8 +16,6 @@ import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.stream.Collectors.toSet;
|
||||
|
||||
public class KeycloakJwtRolesConverter implements Converter<Jwt, AbstractAuthenticationToken> {
|
||||
/** Prefix used for realm level roles. */
|
||||
public static final String PREFIX_REALM_ROLE = "ROLE_REALM_";
|
||||
|
@ -1,50 +1,62 @@
|
||||
INSERT INTO projets (nom_projet, logo, date_creation, status_projet) VALUES
|
||||
('Eau du robinet', decode('013d7d16d7ad4fefb61bd95b765c8ceb', 'hex'), TO_DATE('01-OCT-2023', 'DD-MON-YYYY'), 'En cours'),
|
||||
('Air oxygéné', decode('150647a0984e8f228cd14b54', 'hex'), TO_DATE('04-APR-2024', 'DD-MON-YYYY'), 'En cours'),
|
||||
('Débat concours', decode('022024abd5486e245c145dda65116f', 'hex'), TO_DATE('22-NOV-2023', 'DD-MON-YYYY'), 'Suspendu'),
|
||||
('HDeirbMI', decode('ab548d6c1d595a2975e6476f544d14c55a', 'hex'), TO_DATE('07-DEC-2024', 'DD-MON-YYYY'), 'Lancement');
|
||||
INSERT INTO projets (nom_projet, logo, date_creation, status_projet)
|
||||
VALUES ('Eau du robinet', decode('013d7d16d7ad4fefb61bd95b765c8ceb', 'hex'), TO_DATE('01-OCT-2023', 'DD-MON-YYYY'),
|
||||
'En cours'),
|
||||
('Air oxygéné', decode('150647a0984e8f228cd14b54', 'hex'), TO_DATE('04-APR-2024', 'DD-MON-YYYY'), 'En cours'),
|
||||
('Débat concours', decode('022024abd5486e245c145dda65116f', 'hex'), TO_DATE('22-NOV-2023', 'DD-MON-YYYY'),
|
||||
'Suspendu'),
|
||||
('HDeirbMI', decode('ab548d6c1d595a2975e6476f544d14c55a', 'hex'), TO_DATE('07-DEC-2024', 'DD-MON-YYYY'),
|
||||
'Lancement');
|
||||
|
||||
INSERT INTO utilisateurs (nom_utilisateur, prenom_utilisateur, mail_principal, mail_secondaire, numero_telephone) VALUES
|
||||
('Dupont', 'Dupond', 'super@mail.fr', 'super2@mail.fr', '06 45 72 45 98'),
|
||||
('Martin', 'Matin', 'genial@mail.fr', 'genial2@mail.fr', '06 52 14 58 73'),
|
||||
('Charvet', 'Lautre', 'mieux@tmail.fr', 'mieux2@tmail.fr', '07 49 82 16 35'),
|
||||
('Leguez', 'Theo', 'bof@mesmails.fr', 'bof2@mesmails.fr', '+33 6 78 14 25 29'),
|
||||
('Kia', 'Bi', 'special@mail.fr', 'special2@mail.fr', '07 65 31 38 95');
|
||||
INSERT INTO utilisateurs (nom_utilisateur, prenom_utilisateur, mail_principal, mail_secondaire, numero_telephone)
|
||||
VALUES ('Dupont', 'Dupond', 'super@mail.fr', 'super2@mail.fr', '06 45 72 45 98'),
|
||||
('Martin', 'Matin', 'genial@mail.fr', 'genial2@mail.fr', '06 52 14 58 73'),
|
||||
('Charvet', 'Lautre', 'mieux@tmail.fr', 'mieux2@tmail.fr', '07 49 82 16 35'),
|
||||
('Leguez', 'Theo', 'bof@mesmails.fr', 'bof2@mesmails.fr', '+33 6 78 14 25 29'),
|
||||
('Kia', 'Bi', 'special@mail.fr', 'special2@mail.fr', '07 65 31 38 95');
|
||||
|
||||
INSERT INTO entrepreneurs (ecole, filiere, status_snee) VALUES
|
||||
('ENSEIRB-MATMECA', 'INFO', TRUE),
|
||||
('ENSC', 'Cognitique', TRUE),
|
||||
('ENSEIRB-MATMECA', 'MATMECA', FALSE),
|
||||
('SupOptique', 'Classique', TRUE),
|
||||
('ENSEGID', 'Géoscience', FALSE),
|
||||
('ENSMAC', 'Matériaux composites - Mécanique', FALSE);
|
||||
INSERT INTO entrepreneurs (ecole, filiere, status_snee)
|
||||
VALUES ('ENSEIRB-MATMECA', 'INFO', TRUE),
|
||||
('ENSC', 'Cognitique', TRUE),
|
||||
('ENSEIRB-MATMECA', 'MATMECA', FALSE),
|
||||
('SupOptique', 'Classique', TRUE),
|
||||
('ENSEGID', 'Géoscience', FALSE),
|
||||
('ENSMAC', 'Matériaux composites - Mécanique', FALSE);
|
||||
|
||||
INSERT INTO sections (titre, contenu_section, date_modification) VALUES
|
||||
("Problème", "les problèmes...", TO_DATE('15-JAN-2025', 'DD-MON-YYYY')),
|
||||
("Segment de client", "Le segment AB passant le client n°8 est de longueur 32mm.
|
||||
Le segment BC a quant à lui un longueur de 28mm. Quelle la longueur du segment AC ?", TO_DATE('12-OCT-2022', 'DD-MON-YYYY')),
|
||||
("Proposition de valeur unique", "'Son prix est de 2594€' 'Ah oui c'est unique en effet'", TO_DATE('25-MAY-2024', 'DD-MON-YYYY')),
|
||||
("Solution", "Un problème ? Une solution", TO_DATE('08-FEB-2024', 'DD-MON-YYYY')),
|
||||
("Canaux", "Ici nous avons la Seine, là-bas le Rhin, oh et plus loin le canal de Suez", TO_DATE('19-JUL-2023', 'DD-MON-YYYY')),
|
||||
("Sources de revenus", "Y'en n'a pas on est pas payé. Enfin y'a du café quoi", TO_DATE('12-JAN-2025', 'DD-MON-YYYY')),
|
||||
("Structure des coûts", "'Ah oui là ça va faire au moins 1000€ par mois', Eirbware", TO_DATE('06-FEB-2025', 'DD-MON-YYYY')),
|
||||
("Indicateurs clés", "On apprend les clés comme des badges, ça se fait", TO_DATE('05-FEB-2025', 'DD-MON-YYYY')),
|
||||
("Avantages concurrentiel", "On est meilleur", TO_DATE('23-APR-2024', 'DD-MON-YYYY'));
|
||||
INSERT INTO sections (titre, contenu_section, date_modification)
|
||||
VALUES ("Problème", "les problèmes...", TO_DATE('15-JAN-2025', 'DD-MON-YYYY')),
|
||||
("Segment de client", "Le segment AB passant le client n°8 est de longueur 32mm.
|
||||
Le segment BC a quant à lui un longueur de 28mm. Quelle la longueur du segment AC ?",
|
||||
TO_DATE('12-OCT-2022', 'DD-MON-YYYY')),
|
||||
("Proposition de valeur unique", "'Son prix est de 2594€' 'Ah oui c'est unique en effet'",
|
||||
TO_DATE('25-MAY-2024', 'DD-MON-YYYY')),
|
||||
("Solution", "Un problème ? Une solution", TO_DATE('08-FEB-2024', 'DD-MON-YYYY')),
|
||||
("Canaux", "Ici nous avons la Seine, là-bas le Rhin, oh et plus loin le canal de Suez",
|
||||
TO_DATE('19-JUL-2023', 'DD-MON-YYYY')),
|
||||
("Sources de revenus", "Y'en n'a pas on est pas payé. Enfin y'a du café quoi",
|
||||
TO_DATE('12-JAN-2025', 'DD-MON-YYYY')),
|
||||
("Structure des coûts", "'Ah oui là ça va faire au moins 1000€ par mois', Eirbware",
|
||||
TO_DATE('06-FEB-2025', 'DD-MON-YYYY')),
|
||||
("Indicateurs clés", "On apprend les clés comme des badges, ça se fait", TO_DATE('05-FEB-2025', 'DD-MON-YYYY')),
|
||||
("Avantages concurrentiel", "On est meilleur", TO_DATE('23-APR-2024', 'DD-MON-YYYY'));
|
||||
|
||||
INSERT INTO rendez_vous (date_rdv, heure_rdv, duree_rdv, lieu_rdv, sujet_rdv) VALUES
|
||||
(TO_DATE('24-DEC-2023', 'DD-MON-YYYY'), '00:00:00', '00:37:53', "À la maison", "Ouvrir les cadeaux"),
|
||||
(TO_DATE('15-AUG-2024', 'DD-MON-YYYY'), '22:35:00', '00:12:36', "Sur les quais ou dans un champ probablement", "BOUM BOUM les feux d'artifices (on fête quoi déjà ?)"),
|
||||
(TO_DATE('29-FEB-2023', 'DD-MON-YYYY'), '14:20:00', '00:20:00', "Salle TD 15", "Ah mince c'est pas une année bissextile !"),
|
||||
(TO_DATE('23-JAN-2024', 'DD-MON-YYYY'), '12:56:27', '11:03:33', "Là où le vent nous porte", "Journée la plus importante de l'année"),
|
||||
(TO_DATE('25-AUG-2025', 'DD-MON-YYYY'), '00:09:00', '01:00:00', "Euh c'est par où l'amphi 56 ?", "Rentrée scolaire (il fait trop froid c'est quoi ça on est en août)");
|
||||
INSERT INTO rendez_vous (date_rdv, heure_rdv, duree_rdv, lieu_rdv, sujet_rdv)
|
||||
VALUES (TO_DATE('24-DEC-2023', 'DD-MON-YYYY'), '00:00:00', '00:37:53', "À la maison", "Ouvrir les cadeaux"),
|
||||
(TO_DATE('15-AUG-2024', 'DD-MON-YYYY'), '22:35:00', '00:12:36', "Sur les quais ou dans un champ probablement",
|
||||
"BOUM BOUM les feux d'artifices (on fête quoi déjà ?)"),
|
||||
(TO_DATE('29-FEB-2023', 'DD-MON-YYYY'), '14:20:00', '00:20:00', "Salle TD 15",
|
||||
"Ah mince c'est pas une année bissextile !"),
|
||||
(TO_DATE('23-JAN-2024', 'DD-MON-YYYY'), '12:56:27', '11:03:33', "Là où le vent nous porte",
|
||||
"Journée la plus importante de l'année"),
|
||||
(TO_DATE('25-AUG-2025', 'DD-MON-YYYY'), '00:09:00', '01:00:00', "Euh c'est par où l'amphi 56 ?",
|
||||
"Rentrée scolaire (il fait trop froid c'est quoi ça on est en août)");
|
||||
|
||||
INSERT INTO comptes_rendus (contenu_compte_rendu) VALUES
|
||||
("Ah oui ça c'est super, ah ouais j'aime bien, bien vu de penser à ça"),
|
||||
("Bonne réunion"),
|
||||
("Ouais, j'ai rien compris mais niquel on fait comme vous avez dit"),
|
||||
("Non non ça va pas du tout ce que tu me proposes, faut tout refaire"),
|
||||
("Réponse de la DSI : non"),
|
||||
("Trop dommage qu'Apple ait sorti leur logiciel avant nous, on avait la même idée et tout on aurait tellement pu leur faire de la concurrence");
|
||||
INSERT INTO comptes_rendus (contenu_compte_rendu)
|
||||
VALUES ("Ah oui ça c'est super, ah ouais j'aime bien, bien vu de penser à ça"),
|
||||
("Bonne réunion"),
|
||||
("Ouais, j'ai rien compris mais niquel on fait comme vous avez dit"),
|
||||
("Non non ça va pas du tout ce que tu me proposes, faut tout refaire"),
|
||||
("Réponse de la DSI : non"),
|
||||
("Trop dommage qu'Apple ait sorti leur logiciel avant nous, on avait la même idée et tout on aurait tellement pu leur faire de la concurrence");
|
||||
|
||||
|
||||
|
||||
|
@ -10,71 +10,79 @@ DROP TABLE IF EXISTS formes CASCADE;
|
||||
|
||||
CREATE TABLE projets
|
||||
(
|
||||
id_projet SERIAL NOT NULL,
|
||||
nom_projet VARCHAR(255) ,
|
||||
logo BYTEA ,
|
||||
date_creation DATE ,
|
||||
status_projet VARCHAR(255) ,
|
||||
CONSTRAINT pk_projet PRIMARY KEY (id_projet) );
|
||||
id_projet SERIAL NOT NULL,
|
||||
nom_projet VARCHAR(255),
|
||||
logo BYTEA,
|
||||
date_creation DATE,
|
||||
status_projet VARCHAR(255),
|
||||
CONSTRAINT pk_projet PRIMARY KEY (id_projet)
|
||||
);
|
||||
|
||||
CREATE TABLE utilisateurs
|
||||
(
|
||||
id_utilisateur SERIAL NOT NULL,
|
||||
nom_utilisateur VARCHAR(255) ,
|
||||
prenom_utilisateur VARCHAR(255) ,
|
||||
mail_principal VARCHAR(255) ,
|
||||
mail_secondaire VARCHAR(255) ,
|
||||
numero_telephone VARCHAR(15) ,
|
||||
CONSTRAINT pk_utilisateur PRIMARY KEY (id_utilisateur) );
|
||||
id_utilisateur SERIAL NOT NULL,
|
||||
nom_utilisateur VARCHAR(255),
|
||||
prenom_utilisateur VARCHAR(255),
|
||||
mail_principal VARCHAR(255),
|
||||
mail_secondaire VARCHAR(255),
|
||||
numero_telephone VARCHAR(15),
|
||||
CONSTRAINT pk_utilisateur PRIMARY KEY (id_utilisateur)
|
||||
);
|
||||
|
||||
CREATE TABLE entrepreneurs
|
||||
(
|
||||
id_entrepreneur SERIAL REFERENCES utilisateurs (id_utilisateur),
|
||||
ecole VARCHAR(255) ,
|
||||
filiere VARCHAR(255) ,
|
||||
status_snee BOOLEAN ,
|
||||
CONSTRAINT pk_entrepreneur PRIMARY KEY (id_entrepreneur) );
|
||||
id_entrepreneur SERIAL REFERENCES utilisateurs (id_utilisateur),
|
||||
ecole VARCHAR(255),
|
||||
filiere VARCHAR(255),
|
||||
status_snee BOOLEAN,
|
||||
CONSTRAINT pk_entrepreneur PRIMARY KEY (id_entrepreneur)
|
||||
);
|
||||
|
||||
CREATE TABLE administrateurs
|
||||
(
|
||||
id_administrateur SERIAL REFERENCES utilisateurs (id_utilisateur),
|
||||
CONSTRAINT pk_administrateur PRIMARY KEY (id_administrateur) );
|
||||
id_administrateur SERIAL REFERENCES utilisateurs (id_utilisateur),
|
||||
CONSTRAINT pk_administrateur PRIMARY KEY (id_administrateur)
|
||||
);
|
||||
|
||||
CREATE TABLE sections
|
||||
(
|
||||
id_section SERIAL NOT NULL,
|
||||
titre VARCHAR(255) ,
|
||||
contenu_section TEXT ,
|
||||
date_modification TIMESTAMP ,
|
||||
CONSTRAINT pk_section PRIMARY KEY (id_section) );
|
||||
id_section SERIAL NOT NULL,
|
||||
titre VARCHAR(255),
|
||||
contenu_section TEXT,
|
||||
date_modification TIMESTAMP,
|
||||
CONSTRAINT pk_section PRIMARY KEY (id_section)
|
||||
);
|
||||
|
||||
CREATE TABLE rendez_vous
|
||||
(
|
||||
id_rdv SERIAL NOT NULL,
|
||||
date_rdv DATE ,
|
||||
heure_rdv TIME ,
|
||||
duree_rdv TIME ,
|
||||
lieu_rdv VARCHAR(255) ,
|
||||
sujet_rdv TEXT ,
|
||||
CONSTRAINT pk_rdv PRIMARY KEY (id_rdv) );
|
||||
id_rdv SERIAL NOT NULL,
|
||||
date_rdv DATE,
|
||||
heure_rdv TIME,
|
||||
duree_rdv TIME,
|
||||
lieu_rdv VARCHAR(255),
|
||||
sujet_rdv TEXT,
|
||||
CONSTRAINT pk_rdv PRIMARY KEY (id_rdv)
|
||||
);
|
||||
|
||||
CREATE TABLE comptes_rendus
|
||||
(
|
||||
id_compte_rendu SERIAL NOT NULL,
|
||||
contenu_compte_rendu TEXT ,
|
||||
CONSTRAINT pk_compte_rendu PRIMARY KEY (id_compte_rendu) );
|
||||
id_compte_rendu SERIAL NOT NULL,
|
||||
contenu_compte_rendu TEXT,
|
||||
CONSTRAINT pk_compte_rendu PRIMARY KEY (id_compte_rendu)
|
||||
);
|
||||
|
||||
CREATE TABLE concerner
|
||||
(
|
||||
id_section SERIAL REFERENCES sections (id_section),
|
||||
id_rdv SERIAL REFERENCES sections (id_rdv),
|
||||
CONSTRAINT pk_concerner PRIMARY KEY (id_section, id_rdv) );
|
||||
id_section SERIAL REFERENCES sections (id_section),
|
||||
id_rdv SERIAL REFERENCES sections (id_rdv),
|
||||
CONSTRAINT pk_concerner PRIMARY KEY (id_section, id_rdv)
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE projets
|
||||
ADD CONSTRAINT fk1_projet FOREIGN KEY (id_administrateur)
|
||||
REFERENCES administrateurs (id_administrateur)
|
||||
ON DELETE CASCADE;
|
||||
ADD CONSTRAINT fk1_projet FOREIGN KEY (id_administrateur)
|
||||
REFERENCES administrateurs (id_administrateur)
|
||||
ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE projets
|
||||
ADD CONSTRAINT fk2_projet FOREIGN KEY (id_entrepreneur_participation)
|
||||
@ -82,34 +90,40 @@ ALTER TABLE projets
|
||||
ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE entrepreneurs
|
||||
ADD CONSTRAINT fk1_entrepreneur FOREIGN KEY (id_projet_propose)
|
||||
REFERENCES projets (id_projet)
|
||||
ON DELETE CASCADE;
|
||||
ADD CONSTRAINT fk1_entrepreneur FOREIGN KEY (id_projet_propose)
|
||||
REFERENCES projets (id_projet)
|
||||
ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE sections
|
||||
ADD CONSTRAINT fk1_section FOREIGN KEY (id_projet)
|
||||
REFERENCES projets (id_projet)
|
||||
ON DELETE CASCADE;
|
||||
ADD CONSTRAINT fk1_section FOREIGN KEY (id_projet)
|
||||
REFERENCES projets (id_projet)
|
||||
ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE sections
|
||||
ADD CONSTRAINT fk2_section FOREIGN KEY (id_administrateur)
|
||||
REFERENCES administrateurs (id_administrateur)
|
||||
ON DELETE CASCADE;
|
||||
ADD CONSTRAINT fk2_section FOREIGN KEY (id_administrateur)
|
||||
REFERENCES administrateurs (id_administrateur)
|
||||
ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE rendez-vous
|
||||
ADD CONSTRAINT fk1_rdv FOREIGN KEY (id_entrepreneur)
|
||||
REFERENCES entrepreneurs (id_entrepreneur)
|
||||
ON DELETE CASCADE;
|
||||
ADD CONSTRAINT fk1_rdv FOREIGN KEY (id_entrepreneur)
|
||||
REFERENCES entrepreneurs (id_entrepreneur)
|
||||
ON
|
||||
DELETE
|
||||
CASCADE;
|
||||
|
||||
ALTER TABLE rendez-vous
|
||||
ADD CONSTRAINT fk2_rdv FOREIGN KEY (id_administrateur)
|
||||
REFERENCES administrateurs (id_administrateur)
|
||||
ON DELETE CASCADE;
|
||||
ADD CONSTRAINT fk2_rdv FOREIGN KEY (id_administrateur)
|
||||
REFERENCES administrateurs (id_administrateur)
|
||||
ON
|
||||
DELETE
|
||||
CASCADE;
|
||||
|
||||
ALTER TABLE comptes-rendus
|
||||
ADD CONSTRAINT fk1_compte_rendu FOREIGN KEY (id_rdv)
|
||||
REFERENCES rendez_vous (id_rdv)
|
||||
ON DELETE CASCADE;
|
||||
ADD CONSTRAINT fk1_compte_rendu FOREIGN KEY (id_rdv)
|
||||
REFERENCES rendez_vous (id_rdv)
|
||||
ON
|
||||
DELETE
|
||||
CASCADE;
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user