version: 2
models:
  - name: silver__stake_pool_actions_lido
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - _UNIQUE_KEY
      - compare_model_subset:
          name: silver__stake_pool_actions_lido_business_logic_test
          compare_model: ref('testing__stake_pool_actions_lido')
          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 ('5NzsaC4sXduB4Q9JwWNuUfxmKyUmQQsrLJTxtuiXGkD1Eb9evZE5BhafXv5vuRxSnEPj2ZtyPftapnZf4cevh4WX',
            '2n9aKrgL7GT22DTUpzfoYSSELDuwdxVLgjX17dubTL6tWbtkjXNUfYc1rnT9Hy4Ga7spoKYnWgzTU72D7GvRBCxG',
            '35bZ29SXpyLpG45AyXXufxa1uFStQGV5pmk3tfi1bSMbmQksaPJpNF55bzFHhj9odAeBsdgZHLQvkmwdGrJsR4Qk',
            '3L3PwGmkXa3fJj71ps7uPhWzNQA3Fs4k769cMQHD54usuR8rjfJFZTPAE1bmbg3N3FpgRaksoSfTehvYx3md3VPE',
            '22WgmSkrMYkjhyatxhK3Riv6Jdnjmf29aJWdbYmJ1aJpSi619PoAYrFBknCRZ3xVwFX6oR9wZrcPaHSh6gzBMzwg')"
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - not_null
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 30
      - 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:
              where: action = 'withdraw'
      - 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'
      - 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"