diff --git a/models/intermediate/resolutions/schema.yml b/models/intermediate/resolutions/schema.yml index b525438..a8e339d 100644 --- a/models/intermediate/resolutions/schema.yml +++ b/models/intermediate/resolutions/schema.yml @@ -88,6 +88,11 @@ models: - name: resolution_time_in_hours data_type: numeric description: "Time taken to resolve the incident, in hours, if completed." + data_tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: true + where: "document_version <> 'OldClaimToIncidentModel'" - name: number_damaged_items data_type: bigint @@ -139,12 +144,20 @@ models: description: "Guest verification status for this booking." - name: lower_protection_limit_usd - data_type: text + data_type: numeric description: "Lower protection limit in USD." + data_tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false - name: upper_protection_limit_usd - data_type: text + data_type: numeric description: "Upper protection limit in USD." + data_tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false - name: calculated_payout_amount_in_txn_currency data_type: text @@ -158,7 +171,8 @@ models: data_type: text description: "Currency of the calculated payout amount." data_tests: - - not_null + - not_null: + where: "calculated_payout_amount_in_txn_currency > 0" - name: calculated_payout_amount_in_usd data_type: text @@ -274,7 +288,8 @@ models: data_type: text description: "Currency of the deposit retained." data_tests: - - not_null + - not_null: + where: "deposit_retained_amount_in_txn_currency > 0 and document_version <> 'OldClaimToIncidentModel'" - name: has_guest_contributed_to_cost data_type: boolean @@ -285,26 +300,49 @@ models: description: "If the host has taken any action to prevent the damage or further damage once identified" - name: guest_contribution_amount_in_txn_currency - data_type: text - description: "Amount of the guest contribution, in case they did, in local currency." + data_type: numeric + description: "Amount of the guest contribution, in case they did, + in local currency." + data_tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false - name: guest_contribution_currency data_type: text description: "Currency of the guest contribution." + data_tests: + - not_null: + where: "guest_contribution_amount_in_txn_currency > 0 and document_version <> 'OldClaimToIncidentModel'" - name: guest_contacted_about_damage data_type: boolean description: "If the host has contacted the guest about the damage caused" - name: id_accommodation - data_type: text + data_type: numeric description: "Superhog code that uniquely identifies a single accommodation." - - - name: id_booking - data_type: text - description: "Superhog unique booking ID." data_tests: - not_null + - relationships: + to: ref('stg_core__accommodation') + field: id_accommodation + where: "document_version <> 'OldClaimToIncidentModel'" + + - name: accommodation_name + data_type: text + description: "Accommodation name." + + - name: id_booking + data_type: numeric + description: "Superhog unique booking ID" + data_tests: + - not_null: + where: "document_version <> 'OldClaimToIncidentModel'" + - relationships: + to: ref('stg_core__booking') + field: id_booking + where: "document_version <> 'OldClaimToIncidentModel'" - name: booking_status data_type: text