From d0b8d4a8dfc3040d79d28170244c2c1fd27bf5cb Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 13 May 2024 16:09:56 +0200 Subject: [PATCH] contacts --- .../intermediate/xero/int_xero__contacts.sql | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 models/intermediate/xero/int_xero__contacts.sql diff --git a/models/intermediate/xero/int_xero__contacts.sql b/models/intermediate/xero/int_xero__contacts.sql new file mode 100644 index 0000000..e43e5f9 --- /dev/null +++ b/models/intermediate/xero/int_xero__contacts.sql @@ -0,0 +1,46 @@ +with stg_xero__contacts as (select * from {{ ref("stg_xero__contacts") }}) +select + id_contact, + account_number, + case + when account_number ~ '^[0-9]{10,11}$' then account_number else null + end as id_deal, + contact_name, + is_customer, + is_supplier, + tax_number, + contact_first_name, + contact_last_name, + phones, + website, + balances, + discount, + addresses, + attachments, + email_addresses, + payment_terms, + batch_payments, + branding_theme, + contact_groups, + contact_number, + contact_status, + skyper_user_name, + contact_persons, + has_attachments, + updated_at_utc, + updated_date_utc, + xero_network_key, + default_currency_iso_4217, + validation_errors, + bank_account_details, + has_validation_errors, + tracking_category_name, + account_payable_tax_type, + tracking_category_option, + sales_default_account_code, + sales_tracking_categories, + account_receivable_tax_type, + purchases_default_account_code, + purchases_tracking_categories, + dwh_extracted_at_utc +from stg_xero__contacts