From ced652705df7495b2c71f390ef11e9ff0dc5fd9a Mon Sep 17 00:00:00 2001 From: Juho Kettunen Date: Mon, 28 Oct 2024 16:04:37 +0200 Subject: [PATCH] Add types for LeaseArea and LeaseAreaAddress --- src/leases/types.ts | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/leases/types.ts b/src/leases/types.ts index ccf6e339..3138e2a0 100644 --- a/src/leases/types.ts +++ b/src/leases/types.ts @@ -24,6 +24,47 @@ export type LeaseState = { export type Lease = Record; export type LeaseList = ApiResponse; export type LeaseId = number; +// Lease area object as expected from API response +export type LeaseArea = { + id: number; + identifier: string; + area: number; + section_area: number | null; + geometry: Record | null; + addresses: Array; + type: string; + location: string; + plots: Array>; // TODO type for Plot + plan_units: Array>; // TODO type for PlanUnit + preconstruction_state: string | null; // TODO enum type for ConstructabilityState + preconstruction_estimated_construction_readiness_moment: string | null; + preconstruction_inspection_moment: string | null; + demolition_state: string | null; // ConstructabilityState + polluted_land_state: string | null; // ConstructabilityState + polluted_land_rent_condition_state: string | null; // TODO enum type for PollutedLandRentConditionState + polluted_land_rent_condition_date: string | null; + polluted_land_planner: Record | null; // TODO type for User as in backend + polluted_land_projectwise_number: string | null; + constructability_report_state: string | null; // ConstructabilityState + constructability_report_investigation_state: string | null; // TODO enum type for ConstructabilityReportInvestigationState + constructability_report_signing_date: string | null; + constructability_report_signer: string | null; + constructability_descriptions: Array>; // TODO type for ConstructabilityDescription + other_state: string | null; // ConstructabilityState + archived_decision: Record; // TODO type for Decision + archived_at: string | null; + archived_note: string | null; + attachments: Array>; // TODO type for LeaseAreaAttachment + custom_detailed_plan: Record; // TODO type for CustomDetailedPlan +}; +// Lease area address object as expected from API response +export type LeaseAreaAddress = { + id: number; + address: string; + postal_code: string | null; + city: string | null; + is_primary: boolean; +}; export type CreateChargePayload = { leaseId: LeaseId; data: Record;