Commit 7e32823e authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

ENTRETIENPRO (WIP)

parent 09a73496
Loading
Loading
Loading
Loading
+88.5 KiB (1020 KiB)
Loading image diff...
+726 KiB
Loading image diff...
+229 −0
Changes for documentation/SQL/011_ENTRETIENPROFESSIONNEL.sql: 229 added lines, 0 removed lines.
Original line number Diff line number Diff line
-- Date de MAJ 24/11/2023 ----------------------------------------------------------------------------------------------
-- Script avant version 4.2.0 ------------------------------------------------------------------------------------------
-- Color scheme : 284848  ----------------------------------------------------------------------------------------------

-- TTTTTTTTTTTTTTTTTTTTTTT         AAA               BBBBBBBBBBBBBBBBB   LLLLLLLLLLL             EEEEEEEEEEEEEEEEEEEEEE
-- T:::::::::::::::::::::T        A:::A              B::::::::::::::::B  L:::::::::L             E::::::::::::::::::::E
-- T:::::::::::::::::::::T       A:::::A             B::::::BBBBBB:::::B L:::::::::L             E::::::::::::::::::::E
-- T:::::TT:::::::TT:::::T      A:::::::A            BB:::::B     B:::::BLL:::::::LL             EE::::::EEEEEEEEE::::E
-- TTTTTT  T:::::T  TTTTTT     A:::::::::A             B::::B     B:::::B  L:::::L                 E:::::E       EEEEEE
--         T:::::T            A:::::A:::::A            B::::B     B:::::B  L:::::L                 E:::::E
--         T:::::T           A:::::A A:::::A           B::::BBBBBB:::::B   L:::::L                 E::::::EEEEEEEEEE
--         T:::::T          A:::::A   A:::::A          B:::::::::::::BB    L:::::L                 E:::::::::::::::E
--         T:::::T         A:::::A     A:::::A         B::::BBBBBB:::::B   L:::::L                 E:::::::::::::::E
--         T:::::T        A:::::AAAAAAAAA:::::A        B::::B     B:::::B  L:::::L                 E::::::EEEEEEEEEE
--         T:::::T       A:::::::::::::::::::::A       B::::B     B:::::B  L:::::L                 E:::::E
--         T:::::T      A:::::AAAAAAAAAAAAA:::::A      B::::B     B:::::B  L:::::L         LLLLLL  E:::::E       EEEEEE
--       TT:::::::TT   A:::::A             A:::::A   BB:::::BBBBBB::::::BLL:::::::LLLLLLLLL:::::LEE::::::EEEEEEEE:::::E
--       T:::::::::T  A:::::A               A:::::A  B:::::::::::::::::B L::::::::::::::::::::::LE::::::::::::::::::::E
--       T:::::::::T A:::::A                 A:::::A B::::::::::::::::B  L::::::::::::::::::::::LE::::::::::::::::::::E
--       TTTTTTTTTTTAAAAAAA                   AAAAAAABBBBBBBBBBBBBBBBB   LLLLLLLLLLLLLLLLLLLLLLLLEEEEEEEEEEEEEEEEEEEEEE


create table entretienprofessionnel_campagne
(
    id                    serial
        constraint entretienprofessionnel_campagne_pk
        primary key,
    annee                 varchar(256) not null,
    precede_id            integer
        constraint entretienprofessionnel_campagne_entretienprofessionnel_campagne
        references entretienprofessionnel_campagne
        on delete set null,
    date_debut            timestamp    not null,
    date_fin              timestamp    not null,
    date_circulaire       timestamp,
    histo_creation        timestamp    not null,
    histo_createur_id     integer      not null
        constraint entretienprofessionnel_campagne_user_id_fk
        references unicaen_utilisateur_user,
    histo_modification    timestamp,
    histo_modificateur_id integer
        constraint entretienprofessionnel_campagne_user_id_fk1
        references unicaen_utilisateur_user,
    histo_destruction     timestamp,
    histo_destructeur_id  integer
        constraint entretienprofessionnel_campagne_user_id_fk2
        references unicaen_utilisateur_user
);
create unique index entretienprofessionnel_campagne_id_uindex on entretienprofessionnel_campagne (id);

