version: 2
models:
  - name: silver___early_swaps
    description: Records of all transactions that have occurred on Osmosis, dating back to the genesis block. 
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - TX_ID
    columns:
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER    
                - FLOAT  
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - TIMESTAMP_NTZ
      - name: BLOCKCHAIN
        description: "{{ doc('blockchain') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: CHAIN_ID
        description: "{{ doc('chain_id') }}"
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: TX_ID
        description: "{{ doc('tx_id') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: TX_STATUS
        description: "{{ doc('tx_status') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: TRADER
        description: "{{ doc('trader') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
          - dbt_expectations.expect_column_values_to_match_regex:
              regex: osmo1[0-9a-z]{38,38}
      - name: FROM_AMOUNT
        description: "{{ doc('from_amount') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: FROM_CURRENCY
        description: "{{ doc('from_currency') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: FROM_DECIMAL
        description: "{{ doc('from_decimal') }}"
        tests: 
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: TO_AMOUNT
        description: "{{ doc('to_amount') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: TO_CURRENCY
        description: "{{ doc('to_currency') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: TO_DECIMAL
        description: "{{ doc('to_decimal') }}"
        tests: 
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: POOL_IDS
        description: "{{ doc('pool_id') }}"
        tests: 
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - ARRAY 
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('inserted_timestamp') }}"
        tests:
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - TIMESTAMP_NTZ
