feat(dbt): apply smart contract schema inference and align gold shift-left quality tests

This commit is contained in:
2026-10-21 16:00:40 +07:00
parent 5de6e26181
commit 75f205137d
6 changed files with 91 additions and 60 deletions
@@ -1,4 +1,20 @@
-- dbt Bronze View Model: environmental_permits
{{ config(materialized='view') }}
SELECT * FROM {{ source('public', 'environmental_permits') }}
SELECT
permit_id,
permit_number,
applicant_name,
company_name,
business_type,
activity_type,
activity_type AS permit_type,
location,
status,
environmental_score,
issued_date,
expiry_date,
created_at,
updated_at
FROM {{ source('public', 'environmental_permits') }}
+2 -3
View File
@@ -4,10 +4,9 @@ models:
description: dbt Model gold_compliance_summary_mart auto-registered with Shift-Left
quality assertions
columns:
- name: ispu_val
- name: permit_type
tests:
- not_null
- name: stasiun_id
- name: status
tests:
- unique
- not_null
+12
View File
@@ -7,16 +7,28 @@ models:
contract:
enforced: true
columns:
- name: company_name
data_type: character varying(255)
- name: dbt_validated_at
data_type: timestamp with time zone
- name: issued_date
data_type: date
- name: permit_id
tests:
- unique
- not_null
data_type: character varying(50)
- name: permit_number
tests:
- unique
data_type: character varying(50)
- name: permit_type
data_type: character varying(50)
- name: status
tests:
- not_null
data_type: character varying(50)
- name: updated_at
tests:
- not_null
data_type: timestamp with time zone