diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_ab1.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_ab1.sql index 916e13a..e08806f 100644 --- a/models/generated/airbyte_ctes/unibag/order_deliveries_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_ab1.sql @@ -23,6 +23,7 @@ select {{ json_extract_scalar('_airbyte_data', ['trackingTime'], ['trackingTime']) }} as trackingtime, {{ json_extract_scalar('_airbyte_data', ['isAdminChange'], ['isAdminChange']) }} as isadminchange, {{ json_extract_scalar('_airbyte_data', ['trackingOrderCode'], ['trackingOrderCode']) }} as trackingordercode, + {{ json_extract_scalar('_airbyte_data', ['weight'], ['weight']) }} as weight, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_ab2.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_ab2.sql index be476dd..bd88883 100644 --- a/models/generated/airbyte_ctes/unibag/order_deliveries_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_ab2.sql @@ -23,6 +23,7 @@ select cast(trackingtime as {{ dbt_utils.type_string() }}) as trackingtime, {{ cast_to_boolean('isadminchange') }} as isadminchange, cast(trackingordercode as {{ dbt_utils.type_string() }}) as trackingordercode, + cast(weight as {{ dbt_utils.type_string() }}) as weight, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_ab3.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_ab3.sql index 783f982..68b2c60 100644 --- a/models/generated/airbyte_ctes/unibag/order_deliveries_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_ab3.sql @@ -24,6 +24,7 @@ select 'trackingtime', boolean_to_string('isadminchange'), 'trackingordercode', + 'weight', ]) }} as _airbyte_order_deliveries_hashid, tmp.* from {{ ref('order_deliveries_ab2') }} tmp diff --git a/models/generated/airbyte_tables/unibag/order_deliveries.sql b/models/generated/airbyte_tables/unibag/order_deliveries.sql index d459e8f..dbdfa55 100644 --- a/models/generated/airbyte_tables/unibag/order_deliveries.sql +++ b/models/generated/airbyte_tables/unibag/order_deliveries.sql @@ -32,6 +32,11 @@ select {{ adapter.quote('location') }}::json->>'fullAddress' AS location_full_address, {{ adapter.quote('customer') }}::json->>'name' AS customer_name, {{ adapter.quote('customer') }}::json->>'phone' AS customer_phone, + COALESCE(cast({{ adapter.quote('weight') }}::json->>'converted' AS numeric), 0) AS weight_converted, + COALESCE(cast({{ adapter.quote('weight') }}::json->>'convertedWithMultiplier' AS numeric), 0) AS weight_converted_with_multiplier, + COALESCE(cast({{ adapter.quote('weight') }}::json->>'multiplier' AS numeric), 0) AS weight_multiplier, + COALESCE(cast({{ adapter.quote('weight') }}::json->>'real' AS numeric), 0) AS weight_real, + COALESCE(cast({{ adapter.quote('weight') }}::json->>'sent' AS numeric), 0) AS weight_sent, {{ adapter.quote('order') }} AS order_id, createdat::timestamp AS created_at, updatedat::timestamp AS updated_at, diff --git a/models/generated/airbyte_tables/unibag/orders.sql b/models/generated/airbyte_tables/unibag/orders.sql index daaf0a2..751203c 100644 --- a/models/generated/airbyte_tables/unibag/orders.sql +++ b/models/generated/airbyte_tables/unibag/orders.sql @@ -31,6 +31,11 @@ select cast({{ adapter.quote('price') }}::json->>'weight' AS numeric) AS weight, {{ adapter.quote('delivery') }}::json->>'_id' AS delivery_id, cast({{ adapter.quote('delivery') }}::json->>'discountValue' AS numeric) AS delivery_discount_value, + COALESCE(cast({{ adapter.quote('delivery') }}::json->'weight'->>'converted' AS numeric), 0) AS delivery_weight_converted, + COALESCE(cast({{ adapter.quote('delivery') }}::json->'weight'->>'convertedWithMultiplier' AS numeric), 0) AS delivery_weight_converted_with_multiplier, + COALESCE(cast({{ adapter.quote('delivery') }}::json->'weight'->>'multiplier' AS numeric), 0) AS delivery_weight_multiplier, + COALESCE(cast({{ adapter.quote('delivery') }}::json->'weight'->>'real' AS numeric), 0) AS delivery_weight_real, + COALESCE(cast({{ adapter.quote('delivery') }}::json->'weight'->>'sent' AS numeric), 0) AS delivery_weight_sent, approvedat::timestamp AS approved_at, rejectedat::timestamp AS rejected_at, pickupat::timestamp AS pickup_at,