Commit df9d867c authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'php8_api' into dev

parents 77a8569c c5ecd7da
Loading
Loading
Loading
Loading
+2 −2
Changes for composer.lock: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -11450,7 +11450,7 @@
            "source": {
                "type": "git",
                "url": "https://git.unicaen.fr/lib/unicaen/db-import.git",
                "reference": "8786f43996e5581b65227a43364e06f770fbbcf2"
                "reference": "bff6eb4a61e9f2fc518c0083231b25bc1f189829"
            },
            "require": {
                "beberlei/assert": "^3.3",
@@ -11482,7 +11482,7 @@
                }
            },
            "description": "Module d'import entre bases de données",
            "time": "2023-05-24T15:23:52+00:00"
            "time": "2023-06-05T11:55:09+00:00"
        },
        {
            "name": "unicaen/faq",
+0 −14
Changes for config/autoload/global.php: 0 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -668,7 +668,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'STRUCTURE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -686,7 +685,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'ETABLISSEMENT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -704,7 +702,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'ECOLE_DOCT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -722,7 +719,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'UNITE_RECH',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -741,7 +737,6 @@ const CONFIG_SYNCHROS = [
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
//            'where'              => "d.source_code like 'UCN::%'", // todo: à virer
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -759,7 +754,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'DOCTORANT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -777,7 +771,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'THESE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -795,7 +788,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'THESE_ANNEE_UNIV',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -813,7 +805,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'ROLE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -831,7 +822,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'ACTEUR',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -849,7 +839,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'ORIGINE_FINANCEMENT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -867,7 +856,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'FINANCEMENT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -885,7 +873,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'TITRE_ACCES',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
    [
@@ -903,7 +890,6 @@ const CONFIG_SYNCHROS = [
            'table' => 'VARIABLE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'intermediate_table_auto_drop' => false,
        ],
    ],
];
+6 −0
Changes for module/InscriptionAdministrative/data/tmp_tables.sql: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ create table tmp_inscription_administrative
     on tmp_inscription_administrative (source_id);
 create unique index tmp_inscription_administrative_unique_index
     on tmp_inscription_administrative (source_id, source_code);
alter table tmp_inscription_administrative
    add constraint tmp_inscription_administrative_source_id_fk
        foreign key (source_id) references source;


create table inscription_administrative
@@ -114,6 +117,9 @@ create index inscription_administrative_source_id_index
    on inscription_administrative (source_id);
create unique index inscription_administrative_unique_index
    on inscription_administrative (source_id, source_code);
alter table inscription_administrative
    add constraint inscription_administrative_source_id_fk
        foreign key (source_id) references source;

create index inscription_administrative_doctorant_id_idx
    on inscription_administrative (doctorant_id);
+77 −7
Changes for module/SygalApiImpl/config/module.config.php: 77 added lines, 7 removed lines.
Original line number Diff line number Diff line
<?php

use Laminas\Log\Logger;
use UnicaenDbImport\Domain\Operation;

return [
    'import' => [
@@ -9,18 +10,87 @@ return [
                'name' => 'inscription-administrative',
                'order' => -10,
                'source' => [
                    'name' => 'SyGAL',
                    'name' => 'sygal',
                    'code' => 'app',
                    'table' => 'SRC_INSCRIPTION_ADMINISTRATIVE',
                    'table' => 'src_inscription_administrative',
                    'connection' => 'default',
                    'source_code_column' => 'SOURCE_CODE',
                    'source_code_column' => 'source_code',
                ],
                'destination' => [
                    'name' => 'Application',
                    'table' => 'INSCRIPTION_ADMINISTRATIVE',
                    'name' => 'application',
                    'table' => 'inscription_administrative',
                    'connection' => 'default',
                    'source_code_column' => 'SOURCE_CODE',
                    'intermediate_table_auto_drop' => false,
                    'source_code_column' => 'source_code',
                ],
            ],

            /**
             * Prototype : mise à jour de source_code doctorant.
             *
             * Pourquoi ? Sera peut-être utile si un jour Pégase nous signale les changements d'INE d'apprenant
             *            (l'INE est utilisé dans SyGAL comme source_code).
             *
             *       create table tmp_doctorant_source_code
             *       (
             *          id bigserial,
             *          insert_date timestamp(0) default ('now'::text)::timestamp without time zone,
             *          source_id bigint not null,
             *          source_code_old varchar(64) not null,
             *          source_code varchar(64) not null,
             *          histo_creation timestamp(0) default ('now'::text)::timestamp(0) without time zone not null,
             *          histo_modification timestamp(0),
             *          histo_destruction timestamp(0),
             *          histo_createur_id bigint not null,
             *          histo_modificateur_id bigint,
             *          histo_destructeur_id bigint
             *       );
             *
             *       create index tmp_doctorant_source_code_source_code_index
             *          on tmp_doctorant_source_code (source_code);
             *       create index tmp_doctorant_source_code_source_id_index
             *          on tmp_doctorant_source_code (source_id);
             *       create unique index tmp_doctorant_source_code_unique_index
             *          on tmp_doctorant_source_code (source_id, source_code);
             *
             *       insert into tmp_doctorant_source_code(source_id, source_code_old, source_code, histo_createur_id)
             *          select s.id, 'INSA::1304000614x', 'INSA::___1304000614x', 1
             *          from source s where s.code = 'INSA::physalis'
             *       ;
             *       select * from tmp_doctorant_source_code;
             *       -- select * from src_doctorant_source_code;
             *       select * from doctorant where source_code like 'INSA::%' and histo_destruction is null;
             *       select * from doctorant where source_code = 'INSA::1304000614x';
             *       select * from doctorant where id = 57863;
             *       select * from v_diff_doctorant ;
             *
             *       --drop view src_doctorant_source_code;
             *       create or replace view src_doctorant_source_code as
             *          select t.id,
             *          src.id as source_id,
             *          tmp.source_code
             *          from tmp_doctorant_source_code tmp
             *          join doctorant t on tmp.source_code_old = t.source_code
             *          join source src on src.id = tmp.source_id
             *       ;
             */
            [
                'name' => 'doctorant_source_code',
                'order' => 0,
                'source' => [
                    'name' => 'application',
                    'code' => 'app',
                    'table' => 'src_doctorant_source_code',
                    'connection' => 'default',
                    'source_code_column' => 'id',
                ],
                'destination' => [
                    'name' => 'application',
                    'table' => 'doctorant',
                    'connection' => 'default',
                    'source_code_column' => 'id',
                ],
                'operations' => [
                    Operation::OPERATION_UPDATE, // seule opération
                ],
            ],
        ],
+1 −1
Changes for module/SygalApiImpl/config/versions/v1.config.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ return [
    'service_manager' => [
        'factories' => [
            \SygalApiImpl\V1\Rest\InscriptionAdministrative\InscriptionAdministrativeResource::class => \SygalApiImpl\V1\Rest\InscriptionAdministrative\InscriptionAdministrativeResourceFactory::class,
            \SygalApiImpl\V1\Rest\InscriptionAdministrative\Service\ImportService::class => \SygalApiImpl\V1\Rest\InscriptionAdministrative\Service\ImportServiceFactory::class
            \SygalApiImpl\V1\Rest\InscriptionAdministrative\Service\ImportFacade::class => \SygalApiImpl\V1\Rest\InscriptionAdministrative\Service\ImportFacadeFactory::class
        ],
    ],
    'bjyauthorize'    => [
Loading