version: 2
models:
  - name: marinade__ez_swaps
    description: "{{ doc('marinade_ez_swaps') }}"
    recent_date_filter: &recent_date_filter
      config:
        where: block_timestamp >= current_date - 7
    recent_modified_date_filter: &recent_modified_date_filter
      config:
        where: modified_timestamp >= current_date - 7
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_modified_date_filter
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter
      - name: TX_ID
        description: "{{ doc('tx_id') }}"
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter
      - name: SWAPPER
        description: "{{ doc('swaps_swapper') }}" 
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter
      - name: SWAP_FROM_AMOUNT
        description: "{{ doc('swaps_from_amt') }}" 
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter
      - name: SWAP_FROM_MINT
        description: "{{ doc('swaps_from_mint') }}"
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter
      - name: SWAP_FROM_AMOUNT_USD
        description: "{{ doc('swap_from_amount_usd') }}" 
        tests:
          - dbt_expectations.expect_column_to_exist
      - name: SWAP_FROM_SYMBOL
        description: "{{ doc('swap_from_symbol') }}"
        tests:
          - dbt_expectations.expect_column_to_exist
      - name: SWAP_TO_AMOUNT
        description: "{{ doc('swaps_to_amt') }}"
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter
      - name: SWAP_TO_MINT
        description: "{{ doc('swaps_to_mint') }}" 
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter
      - name: SWAP_TO_AMOUNT_USD
        description: "{{ doc('swap_to_amount_usd') }}"
        tests:
          - dbt_expectations.expect_column_to_exist
      - name: SWAP_TO_SYMBOL
        description: "{{ doc('swap_to_symbol') }}"
        tests:
          - dbt_expectations.expect_column_to_exist
      - name: PROGRAM_ID
        description: "{{ doc('program_id') }}" 
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter
      - name: PLATFORM
        description: "{{ doc('dex_platform') }}"
        tests:
          - not_null: *recent_date_filter
      - name: MARINADE_EZ_SWAPS_ID
        description: '{{ doc("pk") }}' 
        tests:
          - not_null: *recent_date_filter
          - unique: *recent_date_filter    
      - name: INSERTED_TIMESTAMP
        description: '{{ doc("inserted_timestamp") }}'
        tests:
          - dbt_expectations.expect_column_to_exist
          - not_null: *recent_date_filter    
      - name: MODIFIED_TIMESTAMP
        description: '{{ doc("modified_timestamp") }}'
        tests:
          - dbt_expectations.expect_column_to_exist