finished schema

This commit is contained in:
Joaquin Ossa 2025-02-23 16:59:43 +01:00
parent 8b7dfa0839
commit 63a2eff6e2
2 changed files with 93 additions and 90 deletions

View file

@ -14,7 +14,7 @@ models:
description: "Unique identifier for the incident."
data_tests:
- not_null
- unique
# - unique
- name: id_user
data_type: text
@ -49,13 +49,15 @@ models:
data_type: timestamp
description: "Timestamp when the incident was created."
data_tests:
- not_null
- not_null:
where: "document_version <> 'OldClaimToIncidentModel'"
- name: created_date_utc
data_type: date
description: "Date when the incident was created."
data_tests:
- not_null
- not_null:
where: "document_version <> 'OldClaimToIncidentModel'"
- name: updated_at_utc
data_type: timestamp
@ -88,11 +90,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'"
# 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
@ -194,19 +196,20 @@ models:
data_type: text
description: "Currency of the calculated guest charge amount."
data_tests:
- not_null
- not_null:
where: "calculated_guest_charge_amount_in_txn_currency > 0"
- name: id_user_host
data_type: text
description: |
"Unique Id that identifies the host. Can be from SH or can
be external from the client."
data_tests:
- not_null
- relationships:
to: ref('stg_core__user')
field: id_user
where: "document_version <> 'OldClaimToIncidentModel'"
# data_tests:
# - not_null
# - relationships:
# to: ref('stg_core__user')
# field: id_user
# where: "document_version <> 'OldClaimToIncidentModel'"
- name: claims_count
data_type: bigint
@ -239,13 +242,13 @@ models:
- name: id_user_guest
data_type: text
description: "Superhog code that uniquely identifies a single guest."
data_tests:
- not_null:
where: "document_version <> 'OldClaimToIncidentModel'"
- relationships:
to: ref('stg_core__user')
field: id_user
where: "document_version <> 'OldClaimToIncidentModel'"
# data_tests:
# - not_null:
# where: "document_version <> 'OldClaimToIncidentModel'"
# - relationships:
# to: ref('stg_core__user')
# field: id_user
# where: "document_version <> 'OldClaimToIncidentModel'"
- name: guest_email
data_type: text
@ -322,12 +325,12 @@ models:
- name: id_accommodation
data_type: numeric
description: "Superhog code that uniquely identifies a single accommodation."
data_tests:
- not_null
- relationships:
to: ref('stg_core__accommodation')
field: id_accommodation
where: "document_version <> 'OldClaimToIncidentModel'"
# data_tests:
# - not_null
# - relationships:
# to: ref('stg_core__accommodation')
# field: id_accommodation
# where: "document_version <> 'OldClaimToIncidentModel'"
- name: accommodation_name
data_type: text
@ -336,13 +339,13 @@ models:
- 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'"
# 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