version: 2
models:
  - name: gov__fact_proposal_creation
    description: "{{ doc('fact_proposal_creation') }}"  
    recent_date_filter: &recent_date_filter
      config:
        where: modified_timestamp >= current_date - 7
    columns:
      - name: GOVERNANCE_PLATFORM
        description: "{{ doc('governance_platform') }}"
        data_tests: 
          - not_null: *recent_date_filter 
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        data_tests: 
          - not_null: *recent_date_filter 
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
        data_tests: 
          - not_null: *recent_date_filter 
      - name: TX_ID
        description: "{{ doc('tx_id') }}"
        data_tests: 
          - not_null: *recent_date_filter 
          - dbt_expectations.expect_column_to_exist
      - name: SUCCEEDED
        description: "{{ doc('tx_succeeded') }}"
        data_tests: 
          - not_null: *recent_date_filter 
      - name: PROGRAM_NAME
        description: "{{ doc('program_id') }}"
        data_tests: 
          - not_null: *recent_date_filter 
      - name: REALMS_ID 
        description: "{{ doc('realms_id') }}" 
        data_tests: 
          - not_null: *recent_date_filter 
      - name: PROPOSAL
        description: "{{ doc('proposal') }}"
        data_tests: 
          - not_null: *recent_date_filter 
      - name: PROPOSAL_WRITER
        description: "{{ doc('proposal_writer') }}" 
        data_tests: 
          - not_null: *recent_date_filter 
      - name: PROPOSAL_NAME
        description: "{{ doc('proposal_name') }}"
        data_tests: 
          - not_null: *recent_date_filter 
      - name: VOTE_TYPE
        description: "{{ doc('vote_type') }}" 
        data_tests: 
          - not_null: *recent_date_filter 
      - name: VOTE_OPTIONS
        description: "{{ doc('vote_options') }}" 
        data_tests: 
          - not_null: *recent_date_filter 
      - name: FACT_PROPOSAL_CREATION_ID
        description: '{{ doc("pk") }}' 
        data_tests: 
          - unique: *recent_date_filter  
          - not_null: *recent_date_filter    
      - name: INSERTED_TIMESTAMP
        description: '{{ doc("inserted_timestamp") }}'   
        data_tests: 
          - not_null: *recent_date_filter 
      - name: MODIFIED_TIMESTAMP
        description: '{{ doc("modified_timestamp") }}' 
        data_tests: 
          - not_null