From 7929f1c596989dcee538aa22c4c44cbf4a625a3b Mon Sep 17 00:00:00 2001 From: David JOULIN Date: Thu, 6 Mar 2025 23:02:31 +0100 Subject: [PATCH] Add cadastral parcel price model --- .../CadastralParcelPrice.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/namespaces/GeographicalReferences/CadastralParcelPrice.ts diff --git a/src/namespaces/GeographicalReferences/CadastralParcelPrice.ts b/src/namespaces/GeographicalReferences/CadastralParcelPrice.ts new file mode 100644 index 0000000..4afb9c9 --- /dev/null +++ b/src/namespaces/GeographicalReferences/CadastralParcelPrice.ts @@ -0,0 +1,28 @@ +import { Table } from "../../Database" +import type { Point } from "../../types/Geometry" + +export interface ParcelPrice { + id: string + building_nature: string + building_area?: number + cadastral_parcel_id: string + cadastral_parcel_area?: number + cadastral_price: number + mutation_id: string + mutation_date: Date + centroid: Point + postal_code: string + department: string +} + +export const ParcelPriceTable = Table({ + table: "registered_cadastral_prices", + primaryKey: "id", + oneToOne: { + cadastral_parcel_id: { + table: "registered_cadastral_parcels", + primaryKey: "id", + }, + }, + geometry: ["centroid"], +})