adapt stg_core__user
This commit is contained in:
parent
ab5902ff1f
commit
599d7085cf
1 changed files with 39 additions and 23 deletions
|
|
@ -1,23 +1,39 @@
|
||||||
with raw_user as (select * from {{ source("core", "user") }})
|
with
|
||||||
select
|
raw_user as (select * from {{ source("core", "user") }}),
|
||||||
cast("Id" as uuid) as id_user,
|
stg_core__user as (
|
||||||
code as user_code,
|
select
|
||||||
firstname as first_name,
|
{{ adapter.quote("Id") }} as id_user,
|
||||||
lastname as last_name,
|
{{ adapter.quote("Code") }} as user_code,
|
||||||
email as email,
|
{{ adapter.quote("Email") }} as email,
|
||||||
title as title,
|
{{ adapter.quote("Title") }} as title,
|
||||||
dealid as id_deal,
|
{{ adapter.quote("DealId") }} as id_deal,
|
||||||
deleted as is_deleted,
|
{{ adapter.quote("Deleted") }} as is_deleted,
|
||||||
joindate as join_date_utc,
|
{{ adapter.quote("JoinDate") }} as join_date_utc,
|
||||||
username as user_name,
|
{{ adapter.quote("LastName") }} as last_name,
|
||||||
codeprefix as code_prefix,
|
{{ adapter.quote("UserName") }} as user_name,
|
||||||
billingtown as billing_town,
|
{{ adapter.quote("FirstName") }} as first_name,
|
||||||
companyname as company_name,
|
{{ adapter.quote("CodePrefix") }} as code_prefix,
|
||||||
emailconfirmed as is_email_confirmed,
|
{{ adapter.quote("BillingTown") }} as billing_town,
|
||||||
lockoutenabled as is_lockout_enabled,
|
{{ adapter.quote("CompanyName") }} as company_name,
|
||||||
billingpostcode as billing_postcode,
|
{{ adapter.quote("DateOfBirth") }} as date_of_birth,
|
||||||
billingcountryid as id_billing_country,
|
{{ adapter.quote("PhoneNumber") }} as phone_number,
|
||||||
twofactorenabled as is_twofactor_enabled,
|
{{ adapter.quote("PasswordHash") }} as password_hash,
|
||||||
accessfailedcount as access_failed_count,
|
{{ adapter.quote("AccountTypeId") }} as id_account_type,
|
||||||
lockoutenddateutc as lockout_end_date_utc
|
{{ adapter.quote("CreatedUserId") }} as id_created_user,
|
||||||
from raw_user
|
{{ adapter.quote("SecurityStamp") }} as security_stamp,
|
||||||
|
{{ adapter.quote("EmailConfirmed") }} as is_email_confirmed,
|
||||||
|
{{ adapter.quote("LockoutEnabled") }} as is_lockout_enabled,
|
||||||
|
{{ adapter.quote("BillingPostcode") }} as billing_postcode,
|
||||||
|
{{ adapter.quote("BillingCountryId") }} as id_billing_country,
|
||||||
|
{{ adapter.quote("TwoFactorEnabled") }} as is_twofactor_enabled,
|
||||||
|
{{ adapter.quote("AccessFailedCount") }} as access_failed_count,
|
||||||
|
{{ adapter.quote("LockoutEndDateUtc") }} as lockout_end_date_utc,
|
||||||
|
{{ adapter.quote("BillingAddressLine1") }} as billing_address_line_1,
|
||||||
|
{{ adapter.quote("BillingAddressLine2") }} as billing_address_line_2,
|
||||||
|
{{ adapter.quote("PhoneNumberConfirmed") }} as is_phone_number_confirmed,
|
||||||
|
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_loaded_at_date
|
||||||
|
|
||||||
|
from raw_user
|
||||||
|
)
|
||||||
|
select *
|
||||||
|
from stg_core__user
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue