feat: expand dbt models

This commit is contained in:
Stijnvandenbroek
2026-03-04 18:18:36 +00:00
parent 3e51d630e6
commit 65134183ca
9 changed files with 253 additions and 33 deletions

View File

@@ -0,0 +1,69 @@
-- Mart: analysis-ready Funda listings table.
-- Selects the most useful fields and adds derived metrics.
with enriched as (
select * from {{ ref('int_funda_listings_enriched') }}
),
final as (
select
-- identifiers
global_id,
tiny_id,
url,
-- location
title,
city,
postcode,
province,
neighbourhood,
municipality,
latitude,
longitude,
-- property characteristics
object_type,
house_type,
offering_type,
construction_type,
construction_year,
energy_label,
living_area,
plot_area,
bedrooms,
rooms,
has_garden,
has_balcony,
has_solar_panels,
has_heat_pump,
has_roof_terrace,
is_energy_efficient,
is_monument,
-- pricing
price as current_price,
latest_asking_price,
latest_asking_date,
sold_price,
sold_date,
is_sold,
-- derived
photo_count,
-- engagement
views,
saves,
status,
-- meta
publication_date,
ingested_at,
case
when living_area > 0 then round(price::numeric / living_area, 0)
end as price_per_sqm
from enriched
)
select * from final