Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Lawiss committed Oct 18, 2024
1 parent 674f2e4 commit 1bebbd7
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions transform/models/refined_zone/analytics/ad_hoc/tra_15307.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,29 @@
}}

with companies as (
select
distinct recipient_company_siret as siret
from
{{ ref('bsdd') }}
where
quantity_received = 0
and received_at is not null
and created_at >= '2023-01-01'
and not is_deleted
and waste_acceptation_status = 'ACCEPTED'
and status in ('RECEIVED', 'FOLLOWED_WITH_PNTTD', 'PROCESSED', 'AWAITING_GROUP', 'NO_TRACEABILITY', 'GROUPED')
select distinct recipient_company_siret as siret
from
{{ ref('bsdd') }}
where
quantity_received = 0
and received_at is not null
and created_at >= '2023-01-01'
and not is_deleted
and waste_acceptation_status = 'ACCEPTED'
and status in (
'RECEIVED',
'FOLLOWED_WITH_PNTTD',
'PROCESSED',
'AWAITING_GROUP',
'NO_TRACEABILITY',
'GROUPED'
)
)
select
c.siret,
ca.company_name as nom_etablissement,
ca.user_email as email_admin,
ca.user_name as nom_admin
from companies c
inner join {{ ref('companies_admins') }} ca on c.siret=ca.company_siret

select
c.siret,
ca.company_name as nom_etablissement,
ca.user_email as email_admin,
ca.user_name as nom_admin
from companies as c
inner join {{ ref('companies_admins') }} as ca on c.siret = ca.company_siret

0 comments on commit 1bebbd7

Please sign in to comment.