From 05adc07674b7dbd0b704a0ce2ec133205df27e45 Mon Sep 17 00:00:00 2001 From: Joaquin Ossa Date: Fri, 21 Feb 2025 17:44:00 +0100 Subject: [PATCH] commit wip --- models/staging/resolutions/schema.yml | 49 +++++++++++++++++++ .../stg_resolutions__incidents.sql | 37 ++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/models/staging/resolutions/schema.yml b/models/staging/resolutions/schema.yml index 4ee8728..c6b9f3d 100644 --- a/models/staging/resolutions/schema.yml +++ b/models/staging/resolutions/schema.yml @@ -350,6 +350,55 @@ models: data_type: text description: "List of items that were damaged." + - name: protection_name + data_type: text + description: "Protection name." + + - name: was_overriden + data_type: boolean + description: "Flag to indicate if the proposed settlement value from + the calculator was overriden." + + - name: waiver_or_deposit_name + data_type: text + description: "Waiver or deposit name." + + - name: guest_verification_status + data_type: text + description: "Guest verification status for this booking." + + - name: lower_protection_limit_usd + data_type: text + description: "Lower protection limit in USD." + + - name: upper_protection_limit_usd + data_type: numeric + description: "Upper protection limit in USD." + + - name: calculated_payout_amount_in_txn_currency + data_type: numeric + description: "Calculated payout amount in local currency." + + - name: calculated_payout_currency + data_type: text + description: "Currency of the calculated payout amount." + + - name: calculated_payout_amount_in_usd + data_type: numeric + description: "Calculated payout amount in USD." + + - name: calculated_guest_charge_amount_in_txn_currency + data_type: numeric + description: "Calculated guest charge amount in local currency." + + - name: calculated_guest_charge_currency + data_type: text + description: "Currency of the calculated guest charge amount." + + - name: calculated_guest_charge_amount_in_usd + data_type: numeric + description: "Calculated guest charge amount in USD." + - name: third_party_claim_submitted data_type: boolean description: "If the host is seeking compensation from another platform" diff --git a/models/staging/resolutions/stg_resolutions__incidents.sql b/models/staging/resolutions/stg_resolutions__incidents.sql index 7a38fa4..57a9035 100644 --- a/models/staging/resolutions/stg_resolutions__incidents.sql +++ b/models/staging/resolutions/stg_resolutions__incidents.sql @@ -206,6 +206,43 @@ select -> 'DamageReport' ->> 'Items' as damage_report_items, + -- Calculator + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'ProtectionName' as protection_name, + ({{ adapter.quote("documents") }} -> 'SavedCalculation' ->> 'WasOverriden')::boolean + as was_overriden, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'WaiverOrDepositName' as waiver_or_deposit_name, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'GuestVerificationStatus' as guest_verification_status, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'LowerProtectionLimitUsd' as lower_protection_limit_usd, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'UpperProtectionLimitUsd' as upper_protection_limit_usd, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'SubmittedHostPayoutAmount' as calculated_payout_amount_in_txn_currency, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'SubmittedHostPayoutCurrency' as calculated_payout_currency, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'CalculatedHostPayoutAmountInUsd' as calculated_payout_amount_in_usd, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'SubmittedGuestChargeAmount' as calculated_guest_charge_amount_in_txn_currency, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'SubmittedGuestChargeCurrency' as calculated_guest_charge_currency, + {{ adapter.quote("documents") }} + -> 'SavedCalculation' + ->> 'CalculatedGuestChargeAmountInUsd' as calculated_guest_charge_amount_in_usd, + -- Third Party Compensation Claim ( {{ adapter.quote("documents") }}