create table entretienprofessionnel
(
    id                    serial
        constraint entretien_professionnel_pk
        primary key,
    agent                 varchar(40) not null
        constraint entretien_professionnel_agent_c_individu_fk
        references agent,
    responsable_id        varchar(40) not null
        constraint entretien_professionnel_agent_c_individu_fk_2
        references agent,
    formulaire_instance   integer,
    date_entretien        timestamp,
    campagne_id           integer     not null
        constraint entretien_professionnel_campagne_id_fk
        references entretienprofessionnel_campagne
        on delete set null,
    formation_instance    integer,
    lieu                  text,
    token                 varchar(255),
    acceptation           timestamp,
    histo_creation        timestamp   not null,
    histo_createur_id     integer     not null
        constraint entretienprofessionnel_user_id_fk
        references unicaen_utilisateur_user,
    histo_modification    timestamp,
    histo_modificateur_id integer
        constraint entretienprofessionnel_user_id_fk1
        references unicaen_utilisateur_user,
    histo_destruction     timestamp,
    histo_destructeur_id  integer
        constraint entretienprofessionnel_user_id_fk2
        references unicaen_utilisateur_user
);
create unique index entretien_professionnel_id_uindex on entretienprofessionnel (id);

create table entretienprofessionnel_observation
(
    id                            serial
        constraint entretienprofessionnel_observation_pk
        primary key,
    entretien_id                  integer   not null
        constraint entretienprofessionnel_observation_entretien_professionnel_id_f
        references entretienprofessionnel
        on delete cascade,
    observation_agent_entretien   text,
    observation_agent_perspective text,
    histo_creation                timestamp not null,
    histo_createur_id             integer   not null
        constraint entretienprofessionnel_observation_user_id_fk
        references unicaen_utilisateur_user,
    histo_modification            timestamp,
    histo_modificateur_id         integer
        constraint entretienprofessionnel_observation_user_id_fk_2
        references unicaen_utilisateur_user,
    histo_destruction             timestamp,
    histo_destructeur_id          integer
        constraint entretienprofessionnel_observation_user_id_fk_3
        references unicaen_utilisateur_user
);
create unique index entretienprofessionnel_observation_id_uindex on entretienprofessionnel_observation (id);

create table entretienprofessionnel_validation
(
    entretien_id  integer not null
        constraint entretienprofessionnel_validation_entretien_professionnel_id_fk
        references entretienprofessionnel
        on delete cascade,
    validation_id integer not null
        constraint entretienprofessionnel_validation_unicaen_validation_instance_i
        references unicaen_validation_instance
        on delete cascade,
    constraint entretienprofessionnel_validation_pk
        primary key (entretien_id, validation_id)
);

create table entretienprofessionnel_critere_competence
(
    id                    serial
        constraint entretienprofessionnel_critere_competence_pk
        primary key,
    libelle               varchar(1024)           not null,
    histo_creation        timestamp default now() not null,
    histo_createur_id     integer   default 0     not null,
    histo_modification    timestamp,
    histo_modificateur_id integer,
    histo_destruction     timestamp,
    histo_destructeur_id  integer
);
create unique index entretienprofessionnel_critere_competence_id_uindex on entretienprofessionnel_critere_competence (id);

create table entretienprofessionnel_critere_contribution
(
    id                    serial
        constraint entretienprofessionnel_critere_contribution_pk
        primary key,
    libelle               varchar(1024)           not null,
    histo_creation        timestamp default now() not null,
    histo_createur_id     integer   default 0     not null,
    histo_modification    timestamp,
    histo_modificateur_id integer,
    histo_destruction     timestamp,
    histo_destructeur_id  integer
);
create unique index entretienprofessionnel_critere_contribution_id_uindex on entretienprofessionnel_critere_contribution (id);

create table entretienprofessionnel_critere_personnelle
(
    id                    serial
        constraint entretienprofessionnel_critere_qualitepersonnelle_pk
        primary key,
    libelle               varchar(1024)           not null,
    histo_creation        timestamp default now() not null,
    histo_createur_id     integer   default 0     not null,
    histo_modification    timestamp,
    histo_modificateur_id integer,
    histo_destruction     timestamp,
    histo_destructeur_id  integer
);
create unique index entretienprofessionnel_critere_qualitepersonnelle_id_uindex on entretienprofessionnel_critere_personnelle (id);

