schema and tests

This commit is contained in:
Pablo Martin 2024-09-03 17:52:00 +02:00
parent 9a6490e7fd
commit c35c5cb033

View file

@ -12,4 +12,234 @@ models:
tests:
- unique
- not_null
# Plenty of stuff pending. You cheeky Pablo
- name: id_booking
data_type: text
description: ""
tests:
- not_null:
where: created_at_utc > '2024-04-01T00:00:00Z' and verification_status != 'InsufficientInformation'
- name: id_user
data_type: text
description: ""
tests:
- not_null
- name: id_listing
data_type: text
description: An ID for the listing related to the booking.
- name: version
data_type: text
description: |
Indicates whether the verification is for V1 (Athena) or V2
(e-deposit).
tests:
- not_null
- accepted_values:
values:
- 'V1'
- 'V2'
- name: nightly_fee_local
data_type: numeric
description: |
The fee per night to be charged for this verification, in the currency
of the user. Note that the Athena/e-deposit user also has a configured
nightly fee. It's unclear at this point which one has priority for
billing.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 100
strictly: true
- name: verification_status
data_type: text
description: |
This field shows the outcome of the Verification itself.
tests:
- not_null
- accepted_values:
values:
- "Approved"
- "Flagged"
- "Rejected"
- "InsufficientInformation"
- name: verification_status_reason
data_type: text
description: Not used, ignore.
- name: email_flag
data_type: text
description: |
Null if the email shows no issues, otherwise it details the problems
attached to the given email.
tests:
- accepted_values:
values:
- "Email address is not deliverable"
- "Email domain is not registered"
- "Email domain listed as disposable"
- name: phone_flag
data_type: text
description: |
Null if the phone number shows no issues, otherwise it details the
problems attached to the given phone number.
tests:
- accepted_values:
values:
- "Phone number not reachable"
- "Not a real phone number"
- "Phone number is disposable"
- name: watch_list
data_type: text
description: ""
tests:
- accepted_values:
values:
- "Match"
- "No Match"
- name: channel
data_type: text
description: ""
- name: checkin_at_utc
data_type: timestamp without time zone
description: ""
- name: checkout_at_utc
data_type: timestamp without time zone
description: ""
- name: is_cancelled
data_type: boolean
description: |
Indicates if the booking has been cancelled or not. At the source,
null and false values have the same meaning, so here we turn nulls
into false to keep thing simple.
tests:
- not_null
- accepted_values:
values:
- true
- false
- name: cancelled_at_utc
data_type: timestamp without time zone
description: If the booking was cancelled, when did we learn about it.
tests:
- not_null:
where: is_cancelled = true
- name: user_email
data_type: text
description: |
The email of the Athena/e-deposit partner user. This email can be
joined with a superhog platform user to get their id, and then with
the electronic deposit user table to get data related to the partner
such as fees, currencies, protection levels, etc.
- name: guest_email
data_type: text
description: ""
- name: guest_last_name
data_type: text
description: ""
- name: guest_first_name
data_type: text
description: ""
- name: guest_telephone
data_type: text
description: ""
- name: company_name
data_type: text
description: ""
- name: property_manager_name
data_type: text
description: ""
- name: property_manager_email
data_type: text
description: ""
- name: listing_name
data_type: text
description: ""
- name: listing_town
data_type: text
description: ""
- name: listing_address
data_type: text
description: ""
- name: listing_country
data_type: text
description: ""
- name: listing_postcode
data_type: text
description: ""
- name: pets_allowed
data_type: boolean
description: ""
- name: level_of_protection_amount
data_type: integer
description: Ignore.
- name: level_of_protection_currency
data_type: text
description: Ignore.
- name: attachments
data_type: text
description: ""
- name: status_updated_at_utc
data_type: timestamp without time zone
description: |
Timestamp of the last time the record was modified before screening
happened. Only relevant for V1 records.
tests:
- not_null:
where: version = 'V1'
- name: updated_at_utc
data_type: timestamp without time zone
description: |
Timestamp of the last edit of the record, as set by the
Athena/e-deposit application.
tests:
- not_null
- name: creation_at_utc
data_type: timestamp without time zone
description: |
A client-provided timestamp of when the booking was created. It's an
optional field.
- name: created_at_utc
data_type: timestamp without time zone
description: The internal timestamp of when this record was created.
tests:
- not_null
- name: cosmos_db_timestamp_utc
data_type: timestamp with time zone
description: The internal Cosmos DB timestamp of the last record update.
tests:
- not_null