refactor: update app code for domain-scoped schema migration
Some checks failed
CI / lint-and-test (pull_request) Has been cancelled

- Update dbt model references to use new schema naming (stg_toronto, int_toronto, mart_toronto)
- Refactor figure factories to use consistent column naming from new schema
- Update callbacks to work with refactored data structures
- Add centralized design tokens module for consistent styling
- Streamline CLAUDE.md documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-02 17:00:30 -05:00
parent cda2a078d9
commit dfa5f92d8a
21 changed files with 618 additions and 407 deletions

View File

@@ -6,7 +6,7 @@ models:
columns:
- name: rental_id
description: "Unique rental record identifier"
tests:
data_tests:
- unique
- not_null
@@ -17,11 +17,11 @@ models:
columns:
- name: neighbourhood_id
description: "Neighbourhood identifier"
tests:
data_tests:
- not_null
- name: neighbourhood_name
description: "Official neighbourhood name"
tests:
data_tests:
- not_null
- name: geometry
description: "PostGIS geometry for mapping"
@@ -41,11 +41,11 @@ models:
columns:
- name: neighbourhood_id
description: "Neighbourhood identifier"
tests:
data_tests:
- not_null
- name: neighbourhood_name
description: "Official neighbourhood name"
tests:
data_tests:
- not_null
- name: geometry
description: "PostGIS geometry for mapping"
@@ -63,11 +63,11 @@ models:
columns:
- name: neighbourhood_id
description: "Neighbourhood identifier"
tests:
data_tests:
- not_null
- name: neighbourhood_name
description: "Official neighbourhood name"
tests:
data_tests:
- not_null
- name: geometry
description: "PostGIS geometry for mapping"
@@ -77,7 +77,7 @@ models:
description: "100 = city average crime rate"
- name: safety_tier
description: "Safety tier (1=safest, 5=highest crime)"
tests:
data_tests:
- accepted_values:
arguments:
values: [1, 2, 3, 4, 5]
@@ -89,11 +89,11 @@ models:
columns:
- name: neighbourhood_id
description: "Neighbourhood identifier"
tests:
data_tests:
- not_null
- name: neighbourhood_name
description: "Official neighbourhood name"
tests:
data_tests:
- not_null
- name: geometry
description: "PostGIS geometry for mapping"
@@ -103,7 +103,7 @@ models:
description: "100 = city average income"
- name: income_quintile
description: "Income quintile (1-5)"
tests:
data_tests:
- accepted_values:
arguments:
values: [1, 2, 3, 4, 5]
@@ -115,11 +115,11 @@ models:
columns:
- name: neighbourhood_id
description: "Neighbourhood identifier"
tests:
data_tests:
- not_null
- name: neighbourhood_name
description: "Official neighbourhood name"
tests:
data_tests:
- not_null
- name: geometry
description: "PostGIS geometry for mapping"
@@ -129,7 +129,7 @@ models:
description: "100 = city average amenities"
- name: amenity_tier
description: "Amenity tier (1=best, 5=lowest)"
tests:
data_tests:
- accepted_values:
arguments:
values: [1, 2, 3, 4, 5]

View File

@@ -128,7 +128,8 @@ final as (
-- Component scores (0-100)
round(safety_score::numeric, 1) as safety_score,
round(affordability_score::numeric, 1) as affordability_score,
-- Amenity score not available at this level, use placeholder
-- TODO: Replace with actual amenity score when fact_amenities is populated
-- Currently uses neutral placeholder (50.0) which affects livability_score accuracy
50.0 as amenity_score,
-- Composite livability score: safety (40%), affordability (40%), amenities (20%)