create table entretienprofessionnel_critere_encadrement
(
    id                    serial
        constraint entretienprofessionnel_critere_encadrement_pk
        primary key,
    libelle               varchar(1024)           not null,
    histo_creation        timestamp default now() not null,
    histo_createur_id     integer   default 0     not null,
    histo_modification    timestamp,
    histo_modificateur_id integer,
    histo_destruction     timestamp,
    histo_destructeur_id  integer
);
create unique index entretienprofessionnel_critere_encadrement_id_uindex on entretienprofessionnel_critere_encadrement (id);

create table entretienprofessionnel_etat
(
    entretien_id integer not null
        constraint entretienprofessionnel_etat_entretien_id_fk
        references entretienprofessionnel
        on delete cascade,
    etat_id      integer not null
        constraint entretienprofessionnel_etat_etat_id_fk
        references unicaen_etat_instance
        on delete cascade,
    constraint entretienprofessionnel_etat_pk
        primary key (entretien_id, etat_id)
);

create table entretienprofessionnel_agent_force_sansobligation
(
    id                    serial
        constraint entretienprofessionnel_agent_force_sansobligation_pk
        primary key,
    agent_id              varchar(40) not null
        constraint ep_agent_force_sansobligation_agent_c_individu_fk
        references agent
        on delete cascade,
    campagne_id           integer     not null
        constraint ep_agent_force_sansobligation_campagne_id_fk
        references entretienprofessionnel_campagne
        on delete cascade,
    raison                text,
    histo_creation        timestamp   not null,
    histo_createur_id     integer     not null
        constraint ep_agent_force_sansobligation_unicaen_utilisateur_user_id_fk
        references unicaen_utilisateur_user,
    histo_modification    timestamp,
    histo_modificateur_id integer
        constraint ep_agent_force_sansobligation_unicaen_utilisateur_user_id_fk2
        references unicaen_utilisateur_user,
    histo_destruction     timestamp,
    histo_destructeur_id  integer
        constraint ep_agent_force_sansobligation_unicaen_utilisateur_user_id_fk3
        references unicaen_utilisateur_user
);
comment on table entretienprofessionnel_agent_force_sansobligation is 'Table listant les agents pour lesquels on a forcé le fait qu''ils n''avait pas d''obligation d''entretien professionnel';
+36 −0
Changes for module/011_ENTRETIENPROFESSIONNEL.dot: 36 added lines, 0 removed lines.
Original line number Diff line number Diff line
digraph "entretienprofessionnel" {

splines  = ortho;
fontname = "Inconsolata";

node [colorscheme = ylgnbu4];
edge [colorscheme = dark28, dir = both];

agent                                                                                                                       [shape = record, label = "{ agent |  utilisateur_id : integer\l  prenom : varchar(64)\l  nom_usage : varchar(64)\l  created_on : timestamp(0)\l  updated_on : timestamp(0)\l  deleted_on : timestamp(0)\l  octo_id : varchar(40)\l  preecog_id : varchar(40)\l  harp_id : integer\l  login : varchar(256)\l  email : varchar(1024)\l  sexe : varchar(1)\l  t_contrat_long : varchar(1)\l  date_naissance : date\l  nom_famille : varchar(256)\l  id : bigint\l  histo_createur_id : bigint\l  histo_modificateur_id : bigint\l  histo_destructeur_id : bigint\l  source_id : varchar(128)\l  id_orig : varchar(100)\l| c_individu : varchar(40)\l }"];
entretienprofessionnel                                                                                                      [shape = record, label = "{ entretienprofessionnel |  agent : varchar(40)\l  responsable_id : varchar(40)\l  formulaire_instance : integer\l  date_entretien : timestamp\l  campagne_id : integer\l  formation_instance : integer\l  lieu : text\l  token : varchar(255)\l  acceptation : timestamp\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l| id : integer\l }"];
"entretienprofessionnel_agent_force_sansobligation  /* Table listant les agents pour lesquels on a forcé le fait qu'... */" [shape = record, label = "{ entretienprofessionnel_agent_force_sansobligation  /* Table listant les agents pour lesquels on a forcé le fait qu'... */ |  agent_id : varchar(40)\l  campagne_id : integer\l  raison : text\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l| id : integer\l }"];
entretienprofessionnel_campagne                                                                                             [shape = record, label = "{ entretienprofessionnel_campagne |  annee : varchar(256)\l  precede_id : integer\l  date_debut : timestamp\l  date_fin : timestamp\l  date_circulaire : timestamp\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l| id : integer\l }"];
entretienprofessionnel_critere_competence                                                                                   [shape = record, label = "{ entretienprofessionnel_critere_competence |  libelle : varchar(1024)\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l| id : integer\l }"];
entretienprofessionnel_critere_contribution                                                                                 [shape = record, label = "{ entretienprofessionnel_critere_contribution |  libelle : varchar(1024)\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l| id : integer\l }"];
entretienprofessionnel_critere_encadrement                                                                                  [shape = record, label = "{ entretienprofessionnel_critere_encadrement |  libelle : varchar(1024)\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l| id : integer\l }"];
entretienprofessionnel_critere_personnelle                                                                                  [shape = record, label = "{ entretienprofessionnel_critere_personnelle |  libelle : varchar(1024)\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l| id : integer\l }"];
entretienprofessionnel_etat                                                                                                 [shape = record, label = "{ entretienprofessionnel_etat |  entretien_id : integer\l  etat_id : integer\l }"];
entretienprofessionnel_observation                                                                                          [shape = record, label = "{ entretienprofessionnel_observation |  entretien_id : integer\l  observation_agent_entretien : text\l  observation_agent_perspective : text\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l| id : integer\l }"];
entretienprofessionnel_validation                                                                                           [shape = record, label = "{ entretienprofessionnel_validation |  entretien_id : integer\l  validation_id : integer\l }"];
unicaen_etat_instance                                                                                                       [shape = record, label = "{ unicaen_etat_instance |  type_id : integer\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l  complement : text\l| id : integer\l }"];
unicaen_validation_instance                                                                                                 [shape = record, label = "{ unicaen_validation_instance |  type_id : integer\l  entity_class : varchar(1024)\l  entity_id : varchar(64)\l  histo_creation : timestamp\l  histo_createur_id : integer\l  histo_modification : timestamp\l  histo_modificateur_id : integer\l  histo_destruction : timestamp\l  histo_destructeur_id : integer\l  justification : text\l  refus : boolean\l| id : integer\l }"];

entretienprofessionnel                                                                                                      -> agent                                                                                                                       [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "responsable_id:c_individu", headlabel = ""];
entretienprofessionnel                                                                                                      -> agent                                                                                                                       [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "agent:c_individu", headlabel = ""];
entretienprofessionnel                                                                                                      -> entretienprofessionnel_campagne                                                                                             [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "campagne_id:id", headlabel = ""];
"entretienprofessionnel_agent_force_sansobligation  /* Table listant les agents pour lesquels on a forcé le fait qu'... */" -> agent                                                                                                                       [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "agent_id:id", headlabel = ""];
"entretienprofessionnel_agent_force_sansobligation  /* Table listant les agents pour lesquels on a forcé le fait qu'... */" -> agent                                                                                                                       [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "agent_id:c_individu", headlabel = ""];
"entretienprofessionnel_agent_force_sansobligation  /* Table listant les agents pour lesquels on a forcé le fait qu'... */" -> entretienprofessionnel_campagne                                                                                             [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "campagne_id:id", headlabel = ""];
entretienprofessionnel_campagne                                                                                             -> entretienprofessionnel_campagne                                                                                             [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "precede_id:id", headlabel = ""];
entretienprofessionnel_etat                                                                                                 -> entretienprofessionnel                                                                                                      [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "entretien_id:id", headlabel = ""];
entretienprofessionnel_etat                                                                                                 -> unicaen_etat_instance                                                                                                       [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "etat_id:id", headlabel = ""];
entretienprofessionnel_observation                                                                                          -> entretienprofessionnel                                                                                                      [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "entretien_id:id", headlabel = ""];
entretienprofessionnel_validation                                                                                           -> entretienprofessionnel                                                                                                      [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "entretien_id:id", headlabel = ""];
entretienprofessionnel_validation                                                                                           -> unicaen_validation_instance                                                                                                 [color = "#595959", style = solid , arrowtail = none    , arrowhead = normal  , taillabel = "", label = "validation_id:id", headlabel = ""];

}