From 380812fb5817f148ed0c0866b8b5dbb410204b88 Mon Sep 17 00:00:00 2001 From: Hugo Lecuyer Date: Wed, 18 Sep 2024 11:51:18 +0200 Subject: [PATCH] feat(fredo): add mode_acceuil --- .../intermediate/sources/fredo/int_fredo__services.sql | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pipeline/dbt/models/intermediate/sources/fredo/int_fredo__services.sql b/pipeline/dbt/models/intermediate/sources/fredo/int_fredo__services.sql index 61fca483..fd1b08e4 100644 --- a/pipeline/dbt/models/intermediate/sources/fredo/int_fredo__services.sql +++ b/pipeline/dbt/models/intermediate/sources/fredo/int_fredo__services.sql @@ -151,7 +151,13 @@ final AS ( CAST(NULL AS DATE) AS "date_creation", CAST(NULL AS DATE) AS "date_suspension", CAST(NULL AS BOOLEAN) AS "contact_public", - CAST(NULL AS TEXT []) AS "modes_accueil", + CASE + WHEN + fredo_structures.adresse IS NOT NULL + AND fredo_structures.code_postal IS NOT NULL + AND fredo_structures.commune IS NOT NULL THEN ARRAY['en-presentiel'] + ELSE ARRAY['a-distance'] + END AS "modes_accueil", LEFT(fredo_structures.presentation_resume, 280) AS "presentation_resume", fredo_structures.presentation_resume AS "presentation_detail", CASE