version: 2
models:
  - name: silver__nft_mint_price
    description: intermediary model for getting an nft's mint price
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - MINT
            - PAYER
            - MINT_CURRENCY
      - compare_model_subset:
          name: silver__nft_mint_price_business_logic_test
          compare_model: ref('testing__nft_mint_price')
          compare_columns: 
            - program_id
            - payer
            - mint
            - mint_currency
            - round(mint_price,8)
          model_condition: "where mint in ('5huRn5xdFZVi8TY2WEYyqimMiBJQPP1uQQcoFqNZb2oG',
            '5AbpcVMnyxgK1UfZRrYDD5iiFWWBXUVnAqLifa9n7Bm8',
            'A3PFimLjQFwFt9mHWLuXWQwfpaBBpp2CEp6uTR6yccKr',
            '4CLQnbNKynn6qXF1S4woTxbiuPYREoEYbkXtvoYyzvxQ',
            '5Awi9epmw6EYXzLnzkSu7qJKiZ4HnnDsJ3ix9Wxrt6DC',
            'AXJFRmLT11RnuFEgYC35F9tktdL77xX8y1b4HEbXPJkf',
            '3SQcD75fEJsDPgGCPsqpbD4N2XyDHCCcLDB26UiUU6wa',
            '7onpWcfER4oz1KLPJMB6mRCXx9EXvDAWsoy4ZnVCkWun',
            '5f7x2JEiJ2jq1xwVTf4fMs8b5ecBt6s5HgAkajuiK5yh',
            'SnFYS4FwpRyUziz9fQ68v5A2aGKqRDaNAv5AVaMPQja')"
    columns:
      - name: BLOCK_TIMESTAMP
        description: "block timestamp of the latest transaction with a mint price"
        tests:
          - not_null
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 3
      - name: TX_IDS
        description: "set of transaction ids that has an associated mint price"
        tests:
          - not_null
      - name: MINT
        description: "{{ doc('mint') }}"
        tests: 
          - not_null
      - name: PAYER 
        description: "{{ doc('mint_payer') }}"
        tests: 
          - not_null:
              where: mint_price is not null
      - name: MINT_CURRENCY
        description: "{{ doc('mint_currency') }}"
        tests: 
          - not_null:
              where: mint_price is not null
      - name: PROGRAM_ID
        description: "{{ doc('program_id') }}"
        tests: 
          - not_null
      - name: MINT_PRICE
        description: "{{ doc('mint_price') }}"
      - name: RANKING
        description: ranking order for which model to take mint price from first
        tests:
          - not_null
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('_inserted_timestamp') }}"
        tests: 
          - not_null