version: 2
models:
  - name: silver__bridge_debridge_transfers
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - BRIDGE_DEBRIDGE_TRANSFERS_ID
      - compare_model_subset:
          name: silver__bridge_debridge_transfers_logic_test
          compare_model: ref('testing__bridge_debridge_transfers')
          compare_columns: 
            - tx_id
            - program_id
            - direction
            - user_address
            - round(amount,8)
            - mint
          model_condition: "where tx_id in ('5QQhyhN51i34hwwA5GExb8QZ2QXvWyLJEyoh6F7CPReKbh2DPxEeek69z2rZqddkt844sBFfw7Jy7Uy8YoKM9qVs',
          '3ySH2GiuWxpXm4nH25Cc1n9MT3Zahdku2wzyve3E1hFeA83VV3AN7hWoWBp39Mtfyr6tHhwiSNeqMEkNn9a6aBEF',
          '4EP7wWKhma2dsi4mconqsWPCBM9ow4JaVRydxLEcrLwriaFEEgHu9uuJccqSb1o9pdF6wVdZq1tqvTjD9me4ciVc',
          '4sy3zM6EjNuZ65gFqfKUChRtVCQiHxedUhq8SSNEXJbckxHKExdig3zaJwSFNGTp9uYxLUHBWtr6maaGR1LAruMQ',
          '4oUbo4UMmdpFsAd6mNtuN17ho43oLU5UYYR1mzKFmG5PRuKQMQnenEPkpS6S4RPWewqD2kBfB5wN92WEmMVV2bba',
          '5g7jXMkPijbr2KxT9oGVm6MjjQ2xNP6EdYFuBJPuMj1x3jFC1AJ8VeMN9Wa9kho4D6ES7dcU8raVtynvLeSqm5dE',
          '1vZ9reeJ4JVYkxcmTEBjEeDn4nSb8FsWQqKBKCeQw7fh1EuM3UGrBUD7tBKPkX5Q3jGm1bCRG31gJePMW2Mjwfc')"
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - 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: PLATFORM
        description: Name of the bridge
        tests: 
          - not_null
      - name: DIRECTION
        description: Direction of the bridge - either inbound to Solana or outbound from Solana
        tests: 
          - not_null
      - name: USER_ADDRESS
        description: The address receiving or sending bridged tokens
        tests: 
          - not_null 
      - name: AMOUNT
        description: "{{ doc('amount') }}"
        tests: 
          - not_null 
      - name: MINT
        description:  "{{ doc('mint') }}"
        tests: 
          - not_null:
              where: succeeded
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('tx_id') }}"
        tests: 
          - not_null
