version: 2
models:
  - name: silver__stake_pool_actions_socean
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - _UNIQUE_KEY
      - compare_model_subset:
          name: silver__stake_pool_actions_socean_business_logic_test
          compare_model: ref('testing__stake_pool_actions_socean')
          compare_columns: 
            - tx_id
            - index
            - action
            - stake_pool
            - stake_pool_withdraw_authority
            - stake_pool_deposit_authority
            - address
            - reserve_stake_address
            - amount
          model_condition: "where tx_id in ('4pCtKHgugzwsXJ3HVRSyQroMkSVu9Uq5xXa92wm8qk3uzPBspJMyFSpS7K6zwUTGLrwtTufuppNKBMgbFGT1ntNC',
            '4RG4VM2c7zVVL1pNzyojNquEHm9eK5tFxC3BYdxjsbXv6R7YgMv34r2qo79t2nmTXg4fPTfat2MbYrNMUCAyxkP3',
            '2uSppNnHD25xVpawL8TgYACBsLAKXDTUBLWMwUupEjFMA4DScKrozcXJdurvJHh3AZwLoQzW3swov1bX5TtWKFTj',
            '4KdY9xd6dbEx5F5zEN5Vy5qAN4ZTgWP8zscSoWj9xjd5fxwTWHn4xbVfnT1Nm39a3bpcq1Wcv3g6TNB9HoyTquAN',
            '2BvmWkeogYu2rWiBmKE3zvXy73odpyQ4yC6LTcebhpDuZBXYryuCTTpURQ1Fqdgun1j3k7ueZwsxMXmYQGyBLtXt')"
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - not_null
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 7
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
        tests:
          - not_null
      - name: TX_ID
        description: "{{ doc('tx_id') }}"
        tests:
          - not_null
      - name: INDEX
        description: Location of the stake pool action within a transaction
        tests: 
          - not_null 
      - name: SUCCEEDED
        description: "{{ doc('tx_succeeded') }}"
        tests: 
          - not_null
      - name: ACTION
        description: "{{ doc('stake_pool_action') }}"
        tests: 
          - not_null 
      - name: STAKE_POOL
        description: "{{ doc('stake_pool') }}"
        tests: 
          - not_null
      - name: STAKE_POOL_WITHDRAW_AUTHORITY
        description: "{{ doc('stake_pool_withdraw_authority') }}"
        tests: 
          - not_null
      - name: STAKE_POOL_DEPOSIT_AUTHORITY
        description: "{{ doc('stake_pool_deposit_authority') }}"
      - name: ADDRESS
        description: "{{ doc('stake_pool_address') }}"
        tests: 
          - not_null
      - name: RESERVE_STAKE_ADDRESS
        description: "{{ doc('stake_pool_reserve_stake_address') }}"
        tests: 
          - not_null:
              where: action <> 'withdraw_stake'
      - name: AMOUNT
        description: "{{ doc('stake_pool_amount') }}"
        tests: 
          - not_null
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('_inserted_timestamp') }}"
        tests: 
          - not_null
      - name: _UNIQUE_KEY
        description: "Concatenation of columns to be used on merge for incremental loads"