-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pipeline) : Add mes-aides, mediation-numerique to Brevo contacts
They will also be part of the notification campaign about displaying their e-mail address in the API.
- Loading branch information
Showing
7 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
WITH final AS ( | ||
{{ | ||
dbt_utils.union_relations( | ||
relations=[ | ||
ref('int_dora__contacts'), | ||
ref('int_mediation_numerique__contacts'), | ||
ref('int_mes_aides__contacts'), | ||
], | ||
source_column_name=None | ||
) | ||
}} | ||
) | ||
|
||
SELECT * FROM final |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...dbt/models/intermediate/sources/mediation_numerique/int_mediation_numerique__contacts.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
WITH final AS ( | ||
SELECT | ||
courriel AS "courriel", | ||
'mediation-numerique:structures:' || id AS contact_uid | ||
FROM {{ ref('stg_mediation_numerique__structures') }} | ||
WHERE courriel IS NOT NULL | ||
) | ||
|
||
SELECT * FROM final |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
pipeline/dbt/models/intermediate/sources/mes_aides/int_mes_aides__contacts.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
WITH structure_contacts AS ( | ||
SELECT | ||
email AS "courriel", | ||
'mes-aides:garages:' || id AS contact_uid | ||
FROM {{ ref('stg_mes_aides__garages') }} | ||
WHERE email IS NOT NULL | ||
), | ||
|
||
service_contacts AS ( | ||
SELECT | ||
email AS "courriel", | ||
'mes-aides:aides:' || id AS contact_uid | ||
FROM {{ ref('stg_mes_aides__aides') }} | ||
WHERE email IS NOT NULL | ||
), | ||
|
||
final AS ( | ||
SELECT * FROM structure_contacts | ||
UNION ALL | ||
SELECT * FROM service_contacts | ||
) | ||
|
||
SELECT * FROM final |