version: 2
models:
  - name: silver__locked_liquidity_balances
    description: A table of each locked liquidity balance change for wallets on the Osmosis chain. 
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - ADDRESS
            - BLOCK_ID
            - LOCK_ID
            - CURRENCY
      - compare_model_subset:
          name: silver__locked_liquidity_balances_business_logic_test
          compare_model: ref('testing__locked_liquidity_balances')
          compare_columns: 
            - block_id
            - balance_type
            - address
            - lock_id
            - currency
            - balance
          model_condition: "where block_timestamp::date = '2022-07-20' 
                and block_ID IN  (5230815,5242128,5239892,5238935,5230342,5233986,5234464,5230342,5228474,5229227)"
    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: ADDRESS
        description: "{{ doc('address') }}"
        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: LOCK_ID
        description: "{{ doc('lock_id') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: BALANCE 
        description: The amount of the currency the wallet held at the given time
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - NUMBER
                - FLOAT
      - name: CURRENCY
        description: "{{ doc('currency') }}"
        tests: 
          - not_null
          - dbt_expectations.expect_column_values_to_be_in_type_list:
              column_type_list:
                - STRING
                - VARCHAR
      - name: DECIMAL 
        description: "{{ doc('decimal') }}"
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('ingested_at') }}"
        tests: 
          - not_null