version: 2
models:
  - name: silver__proposal_votes_realms
    description: An EZ view of all vote transactions on Realms DAO governance spaces. A space serves as a voting group for an organization, dAPP, or DAO.  
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - TX_ID
            - INDEX
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - not_null
          - 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: INDEX
        description: "{{ doc('index') }}"
        tests: 
          - not_null
      - name: PROGRAM_ID
        description: "{{ doc('program_id') }}"
        tests: 
          - not_null
      - name: REALMS_ID 
        description: An address that is unique to the space or voting group on Realms. 
        tests: 
          - not_null
      - name: PROPOSAL
        description: Address representing the proposal being voted on
        tests: 
          - not_null
      - name: VOTER
        description: Address voting on the proposal
        tests: 
          - not_null
      - name: VOTE_ACCOUNT 
        description: An account belonging to the voting wallet that is opened on a vote. Used to transfer the voting tx fee. 
        tests: 
          - not_null
      - name: VOTE_CHOICE
        description: How the user voted on the proposal
        tests: 
          - not_null
      - name: VOTE_RANK
        description: The order of a user's preferred choices when more than one vote option is available
        tests: 
          - not_null
      - name: VOTE_WEIGHT
        description: The percent of voting power committed to the vote
        tests: 
          - not_null
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('_inserted_timestamp') }}"
        tests: 
          - not_null