[# Standard Hub Template #]
[# Generates a standard hub model using datavault4dbt.hub() macro #]
{{ config(
    materialized='incremental',
    tags=['hub', 'raw_vault'[% if group %], '[[ group ]]'[% endif %]]
) }}

{%- set yaml_metadata -%}
source_models:
[% for source in source_tables %]
    - name: [[ source.stage_name ]]
[% if source.business_key_columns %]
      bk_columns:
[% for bk in source.business_key_columns %]
          - [[ bk ]]
[% endfor %]
[% endif %]
[% endfor %]
hashkey: [[ hashkey.hashkey_name ]]
business_keys:
[% for bk in business_key_columns %]
    - [[ bk ]]
[% endfor %]
{%- endset -%}

{{ datavault4dbt.hub(yaml_metadata=yaml_metadata) }}