version: 2
models:
  - name: silver__nft_mints
    recent_date_filter: &recent_date_filter
      config:
        where: _inserted_timestamp >= current_date - 7
    tests:
      - unique:
          column_name: nft_mints_id
          config:
            where: _inserted_timestamp >= current_date - 7
      - compare_model_subset:
          name: silver__nft_mints_business_logic_test
          compare_model: ref('testing__nft_mints')
          compare_columns: 
            - mint
            - purchaser
            - mint_currency
            - round(mint_price,8)
          model_condition: "where mint in ('zsFUFcetxjLCeUaNjsQE57b3c3awU79sVeTZQrsoSq6','8XQqL7wwKrGftLaSnd8Km9WnA6bwT1B1w2NXrxQfxU6t',
            '8miSwDxQNV9W7LHPRzXEMXwk4oYHU29fxFi5LAaS3Zoo','CArsPMgQyevzmE4SYDjVaeWvoNwEMsE4cwbCyXrPGtE5','YcDLuwoqB8yWcfnwNDrjoSo4iuVmTCz27ZXsh6w12mo',
            '6HBSxEKHJzS19aKhFhzWeYRM9QezKk1QGKug3QLFw8AU','3ry2VrRvehb6Z7roeXaAzzQuqheeM2wyWHTmgMUtZZSk','FUHUjD4z1YDDRGqZAL4n89HsuDEFhVLcoz47LJirCnBm',
            'FaC8SaDj6crwZA5JyucbKuTDbbTLbCSVpGbLVSXxaxJ4','BxGPRSEzHwEzX73Ep67a9u5xFc2BSuXSrAevqNMkzN8Z','HrbK1X3ooR2fBujtDSWeKQtbj1fUtptrEb7mWvsxeQQk',
            'CmejwsHB1hcQPbY7y4EjYD5gxWJEXn9G4PkXLpLoTus1','JBzLjej5DEtVupwVtn6y1mnG4HFEkm5PVxQYFNYMJzhc','J5EFUxYPxAyx5oCUUgmCrESHjhmXuzrYsscoxRvVW5Vz',
            'DCahWcCagbsW8HAqu4QMDaQZn212MrA7aN4yLNKYn3tY','58MAJPUgfSyehsKggYEeWjpNZaKw5qxnLNZ4EKeRicmq','Dq6H4jMXQkHEf3q3BocptwF7Nh6V9FZwABXuVRgRXtts',
            'Ar9mEJ7qJ1uAgkWduKGo3UYVbPMdKrmWxs5z2wgZgbgN','4CLQnbNKynn6qXF1S4woTxbiuPYREoEYbkXtvoYyzvxQ','5huRn5xdFZVi8TY2WEYyqimMiBJQPP1uQQcoFqNZb2oG',
            '5AbpcVMnyxgK1UfZRrYDD5iiFWWBXUVnAqLifa9n7Bm8','5Awi9epmw6EYXzLnzkSu7qJKiZ4HnnDsJ3ix9Wxrt6DC', 'AXJFRmLT11RnuFEgYC35F9tktdL77xX8y1b4HEbXPJkf',
            '7onpWcfER4oz1KLPJMB6mRCXx9EXvDAWsoy4ZnVCkWun','3SQcD75fEJsDPgGCPsqpbD4N2XyDHCCcLDB26UiUU6wa', 'SnFYS4FwpRyUziz9fQ68v5A2aGKqRDaNAv5AVaMPQja',
            '5f7x2JEiJ2jq1xwVTf4fMs8b5ecBt6s5HgAkajuiK5yh','ATshnVFBvgNhPtBLphmuhcAKYAVe5ytmeKeefwBxtYnq', '4JpwpBsSo2rdhCHsNKEz23uwT9gtoqH2KjLi68S6MMmm')"
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - not_null:
              where: block_id > 39824213
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 3
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
        tests:
          - not_null: *recent_date_filter
      - name: INITIALIZATION_TX_ID
        description: "{{ doc('tx_id') }}"
        tests:
          - not_null: *recent_date_filter
      - name: SUCCEEDED
        description: "{{ doc('tx_succeeded') }}"
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter
      - name: PROGRAM_ID 
        description: "{{ doc('program_id') }}"
        tests: 
          - not_null:
              where: mint_price is not null and _inserted_timestamp >= current_date - 7
      - name: PURCHASER
        description: "{{ doc('purchaser') }}"
        tests: 
          - not_null:
              where: mint_price is not null and _inserted_timestamp >= current_date - 7
      - name: MINT_CURRENCY
        description: "{{ doc('mint_currency') }}"
        tests: 
          - not_null:
              where: mint_price is not null and _inserted_timestamp >= current_date - 7
      - name: MINT 
        description: "{{ doc('mint') }}"
        tests: 
          - not_null: *recent_date_filter
      - name: TOKEN_ACCOUNT
        description: The token's account - this can be used to join to the token account owners table. 
      - name: MINT_PRICE
        description: "{{ doc('mint_price') }}"
        tests: 
          - not_null: 
              enabled: FALSE
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('_inserted_timestamp') }}"
        tests: 
          - not_null