fix: applied formatter (on all import as well :)
Some checks failed
Format / formatting (push) Failing after 8s
CI / build (push) Successful in 13s

This commit is contained in:
Pierre Tellier 2025-02-12 15:29:12 +01:00
parent 8b24456b48
commit 746fa97cf3
21 changed files with 197 additions and 158 deletions

View File

@ -1,6 +1,9 @@
package enseirb.myinpulse.config; package enseirb.myinpulse.config;
import static org.springframework.security.authorization.AuthorityAuthorizationManager.hasRole;
import enseirb.myinpulse.security.KeycloakJwtRolesConverter; import enseirb.myinpulse.security.KeycloakJwtRolesConverter;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -13,9 +16,6 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import static org.springframework.security.authorization.AuthorityAuthorizationManager.hasRole;
@Configuration @Configuration
public class WebSecurityCustomConfiguration { public class WebSecurityCustomConfiguration {
// CORS configuration // CORS configuration
@ -24,8 +24,8 @@ public class WebSecurityCustomConfiguration {
private String frontendUrl; private String frontendUrl;
/** /**
* Configure the CORS (Cross Origin Ressource Sharing -- a security feature) configuration. * Configure the CORS (Cross Origin Ressource Sharing -- a security feature) configuration. The
* The only allowed website is the frontend, defined in the .env file. * only allowed website is the frontend, defined in the .env file.
* *
* @return the CORS configuration used by the backend * @return the CORS configuration used by the backend
*/ */
@ -35,10 +35,7 @@ public class WebSecurityCustomConfiguration {
configuration.setAllowedOrigins(List.of(frontendUrl)); configuration.setAllowedOrigins(List.of(frontendUrl));
configuration.setAllowedMethods(Arrays.asList("GET", "OPTIONS")); configuration.setAllowedMethods(Arrays.asList("GET", "OPTIONS"));
configuration.setAllowedHeaders( configuration.setAllowedHeaders(
Arrays.asList( Arrays.asList("authorization", "content-type", "x-auth-token"));
"authorization",
"content-type",
"x-auth-token"));
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration); source.registerCorsConfiguration("/**", configuration);
@ -47,8 +44,10 @@ public class WebSecurityCustomConfiguration {
/** /**
* Configure the authorisation required for each path. * 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. * @param http automatically filled in by spring.
* @return a securityfilterchain, automatically used by spring. * @return a securityfilterchain, automatically used by spring.

View File

@ -2,12 +2,14 @@ package enseirb.myinpulse.postgres_db.controller;
import enseirb.myinpulse.postgres_db.model.Administrateurs; import enseirb.myinpulse.postgres_db.model.Administrateurs;
import enseirb.myinpulse.postgres_db.repository.AdministrateursRepository; import enseirb.myinpulse.postgres_db.repository.AdministrateursRepository;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ResponseStatusException;
import java.util.Optional;
@RestController @RestController
public class AdministrateursController { public class AdministrateursController {

View File

@ -2,12 +2,14 @@ package enseirb.myinpulse.postgres_db.controller;
import enseirb.myinpulse.postgres_db.model.ComptesRendus; import enseirb.myinpulse.postgres_db.model.ComptesRendus;
import enseirb.myinpulse.postgres_db.repository.ComptesRendusRepository; import enseirb.myinpulse.postgres_db.repository.ComptesRendusRepository;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ResponseStatusException;
import java.util.Optional;
@RestController @RestController
public class ComptesRendusController { public class ComptesRendusController {

View File

@ -2,12 +2,14 @@ package enseirb.myinpulse.postgres_db.controller;
import enseirb.myinpulse.postgres_db.model.Entrepreneurs; import enseirb.myinpulse.postgres_db.model.Entrepreneurs;
import enseirb.myinpulse.postgres_db.repository.EntrepreneursRepository; import enseirb.myinpulse.postgres_db.repository.EntrepreneursRepository;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ResponseStatusException;
import java.util.Optional;
@RestController @RestController
public class EntrepreneursController { public class EntrepreneursController {

View File

@ -2,13 +2,15 @@ package enseirb.myinpulse.postgres_db.controller;
import enseirb.myinpulse.postgres_db.model.Projets; import enseirb.myinpulse.postgres_db.model.Projets;
import enseirb.myinpulse.postgres_db.repository.ProjetsRepository; 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.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ResponseStatusException;
import java.time.LocalDate;
import java.util.Optional;
@RestController @RestController
public class ProjetsController { public class ProjetsController {

View File

@ -2,14 +2,16 @@ package enseirb.myinpulse.postgres_db.controller;
import enseirb.myinpulse.postgres_db.model.RendezVous; import enseirb.myinpulse.postgres_db.model.RendezVous;
import enseirb.myinpulse.postgres_db.repository.RendezVousRepository; 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.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ResponseStatusException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Optional;
@RestController @RestController
public class RendezVousController { public class RendezVousController {

View File

@ -2,13 +2,15 @@ package enseirb.myinpulse.postgres_db.controller;
import enseirb.myinpulse.postgres_db.model.Sections; import enseirb.myinpulse.postgres_db.model.Sections;
import enseirb.myinpulse.postgres_db.repository.SectionsRepository; 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.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ResponseStatusException;
import java.time.LocalDateTime;
import java.util.Optional;
@RestController @RestController
public class SectionsController { public class SectionsController {

View File

@ -2,12 +2,14 @@ package enseirb.myinpulse.postgres_db.controller;
import enseirb.myinpulse.postgres_db.model.Utilisateurs; import enseirb.myinpulse.postgres_db.model.Utilisateurs;
import enseirb.myinpulse.postgres_db.repository.UtilisateursRepository; import enseirb.myinpulse.postgres_db.repository.UtilisateursRepository;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ResponseStatusException;
import java.util.Optional;
@RestController @RestController
public class UtilisateursController { public class UtilisateursController {

View File

@ -3,6 +3,7 @@ package enseirb.myinpulse.postgres_db.model;
import jakarta.persistence.*; import jakarta.persistence.*;
import jakarta.persistence.PrimaryKeyJoinColumn; import jakarta.persistence.PrimaryKeyJoinColumn;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -2,6 +2,7 @@ package enseirb.myinpulse.postgres_db.model;
import jakarta.persistence.*; import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -12,31 +12,6 @@ import java.util.List;
@Table(name = "rendez_vous") @Table(name = "rendez_vous")
public class RendezVous { 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( @ManyToMany(
fetch = FetchType.LAZY, fetch = FetchType.LAZY,
cascade = {CascadeType.ALL}) cascade = {CascadeType.ALL})
@ -45,6 +20,22 @@ public class RendezVous {
joinColumns = @JoinColumn(name = "id_rdv"), joinColumns = @JoinColumn(name = "id_rdv"),
inverseJoinColumns = @JoinColumn(name = "id_section")) inverseJoinColumns = @JoinColumn(name = "id_section"))
List<Sections> ListSections = new ArrayList<>(); 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() {} public RendezVous() {}

View File

@ -1,6 +1,7 @@
package enseirb.myinpulse.postgres_db.repository; package enseirb.myinpulse.postgres_db.repository;
import enseirb.myinpulse.postgres_db.model.Administrateurs; import enseirb.myinpulse.postgres_db.model.Administrateurs;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.data.rest.core.annotation.RepositoryRestResource;

View File

@ -1,6 +1,7 @@
package enseirb.myinpulse.postgres_db.repository; package enseirb.myinpulse.postgres_db.repository;
import enseirb.myinpulse.postgres_db.model.ComptesRendus; import enseirb.myinpulse.postgres_db.model.ComptesRendus;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.data.rest.core.annotation.RepositoryRestResource;

View File

@ -1,6 +1,7 @@
package enseirb.myinpulse.postgres_db.repository; package enseirb.myinpulse.postgres_db.repository;
import enseirb.myinpulse.postgres_db.model.Entrepreneurs; import enseirb.myinpulse.postgres_db.model.Entrepreneurs;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.data.rest.core.annotation.RepositoryRestResource;

View File

@ -1,6 +1,7 @@
package enseirb.myinpulse.postgres_db.repository; package enseirb.myinpulse.postgres_db.repository;
import enseirb.myinpulse.postgres_db.model.Projets; import enseirb.myinpulse.postgres_db.model.Projets;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.data.rest.core.annotation.RepositoryRestResource;

View File

@ -1,6 +1,7 @@
package enseirb.myinpulse.postgres_db.repository; package enseirb.myinpulse.postgres_db.repository;
import enseirb.myinpulse.postgres_db.model.RendezVous; import enseirb.myinpulse.postgres_db.model.RendezVous;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.data.rest.core.annotation.RepositoryRestResource;

View File

@ -1,6 +1,7 @@
package enseirb.myinpulse.postgres_db.repository; package enseirb.myinpulse.postgres_db.repository;
import enseirb.myinpulse.postgres_db.model.Sections; import enseirb.myinpulse.postgres_db.model.Sections;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.data.rest.core.annotation.RepositoryRestResource;

View File

@ -1,6 +1,7 @@
package enseirb.myinpulse.postgres_db.repository; package enseirb.myinpulse.postgres_db.repository;
import enseirb.myinpulse.postgres_db.model.Utilisateurs; import enseirb.myinpulse.postgres_db.model.Utilisateurs;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.data.rest.core.annotation.RepositoryRestResource;

View File

@ -1,5 +1,7 @@
package enseirb.myinpulse.security; package enseirb.myinpulse.security;
import static java.util.stream.Collectors.toSet;
import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.Converter;
import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
@ -14,8 +16,6 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import static java.util.stream.Collectors.toSet;
public class KeycloakJwtRolesConverter implements Converter<Jwt, AbstractAuthenticationToken> { public class KeycloakJwtRolesConverter implements Converter<Jwt, AbstractAuthenticationToken> {
/** Prefix used for realm level roles. */ /** Prefix used for realm level roles. */
public static final String PREFIX_REALM_ROLE = "ROLE_REALM_"; public static final String PREFIX_REALM_ROLE = "ROLE_REALM_";

View File

@ -1,50 +1,62 @@
INSERT INTO projets (nom_projet, logo, date_creation, status_projet) VALUES INSERT INTO projets (nom_projet, logo, date_creation, status_projet)
('Eau du robinet', decode('013d7d16d7ad4fefb61bd95b765c8ceb', 'hex'), TO_DATE('01-OCT-2023', 'DD-MON-YYYY'), 'En cours'), VALUES ('Eau du robinet', decode('013d7d16d7ad4fefb61bd95b765c8ceb', 'hex'), TO_DATE('01-OCT-2023', 'DD-MON-YYYY'),
('Air oxygéné', decode('150647a0984e8f228cd14b54', 'hex'), TO_DATE('04-APR-2024', 'DD-MON-YYYY'), 'En cours'), 'En cours'),
('Débat concours', decode('022024abd5486e245c145dda65116f', 'hex'), TO_DATE('22-NOV-2023', 'DD-MON-YYYY'), 'Suspendu'), ('Air oxygéné', decode('150647a0984e8f228cd14b54', 'hex'), TO_DATE('04-APR-2024', 'DD-MON-YYYY'), 'En cours'),
('HDeirbMI', decode('ab548d6c1d595a2975e6476f544d14c55a', 'hex'), TO_DATE('07-DEC-2024', 'DD-MON-YYYY'), 'Lancement'); ('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 INSERT INTO utilisateurs (nom_utilisateur, prenom_utilisateur, mail_principal, mail_secondaire, numero_telephone)
('Dupont', 'Dupond', 'super@mail.fr', 'super2@mail.fr', '06 45 72 45 98'), 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'), ('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'), ('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'), ('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'); ('Kia', 'Bi', 'special@mail.fr', 'special2@mail.fr', '07 65 31 38 95');
INSERT INTO entrepreneurs (ecole, filiere, status_snee) VALUES INSERT INTO entrepreneurs (ecole, filiere, status_snee)
('ENSEIRB-MATMECA', 'INFO', TRUE), VALUES ('ENSEIRB-MATMECA', 'INFO', TRUE),
('ENSC', 'Cognitique', TRUE), ('ENSC', 'Cognitique', TRUE),
('ENSEIRB-MATMECA', 'MATMECA', FALSE), ('ENSEIRB-MATMECA', 'MATMECA', FALSE),
('SupOptique', 'Classique', TRUE), ('SupOptique', 'Classique', TRUE),
('ENSEGID', 'Géoscience', FALSE), ('ENSEGID', 'Géoscience', FALSE),
('ENSMAC', 'Matériaux composites - Mécanique', FALSE); ('ENSMAC', 'Matériaux composites - Mécanique', FALSE);
INSERT INTO sections (titre, contenu_section, date_modification) VALUES INSERT INTO sections (titre, contenu_section, date_modification)
("Problème", "les problèmes...", TO_DATE('15-JAN-2025', 'DD-MON-YYYY')), 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. ("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')), Le segment BC a quant à lui un longueur de 28mm. Quelle la longueur du segment AC ?",
("Proposition de valeur unique", "'Son prix est de 2594€' 'Ah oui c'est unique en effet'", TO_DATE('25-MAY-2024', 'DD-MON-YYYY')), TO_DATE('12-OCT-2022', 'DD-MON-YYYY')),
("Solution", "Un problème ? Une solution", TO_DATE('08-FEB-2024', 'DD-MON-YYYY')), ("Proposition de valeur unique", "'Son prix est de 2594€' 'Ah oui c'est unique en effet'",
("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')), TO_DATE('25-MAY-2024', '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')), ("Solution", "Un problème ? Une solution", TO_DATE('08-FEB-2024', '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')), ("Canaux", "Ici nous avons la Seine, là-bas le Rhin, oh et plus loin le canal de Suez",
("Indicateurs clés", "On apprend les clés comme des badges, ça se fait", TO_DATE('05-FEB-2025', 'DD-MON-YYYY')), TO_DATE('19-JUL-2023', 'DD-MON-YYYY')),
("Avantages concurrentiel", "On est meilleur", TO_DATE('23-APR-2024', '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 INSERT INTO rendez_vous (date_rdv, heure_rdv, duree_rdv, lieu_rdv, sujet_rdv)
(TO_DATE('24-DEC-2023', 'DD-MON-YYYY'), '00:00:00', '00:37:53', "À la maison", "Ouvrir les cadeaux"), 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('15-AUG-2024', 'DD-MON-YYYY'), '22:35:00', '00:12:36', "Sur les quais ou dans un champ probablement",
(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 !"), "BOUM BOUM les feux d'artifices (on fête quoi déjà ?)"),
(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('29-FEB-2023', 'DD-MON-YYYY'), '14:20:00', '00:20:00', "Salle TD 15",
(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)"); "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 INSERT INTO comptes_rendus (contenu_compte_rendu)
("Ah oui ça c'est super, ah ouais j'aime bien, bien vu de penser à ça"), VALUES ("Ah oui ça c'est super, ah ouais j'aime bien, bien vu de penser à ça"),
("Bonne réunion"), ("Bonne réunion"),
("Ouais, j'ai rien compris mais niquel on fait comme vous avez dit"), ("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"), ("Non non ça va pas du tout ce que tu me proposes, faut tout refaire"),
("Réponse de la DSI : non"), ("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"); ("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");

View File

@ -10,106 +10,120 @@ DROP TABLE IF EXISTS formes CASCADE;
CREATE TABLE projets CREATE TABLE projets
( (
id_projet SERIAL NOT NULL, id_projet SERIAL NOT NULL,
nom_projet VARCHAR(255) , nom_projet VARCHAR(255),
logo BYTEA , logo BYTEA,
date_creation DATE , date_creation DATE,
status_projet VARCHAR(255) , status_projet VARCHAR(255),
CONSTRAINT pk_projet PRIMARY KEY (id_projet) ); CONSTRAINT pk_projet PRIMARY KEY (id_projet)
);
CREATE TABLE utilisateurs CREATE TABLE utilisateurs
( (
id_utilisateur SERIAL NOT NULL, id_utilisateur SERIAL NOT NULL,
nom_utilisateur VARCHAR(255) , nom_utilisateur VARCHAR(255),
prenom_utilisateur VARCHAR(255) , prenom_utilisateur VARCHAR(255),
mail_principal VARCHAR(255) , mail_principal VARCHAR(255),
mail_secondaire VARCHAR(255) , mail_secondaire VARCHAR(255),
numero_telephone VARCHAR(15) , numero_telephone VARCHAR(15),
CONSTRAINT pk_utilisateur PRIMARY KEY (id_utilisateur) ); CONSTRAINT pk_utilisateur PRIMARY KEY (id_utilisateur)
);
CREATE TABLE entrepreneurs CREATE TABLE entrepreneurs
( (
id_entrepreneur SERIAL REFERENCES utilisateurs (id_utilisateur), id_entrepreneur SERIAL REFERENCES utilisateurs (id_utilisateur),
ecole VARCHAR(255) , ecole VARCHAR(255),
filiere VARCHAR(255) , filiere VARCHAR(255),
status_snee BOOLEAN , status_snee BOOLEAN,
CONSTRAINT pk_entrepreneur PRIMARY KEY (id_entrepreneur) ); CONSTRAINT pk_entrepreneur PRIMARY KEY (id_entrepreneur)
);
CREATE TABLE administrateurs CREATE TABLE administrateurs
( (
id_administrateur SERIAL REFERENCES utilisateurs (id_utilisateur), id_administrateur SERIAL REFERENCES utilisateurs (id_utilisateur),
CONSTRAINT pk_administrateur PRIMARY KEY (id_administrateur) ); CONSTRAINT pk_administrateur PRIMARY KEY (id_administrateur)
);
CREATE TABLE sections CREATE TABLE sections
( (
id_section SERIAL NOT NULL, id_section SERIAL NOT NULL,
titre VARCHAR(255) , titre VARCHAR(255),
contenu_section TEXT , contenu_section TEXT,
date_modification TIMESTAMP , date_modification TIMESTAMP,
CONSTRAINT pk_section PRIMARY KEY (id_section) ); CONSTRAINT pk_section PRIMARY KEY (id_section)
);
CREATE TABLE rendez_vous CREATE TABLE rendez_vous
( (
id_rdv SERIAL NOT NULL, id_rdv SERIAL NOT NULL,
date_rdv DATE , date_rdv DATE,
heure_rdv TIME , heure_rdv TIME,
duree_rdv TIME , duree_rdv TIME,
lieu_rdv VARCHAR(255) , lieu_rdv VARCHAR(255),
sujet_rdv TEXT , sujet_rdv TEXT,
CONSTRAINT pk_rdv PRIMARY KEY (id_rdv) ); CONSTRAINT pk_rdv PRIMARY KEY (id_rdv)
);
CREATE TABLE comptes_rendus CREATE TABLE comptes_rendus
( (
id_compte_rendu SERIAL NOT NULL, id_compte_rendu SERIAL NOT NULL,
contenu_compte_rendu TEXT , contenu_compte_rendu TEXT,
CONSTRAINT pk_compte_rendu PRIMARY KEY (id_compte_rendu) ); CONSTRAINT pk_compte_rendu PRIMARY KEY (id_compte_rendu)
);
CREATE TABLE concerner CREATE TABLE concerner
( (
id_section SERIAL REFERENCES sections (id_section), id_section SERIAL REFERENCES sections (id_section),
id_rdv SERIAL REFERENCES sections (id_rdv), id_rdv SERIAL REFERENCES sections (id_rdv),
CONSTRAINT pk_concerner PRIMARY KEY (id_section, id_rdv) ); CONSTRAINT pk_concerner PRIMARY KEY (id_section, id_rdv)
);
ALTER TABLE projets ALTER TABLE projets
ADD CONSTRAINT fk1_projet FOREIGN KEY (id_administrateur) ADD CONSTRAINT fk1_projet FOREIGN KEY (id_administrateur)
REFERENCES administrateurs (id_administrateur) REFERENCES administrateurs (id_administrateur)
ON DELETE CASCADE; ON DELETE CASCADE;
ALTER TABLE projets ALTER TABLE projets
ADD CONSTRAINT fk2_projet FOREIGN KEY (id_entrepreneur_participation) ADD CONSTRAINT fk2_projet FOREIGN KEY (id_entrepreneur_participation)
REFERENCES entrepreneurs (id_entrepreneur) REFERENCES entrepreneurs (id_entrepreneur)
ON DELETE CASCADE; ON DELETE CASCADE;
ALTER TABLE entrepreneurs ALTER TABLE entrepreneurs
ADD CONSTRAINT fk1_entrepreneur FOREIGN KEY (id_projet_propose) ADD CONSTRAINT fk1_entrepreneur FOREIGN KEY (id_projet_propose)
REFERENCES projets (id_projet) REFERENCES projets (id_projet)
ON DELETE CASCADE; ON DELETE CASCADE;
ALTER TABLE sections ALTER TABLE sections
ADD CONSTRAINT fk1_section FOREIGN KEY (id_projet) ADD CONSTRAINT fk1_section FOREIGN KEY (id_projet)
REFERENCES projets (id_projet) REFERENCES projets (id_projet)
ON DELETE CASCADE; ON DELETE CASCADE;
ALTER TABLE sections ALTER TABLE sections
ADD CONSTRAINT fk2_section FOREIGN KEY (id_administrateur) ADD CONSTRAINT fk2_section FOREIGN KEY (id_administrateur)
REFERENCES administrateurs (id_administrateur) REFERENCES administrateurs (id_administrateur)
ON DELETE CASCADE; ON DELETE CASCADE;
ALTER TABLE rendez-vous ALTER TABLE rendez-vous
ADD CONSTRAINT fk1_rdv FOREIGN KEY (id_entrepreneur) ADD CONSTRAINT fk1_rdv FOREIGN KEY (id_entrepreneur)
REFERENCES entrepreneurs (id_entrepreneur) REFERENCES entrepreneurs (id_entrepreneur)
ON DELETE CASCADE; ON
DELETE
CASCADE;
ALTER TABLE rendez-vous ALTER TABLE rendez-vous
ADD CONSTRAINT fk2_rdv FOREIGN KEY (id_administrateur) ADD CONSTRAINT fk2_rdv FOREIGN KEY (id_administrateur)
REFERENCES administrateurs (id_administrateur) REFERENCES administrateurs (id_administrateur)
ON DELETE CASCADE; ON
DELETE
CASCADE;
ALTER TABLE comptes-rendus ALTER TABLE comptes-rendus
ADD CONSTRAINT fk1_compte_rendu FOREIGN KEY (id_rdv) ADD CONSTRAINT fk1_compte_rendu FOREIGN KEY (id_rdv)
REFERENCES rendez_vous (id_rdv) REFERENCES rendez_vous (id_rdv)
ON DELETE CASCADE; ON
DELETE
CASCADE;