Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fix) : refactoring user models #57

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions projects/cour_des_comptes/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@ tests:
decidim:
categories:
+enabled: false




Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ SELECT
decidim_users.blocked,
decidim_users.blocked_at,
(CASE WHEN decidim_users.confirmed_at IS NULL THEN false ELSE true END) AS confirmed,
(CASE WHEN decidim_users.spam_probability IS NULL THEN false ELSE true END) AS spam,
decidim_users.spam_probability,
DATE(decidim_users.spam_report_timestamp) AS spam_reported_at,
decidim_users.extended_data,
decidim_users.extended_data::jsonb->>'date_of_birth' as date_of_birth
FROM {{ ref ("stg_decidim_users")}} as decidim_users
Expand Down Expand Up @@ -82,6 +85,9 @@ SELECT
users_with_date_of_birth.blocked,
users_with_date_of_birth.blocked_at,
users_with_date_of_birth.confirmed,
users_with_date_of_birth.spam,
users_with_date_of_birth.spam_probability,
users_with_date_of_birth.spam_reported_at,
users_with_date_of_birth.extended_data,
(CASE WHEN date_of_birth > '1900-01-01' THEN date_of_birth ELSE NULL END) AS date_of_birth
FROM users_with_date_of_birth
Expand Down
5 changes: 4 additions & 1 deletion projects/cour_des_comptes/models/marts/users/all_users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ SELECT
COALESCE(participations_proposals.has_authored_proposal, 0)::boolean AS has_authored_proposal,
COALESCE(forms_answers.has_answered_survey, 0)::boolean AS has_answered_survey,
decidim_users.confirmed,
CONCAT('https://', decidim_organizations.host, '/profiles/', decidim_users.nickname, '/activity') AS url,
CONCAT('https://', decidim_organizations.host, '/profiles/', decidim_users.nickname, '/activity') AS url,
decidim_users.spam,
decidim_users.spam_probability,
decidim_users.spam_reported_at,
decidim_users.extended_data,
decidim_users.date_of_birth,
decidim_users.age,
Expand Down
Loading