version: 2
models:
  - name: silver__bridge_wormhole_transfers
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - BRIDGE_WORMHOLE_TRANSFERS_ID
      - compare_model_subset:
          name: silver__bridge_wormhole_transfers_logic_test
          compare_model: ref('testing__bridge_wormhole_transfers')
          compare_columns: 
            - tx_id
            - program_id
            - direction
            - user_address
            - round(amount,8)
            - mint
          model_condition: "where tx_id in (
          '39QnQNLPgA8EfZdw6vbjQYdUhR9fb9Rw5K9EzJ7Br3S51yCY2NrSAi3YSM3F1rH6xYmvBE4oq9krSrjUvQGSrmzM',
          '3FrmUUacSrahxpqzViWF9A3ZkvkgXvArnxmrCSD9UjtWBuduPFPtfTw7SxJDgBBrhBfUhfxZYnL16nr9jCgU7Pvt',
          'faHTAkhRb1zs4nkwdvFMMCsnGi1ro3HrsAsqeq5kYPWaBsXo2ukFohPqE4ja1SYnFyEGAdSETAZZ3iMBDsbnhzH',
          '38ZPcqmWfzkW47aUVBnYWehPFGHUtvRJrH4XrWLLUSnxvvXndMFcntCe297ppp6RHbmpgQNbEM3pTvCn4mEF7o1V',
          '2C6vZnTWkJ3FXJpW1zj18dfWKLGH26GWSHUr9j6Mpx7hwBdauWoDkE6B8ra54qRPN6BBw4PTsvW8ZqUtFRV3Bgdr',
          'XtM25TbM8BW7L5JXoceVJoF41GuWMP69WjdxdWJUrKyYdV8DRXyGG81ey8JfRnS6UKYi67D2X3MYz1SCnVLvHmJ',
          '1NSyLSuHwMmb7c6DSW5wsqf8B85i5tdTrXrw1dPS3eGL46EikLhZm6qbHUQRZReLkcuR7Es42xAidmk54N13FgC',
          '1VFGjNWtmhTS6ahfvU5xxXHuQmMPF5bohEk5TEZyGsUrPRwEr92cz9UNtiY5scVsUtHUEFRu1mdqAoP4ydnCGVD',
          '3g7GGbBJpGDfCaa1MQVQGpieqYi6j9XWUtsUKXh6ogUi1ss7asthzd81irNrpx1WGW5h7B75FN7jhN4UCyicxgCe',
          '2AzNhDD9GWUrJvhhrdCcaVnuU4Mb3aZKNozhCMJZJ52b9SwrQNg42JVmcx2GvfCxk6cKaPGdSz8gUWqqpaznRg3f',
          '51bkYq62kFw9zX88KbbwBMGKeWgoNz7DXo8wU2aD6qbtL3LvvX2m58n6JS2HdYoUHmckHQkZMvnWA98aLQ1TAS29')"
    recent_date_filter: &recent_date_filter
      config:
        where: _inserted_timestamp >= current_date - 7
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - not_null: *recent_date_filter
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 2
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
        tests:
          - not_null: *recent_date_filter
      - name: TX_ID
        description: "{{ doc('tx_id') }}"
        tests:
          - not_null: *recent_date_filter
      - name: SUCCEEDED
        description: "{{ doc('tx_succeeded') }}"
        tests:
          - not_null: *recent_date_filter
      - name: PROGRAM_ID
        description: "{{ doc('program_id') }}"
        tests: 
          - not_null: *recent_date_filter
      - name: PLATFORM
        description: Name of the bridge
        tests: 
          - not_null: *recent_date_filter
      - name: DIRECTION
        description: Direction of the bridge - either inbound to Solana or outbound from Solana
        tests: 
          - not_null: *recent_date_filter
      - name: USER_ADDRESS
        description: The address receiving or sending bridged tokens
        tests: 
          - not_null: *recent_date_filter
      - name: AMOUNT
        description: "{{ doc('amount') }}"
        tests: 
          - not_null: *recent_date_filter
      - name: MINT
        description:  "{{ doc('mint') }}"
        tests: 
          - not_null: *recent_date_filter
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('tx_id') }}"
        tests: 
          - not_null
