diff --git a/dbt/models/marts/suivi_cap_criteres.sql b/dbt/models/marts/suivi_cap_criteres.sql index 81173a14..ba62135f 100644 --- a/dbt/models/marts/suivi_cap_criteres.sql +++ b/dbt/models/marts/suivi_cap_criteres.sql @@ -1,17 +1,16 @@ select - criteres."nom" as "nom_critère", - criteres."id" as "id_critère", - criteres."niveau" as "niveau_critère", - -- REFUSED et REFUSED_2 correspondent au même état (?) - à confirmer par Zo - camp."nom" as "nom_campagne", - structs."id" as "id_structure", - structs."nom" as "nom_structure", - structs."nom_complet" as "nom_structure_complet", - structs."département" as "département", - structs."nom_département" as "nom_département", - structs."région" as "nom_région", - structs.bassin_d_emploi as bassin_d_emploi, - structs."type" as "type_structure", + criteres."nom" as "nom_critère", + criteres."id" as "id_critère", + criteres."niveau" as "niveau_critère", + camp."nom" as "nom_campagne", + structs."id" as "id_structure", + structs."nom" as "nom_structure", + structs."nom_structure_complet" as "nom_structure_complet", + structs."département" as "département", + structs."nom_département" as "nom_département", + structs."région" as "nom_région", + structs.bassin_d_emploi as bassin_d_emploi, + structs."type_struct" as "type_structure", case when cap_criteres."état" = 'ACCEPTED' @@ -33,7 +32,7 @@ select cap_criteres."état" = 'PENDING' and cap_criteres."date_transmission" is null then 'Non transmis' - end as "état" + end as "état" from {{ source('emplois', 'cap_critères_iae') }} as cap_criteres left join {{ source('emplois', 'critères_iae') }} as criteres on cap_criteres."id_critère_iae" = criteres."id" diff --git a/dbt/models/marts/suivi_cap_structures.sql b/dbt/models/marts/suivi_cap_structures.sql index cc375945..ba69f38f 100644 --- a/dbt/models/marts/suivi_cap_structures.sql +++ b/dbt/models/marts/suivi_cap_structures.sql @@ -3,7 +3,7 @@ select cap_campagnes.nom as nom_campagne, cap_structures.id_structure as id_cap_structure, structures.id as id_structure, - structures.type as "type", + structures.type_struct as "type", structures."département" as "département", structures."nom_département" as "nom_département", structures."région" as "région", diff --git a/dbt/models/staging/stg_candidatures.sql b/dbt/models/staging/stg_candidatures.sql index 2da99b8e..d1ce5c5b 100644 --- a/dbt/models/staging/stg_candidatures.sql +++ b/dbt/models/staging/stg_candidatures.sql @@ -3,7 +3,7 @@ select except=["id", "date_mise_à_jour_metabase", "état", "motif_de_refus", "origine", "délai_de_réponse", "délai_prise_en_compte", "origine_détaillée"]) }}, {{ pilo_star(ref('stg_organisations'), except=["id", "date_mise_à_jour_metabase", "ville", "code_commune", "type", "date_inscription", "total_candidatures", "total_membres", "total_embauches", "date_derniere_candidature"], relation_alias='org_prescripteur') }}, candidatures.id as id, - struct.bassin_emploi_structure as bassin_emploi_structure, + struct.bassin_d_emploi as bassin_emploi_structure, org_prescripteur.zone_emploi as bassin_emploi_prescripteur, org_prescripteur.type as type_org_prescripteur, org_prescripteur.date_inscription as date_inscription_orga, diff --git a/dbt/models/staging/stg_structures.sql b/dbt/models/staging/stg_structures.sql index de32821c..3000597b 100644 --- a/dbt/models/staging/stg_structures.sql +++ b/dbt/models/staging/stg_structures.sql @@ -1,9 +1,14 @@ select s.id as id, + s.nom as nom, + s.type as type_struct, s.siret as siret, s.active as active, s.ville as ville, - insee_geo.nom_zone_emploi as bassin_emploi_structure, + s."département" as "département", + s."nom_département" as "nom_département", + s."région" as "région", + insee_geo.nom_zone_emploi as bassin_d_emploi, s.nom_complet as "nom_structure_complet" from {{ source('emplois', 'structures') }} as s