mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-19 04:14:00 +00:00
Accommodate new service type and update on-time logic
This commit is contained in:
@@ -209,8 +209,9 @@ fct_and_dim_joins AS (
|
|||||||
-- On time delivery boolean (CIEF internal SLA)
|
-- On time delivery boolean (CIEF internal SLA)
|
||||||
CASE
|
CASE
|
||||||
-- On-time boolean is null when order is not complete
|
-- On-time boolean is null when order is not complete
|
||||||
WHEN service_type IN ('BA') THEN NULL
|
WHEN service_type IN ('BA', 'RECEIVED-ON-BEHALF') THEN NULL
|
||||||
WHEN transaction_status NOT IN ('UPLOADED_BANK_SLIP') THEN NULL
|
WHEN transaction_status NOT IN ('UPLOADED_BANK_SLIP') THEN NULL
|
||||||
|
WHEN order_created_datetime < '2023-01-01' THEN NULL
|
||||||
WHEN estimated_order_delivery_datetime_website_sla > orders.operation_uploaded_bank_slip_datetime THEN 1
|
WHEN estimated_order_delivery_datetime_website_sla > orders.operation_uploaded_bank_slip_datetime THEN 1
|
||||||
WHEN estimated_order_delivery_datetime_website_sla < orders.operation_uploaded_bank_slip_datetime THEN 0
|
WHEN estimated_order_delivery_datetime_website_sla < orders.operation_uploaded_bank_slip_datetime THEN 0
|
||||||
ELSE -999
|
ELSE -999
|
||||||
@@ -219,8 +220,9 @@ fct_and_dim_joins AS (
|
|||||||
-- On time delivery boolean (Customer Expectation)
|
-- On time delivery boolean (Customer Expectation)
|
||||||
CASE
|
CASE
|
||||||
-- On-time boolean is null when order is not complete
|
-- On-time boolean is null when order is not complete
|
||||||
WHEN service_type IN ('BA') THEN NULL
|
WHEN service_type IN ('BA', 'RECEIVED-ON-BEHALF') THEN NULL
|
||||||
WHEN transaction_status NOT IN ('UPLOADED_BANK_SLIP') THEN NULL
|
WHEN transaction_status NOT IN ('UPLOADED_BANK_SLIP') THEN NULL
|
||||||
|
WHEN order_created_datetime < '2023-01-01' THEN NULL
|
||||||
WHEN estimated_order_delivery_datetime_customer_expectation > orders.operation_uploaded_bank_slip_datetime THEN 1
|
WHEN estimated_order_delivery_datetime_customer_expectation > orders.operation_uploaded_bank_slip_datetime THEN 1
|
||||||
WHEN estimated_order_delivery_datetime_customer_expectation < orders.operation_uploaded_bank_slip_datetime THEN 0
|
WHEN estimated_order_delivery_datetime_customer_expectation < orders.operation_uploaded_bank_slip_datetime THEN 0
|
||||||
ELSE -999
|
ELSE -999
|
||||||
|
|||||||
@@ -536,6 +536,8 @@ purchase_order_invoice_status_redefined AS (
|
|||||||
CASE
|
CASE
|
||||||
WHEN order_status IN ('REFUNDED')
|
WHEN order_status IN ('REFUNDED')
|
||||||
THEN 'ORDER_REFUNDED'
|
THEN 'ORDER_REFUNDED'
|
||||||
|
WHEN order_status IN ('EXPIRED')
|
||||||
|
THEN 'ORDER_EXPIRED'
|
||||||
WHEN order_status IN ('COMPLETED', 'APPROVED') AND cost_status IS NULL
|
WHEN order_status IN ('COMPLETED', 'APPROVED') AND cost_status IS NULL
|
||||||
THEN 'PENDING_GENERATE_WHITE_FORM'
|
THEN 'PENDING_GENERATE_WHITE_FORM'
|
||||||
WHEN order_status IN ('COMPLETED', 'APPROVED') AND cost_status IN ('PENDING_VERIFICATION')
|
WHEN order_status IN ('COMPLETED', 'APPROVED') AND cost_status IN ('PENDING_VERIFICATION')
|
||||||
|
|||||||
Reference in New Issue
Block a user