data-dwh-dbt-project/seeds/schema.yml

155 lines
5.8 KiB
YAML
Raw Normal View History

2024-02-23 13:59:13 +01:00
version: 2
seeds:
- name: stg_seed__currencies
description: |
A list of valid current currencies according to ISO 4217.
The list was obtained from https://www.six-group.com/en/products-services/financial-information/data-standards.html#scrollTo=isin
config:
column_types:
iso_4217_numeric_code: varchar(3)
columns:
- name: iso_4217_code
data_type: character varying
description: The 3 character ISO 4217 code for this currency, in Uppercase.
2025-01-13 16:00:35 +01:00
data_tests:
2024-02-23 13:59:13 +01:00
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: "^[A-Z]{3}$"
- name: iso_4217_numeric_code
data_type: character varying
description: The 3 digit ISO 4217 numeric code for this currency.
2025-01-13 16:00:35 +01:00
data_tests:
2024-02-23 13:59:13 +01:00
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: "^[0-9]{3}$"
- name: decimal_positions
data_type: int
2024-03-12 11:22:20 +01:00
description: |
2024-02-23 13:59:13 +01:00
The decimal positions that lead to this currency smallest unit.
For example: since Japanese Yen (JPY) have no cents, this value is 0.
On the other hand, since the US Dollar (USD) is composed of cents, and each dollar equals 100 cent, this value is 2.
To convert from normal unit (Dollar) to smallest unit (Cent), multiply by `10^decimal_positions`.
To convert from smallest unit (Cent) to normal unit (Dollar), divide by `10^decimal_positions`.
2025-01-13 16:00:35 +01:00
data_tests:
2024-02-23 13:59:13 +01:00
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 8
strictly: False
2024-08-28 17:15:33 +02:00
2024-08-29 17:29:21 +02:00
- name: stg_seed__guest_services_vat_rates_by_country
2024-08-28 17:15:33 +02:00
description: |
A list of applicable VAT rates for guest services, by country.
The list was provided by the Finance team. A value of 0% does not
necessarily mean that the country doesn't have VAT, but rather that we
don't need to charge it to guests from that country.
2024-10-01 15:52:30 +02:00
Country names and codes _almost_ follow ISO 3166-1 (https://en.wikipedia.org/wiki/ISO_3166-1).
The only exception sits in the Kosovo record. Kosovo does not appear as a country in ISO 3166, but is nevertheless
a valid country in the `Country` table of the Superhog backend database. Because of this, we need to include it.
The present codes are made up (not truly ISO 3166 codes) and match the ones present in the backend.
2024-08-28 17:15:33 +02:00
Read more here: https://www.notion.so/knowyourguest-superhog/Guest-Services-Taxes-How-to-calculate-a5ab4c049d61427fafab669dbbffb3a2?pvs=4
config:
column_types:
country_code: varchar(3)
columns:
2024-08-29 17:29:21 +02:00
- name: country_name
2024-08-28 17:15:33 +02:00
data_type: character varying
description: The name of the country.
2024-09-12 15:41:34 +02:00
2025-01-13 16:00:35 +01:00
data_tests:
2024-08-28 17:15:33 +02:00
- not_null
- unique
- name: alpha_2
data_type: character varying
description: |
The two characters ISO 3166-1 Alpha-2 code for the country.
2025-01-13 16:00:35 +01:00
data_tests:
2024-08-28 17:15:33 +02:00
- not_null
- unique
- dbt_expectations.expect_column_values_to_match_regex:
regex: "^[A-Za-z]{2}$"
- name: alpha_3
data_type: character varying
description: |
The three characters ISO 3166-1 Alpha-3 code for the country.
2025-01-13 16:00:35 +01:00
data_tests:
2024-08-28 17:15:33 +02:00
- not_null
- unique
- dbt_expectations.expect_column_values_to_match_regex:
regex: "^[A-Za-z]{3}$"
- name: country_code
data_type: character varying
description: |
The three digit ISO 3166-1 Numeric code for the country.
2025-01-13 16:00:35 +01:00
data_tests:
2024-08-28 17:15:33 +02:00
- not_null
- unique
- dbt_expectations.expect_column_values_to_match_regex:
regex: "^[0-9]{3}$"
- name: vat_rate
data_type: numeric
description: |
The Superhog applicable VAT rate for guests of this country. A value
of 0% does not necessarily mean that the country doesn't have VAT, but
rather that we don't need to charge it to guests from that country.
2025-01-13 16:00:35 +01:00
data_tests:
2024-08-28 17:15:33 +02:00
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
max_value: 1
strictly: false
2024-10-10 14:31:09 +02:00
- name: stg_seed_guesty_claims_snapshot_20241010
description: |
A list of claims that have been paid out within the Athena/Guesty line of
business.
The data was shared on 2024-10-10 by Chloe from Resolutions in a static
file, and was added to the DWH to support this ticket: https://guardhog.visualstudio.com/Data/_boards/board/t/Data%20Team/Stories/?workitem=22703
This is a static snapshot and we currently have no intent of maintaining up to date.
columns:
- name: "Booking ID"
data_type: character varying
description: |
The internal ID of this booking in Athena. Matches with the booking ID
in the Athena verifications table.
- name: "Claim Date"
data_type: timestamp
description: When was the claim received by Superhog.
- name: "Settled Date"
data_type: timestamp
description: |
When was the outcome of the claim decided by Superhog. Do not confuse
with when was the payment executed or received.
- name: "Paid Date"
data_type: timestamp
description: |
When was the settlement amount payment executed by Superhog.
- name: Settlement Currency
data_type: character varying
description: ISO4217 code of the currency in which the claim was posted.
- name: Settlement Amount
data_type: numeric
description: |
How much Superhog decided to pay out to the partner as part of this
claim, defined in the settlement currency.