feat: add catastro SSOT integration, 3DGS hybrid pipeline, casa demo v3
- SPEC: add User Story 0 (Property Setup via Catastro) as P1 entry - SPEC: add catastro_data and catastro_imports tables to data model - PLAN: add Phase 2A (Catastro Integration) with 8 tasks - AGENTS.md: add 3 key decisions (Catastro SSOT, 3DGS hybrid, plan inputs) - Demo v3: Spanish apartment (C/ Altabix 24, 3ºB, Elche), 7 rooms, upload panel for catastro/DXF, proper collisions on all doors
This commit is contained in:
@@ -148,6 +148,31 @@ export const processingJobs = pgTable('processing_jobs', {
|
||||
createdAt: timestamp('created_at').defaultNow().notNull(),
|
||||
});
|
||||
|
||||
// ── Catastro Data ─────────────────────────────────────
|
||||
|
||||
export const catastroData = pgTable('catastro_data', {
|
||||
id: cuid2('id').primaryKey(),
|
||||
projectId: cuid2('project_id').references(() => projects.id).notNull(),
|
||||
refcat: text('refcat'), // 14-20 digit cadastral reference
|
||||
addressNormalized: text('address_normalized'), // Normalized address from Catastro
|
||||
buildingFootprint: jsonb('building_footprint'), // GeoJSON polygon from INSPIRE WFS
|
||||
buildingHeight: text('building_height'), // e.g., "12.5" meters
|
||||
numberOfFloors: integer('number_of_floors'), // From Catastro
|
||||
floorArea: text('floor_area'), // m² from Catastro
|
||||
gmlSource: text('gml_source'), // URL of the GML source file
|
||||
fetchedAt: timestamp('fetched_at').defaultNow().notNull(),
|
||||
});
|
||||
|
||||
export const catastroImports = pgTable('catastro_imports', {
|
||||
id: cuid2('id').primaryKey(),
|
||||
projectId: cuid2('project_id').references(() => projects.id).notNull(),
|
||||
format: text('format').notNull(), // 'dxf', 'svg', 'png', 'gml'
|
||||
originalKey: text('original_key'), // S3 key for uploaded file
|
||||
parsedWalls: jsonb('parsed_walls'), // Array of {x1, z1, x2, z2, height, thickness}
|
||||
source: text('source').notNull(), // 'catastro', 'upload', 'manual'
|
||||
createdAt: timestamp('created_at').defaultNow().notNull(),
|
||||
});
|
||||
|
||||
// ── Subscriptions ───────────────────────────────────
|
||||
|
||||
export const subscriptions = pgTable('subscriptions', {
|
||||
|
||||
Reference in New Issue
Block a user