version: 2
models:
  - name: silver__nft_sales_magic_eden_v2
    description: intermediary model for sales on Magic Eden V2
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - TX_ID
      - compare_model_subset:
          name: silver__nft_sales_magic_eden_v2_business_logic_test
          compare_model: ref('testing__nft_sales_magic_eden_v2')
          compare_columns: 
            - tx_id
            - purchaser
            - seller
            - mint
            - round(sales_amount,8)
          model_condition: "where tx_id in ('28PWDFj8Cxb9YihmGqN6CeU5iNrNW1fiZ5mxVbu8Sox61uiTH2m57duJ4F5pv7DahNPr2oAN7umziBCHab6FCBXR',
            '2opUe8cZkhMrVQBNy9McDZThPdW7gFoFzf4J6TnX3QUKAQi9pfDZoYwAQFcvDrQBfzg2Jw7SXhx6D5Y6kdPh68oY',
            '4hr1zeCVBHT1FGgcHad19tp8Jp9Q6itcKHjRLK7uuVVwjhDbSDG2hrEm6Zfd73RiNnu9sqQbBfpo798viibFunWi',
            '4iq2miqiFfJXw7gKHunTLnLyzFDom13vakh25DUXZRFDnZaUC9KztFbcqx9L9Up8WB7u6qd3NyuoCsHMNKHrBHYV',
            '3WsFjjoNNUH85N8qf3FkA5Qf8PVT2VT2BZJxjLLFq8qybh3TJqiz182aJz4mhydgcx1CoEpenRbZ28vrqMEWzPzn',
            '2L6ki6khMddp56WYeNiKnS5ZVwtk63x3Y3RanP63kobANx51XbCFTyX97C2aoLQZMZ3P5kKSRZc1KxiB1DU2KuNs',
            '3qp2hRooXJaatbBuNyfT271aNhmgvAa8iVqDkALxHTaaqS2BLXeZUB6eXWhJy3nDU4gMLwtP3UriqWRvUyeUfpmu',
            '5eEkaFyoKGvuTRKbV6G8yKaJrsgqDMer1fXTR9tA4Ab3MTNuKkALKdT4Mdzs3K8sTbJmfB69UQuuDH54QREZhJHa',
            '3kP1mPBGASKQFECHcMbDhTLWkNcW497idg9qGbJ2pvza8ppmDEBwd6qokPaqWsUkoTYTK3CuoAbJMQc3XEFrHURy',
            '2pefayEWXHTHuE2D8imy8JyR3smhwouh83jtX9meAPtyaNwzsSrBhiDT8pDRVUHptUiRGoX3sNWeKKjEWzfJh4Sh',
            'EMNndx2kUTZ2gPKhUC5DTQNuK1eVDBqMYfWvrnEHA1uAnpa5JC5HpjatDDBKey3b3zT9xDvAH9rB8B47SoV7nmK')"
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - not_null
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 2
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
        tests:
          - not_null
      - name: TX_ID
        description: "{{ doc('tx_id') }}"
        tests:
          - not_null
      - name: SUCCEEDED
        description: "{{ doc('tx_succeeded') }}"
        tests:
          - not_null
      - name: PROGRAM_ID 
        description: "{{ doc('program_id') }}"
        tests: 
          - not_null
      - name: PURCHASER
        description: "{{ doc('purchaser') }}"
        tests: 
          - not_null
      - name: SELLER
        description: "{{ doc('seller') }}"
        tests: 
          - not_null: 
              where: succeeded = TRUE
      - name: MINT
        description: "{{ doc('mint') }}"
        tests: 
          - not_null:
              where: succeeded = TRUE
      - name: SALES_AMOUNT
        description: "{{ doc('sales_amount') }}"
        tests: 
          - not_null
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('_inserted_timestamp') }}"
        tests: 
          - not_null