diff --git a/models/staging/stripe/_stripe_sources.yml b/models/staging/stripe/_stripe_sources.yml index 0fae310..0f1783d 100644 --- a/models/staging/stripe/_stripe_sources.yml +++ b/models/staging/stripe/_stripe_sources.yml @@ -152,6 +152,11 @@ sources: - name: _airbyte_extracted_at data_type: timestamp with time zone description: "{{ doc('_airbyte_extracted_at_desc') }}" + tests: + - not_null + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 2 # How does this work? I need to make this more clear - name: _airbyte_meta data_type: jsonb description: "{{ doc('_airbyte_meta_desc') }}" @@ -165,18 +170,29 @@ sources: - name: id data_type: character varying description: "{{ doc('generic_id_desc') }}" + tests: + - unique + - not_null + - dbt_expectations.expect_column_values_to_match_regex: + regex: "^(ch|py)_.{24}$" - name: card data_type: jsonb description: "{{ doc('field_docs_na_desc') }}" - name: paid data_type: boolean description: "true if the charge succeeded, or was successfully authorized for later capture." + tests: + - not_null - name: order data_type: character varying description: "{{ doc('field_docs_na_desc') }}" - name: amount data_type: bigint description: "Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)." + tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 - name: object data_type: character varying description: "Silly column. The value is always `charge`."