version: 2
models:
  - name: silver__nft_sales_tensorswap_buysellevent
    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: INDEX
        description: "{{ doc('event_index') }}"
        tests:  
          - not_null
      - name: INNER_INDEX
        description: "{{ doc('inner_index') }}"
      - name: LOG_INDEX
        description: "{{ doc('log_index') }}"
        tests: 
          - not_null
      - name: PROGRAM_ID 
        description: "{{ doc('program_id') }}"
        tests: 
          - not_null
      - name: EVENT_TYPE
        description: "{{ doc('event_type') }}"
        tests:
          - not_null
          - accepted_values:
              values: ["BuySellEvent"]
      - name: CREATOR_FEE
        description: "Part of `sales_amount` in SOL that goes to the creator"
        tests: 
          - not_null
      - name: MM_FEE
        description: "Part of `sales_amount` in SOL that goes to the market maker"
        tests: 
          - not_null
      - name: TSWAP_FEE
        description: "Part of `sales_amount` in SOL that goes to Tensor"
        tests: 
          - not_null
      - name: SALES_AMOUNT
        description: "{{ doc('sales_amount') }}"
        tests: 
          - not_null
          - dbt_utils.expression_is_true:
              expression: ">= 0"
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('_inserted_timestamp') }}"
        tests: 
          - not_null
      - name: NFT_SALES_TENSORSWAP_BUYSELLEVENT_ID
        description: '{{ doc("pk") }}'   
        tests: 
          - unique
      - name: INSERTED_TIMESTAMP
        description: '{{ doc("inserted_timestamp") }}'   
        tests: 
          - not_null
      - name: MODIFIED_TIMESTAMP
        description: '{{ doc("modified_timestamp") }}' 
        tests: 
          - not_null
      - name: _INVOCATION_ID
        description: '{{ doc("_invocation_id") }}' 
        tests: 
          - not_null:
              name: test_silver__not_null_nft_sales_tensorswap_buysellevent__invocation_id
      