@jaws-developers-customers/consulca-types 1.2.30 → 1.2.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/index.d.ts +14 -3
- package/index.js +5 -1
- package/index.mjs +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Il workflow genera una versione unica per ogni run su `master`, così la pubblic
|
|
|
24
24
|
|
|
25
25
|
## Cosa esporta
|
|
26
26
|
|
|
27
|
-
- tipi TypeScript per le entità principali (`User`, `
|
|
27
|
+
- tipi TypeScript per le entità principali (`User`, `Building`, `SingleBuilding`, `Apartment`, `Lease`, `Inspection`, `Claim`, `Work`, ...)
|
|
28
28
|
- cataloghi `ENUM` dello schema (`USER_ROLES`, `ACCESS_CHANNELS`, `ACCESS_ROLES`, `DEVICE_TYPES`, ...)
|
|
29
29
|
- helper:
|
|
30
30
|
- `formatDate`
|
|
@@ -96,4 +96,4 @@ console.log(formatDateTime(inspection.created_at, 'it-CH'));
|
|
|
96
96
|
|
|
97
97
|
`ACCESS_ROLES` descrive i ruoli di `access_channels` e `user_invites`, mentre `USER_ROLES` descrive quelli della tabella `user_roles`. Per verificare l'accesso usa `hasAccessChannel(user.access_channels, 'intranet_dashboard')`: i canali revocati vengono esclusi.
|
|
98
98
|
|
|
99
|
-
I riferimenti agli appartamenti usano `apartment_id`, `
|
|
99
|
+
I riferimenti agli appartamenti usano `apartment_id`, `Apartment` usa `apartment_number` e gli allegati delle ispezioni usano `inspection_item_id`. `SingleBuilding` include tutti i campi di `Building` e l'array `apartments`. Edifici e appartamenti hanno stato `active` o `archived`. `Property` rimane disponibile come alias retrocompatibile di `Apartment`. Sono disponibili anche `Device`, `UserInvite`, `Room`, `ApartmentRoom`, `ApartmentLessor` e `ApartmentManager`. I campi SQL nullable accettano `null`; i decimali accettano numeri o stringhe restituiti dal driver MariaDB.
|
package/index.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ export type AccessChannel = 'intranet_dashboard' | 'mobile_app' | 'website_admin
|
|
|
4
4
|
export type AccessRole = 'admin' | 'manager' | 'employee' | 'lessor' | 'inspector' | 'editor';
|
|
5
5
|
export type AccessStatus = 'active' | 'revoked';
|
|
6
6
|
export type DeviceType = 'web' | 'mobile';
|
|
7
|
-
export type
|
|
7
|
+
export type BuildingStatus = 'active' | 'archived';
|
|
8
|
+
export type ApartmentStatus = 'active' | 'archived';
|
|
9
|
+
export type PropertyStatus = ApartmentStatus;
|
|
8
10
|
export type ManagementRole = 'primary' | 'secondary' | 'accounting' | 'technical' | 'other';
|
|
9
11
|
export type LeaseStatus = 'planned' | 'active' | 'ended' | 'cancelled';
|
|
10
12
|
export type InspectionType = 'move_in' | 'move_out';
|
|
@@ -109,6 +111,7 @@ export interface Session {
|
|
|
109
111
|
export interface Building extends Addressable {
|
|
110
112
|
id: string;
|
|
111
113
|
name: string;
|
|
114
|
+
status: BuildingStatus;
|
|
112
115
|
address_line1: string;
|
|
113
116
|
postal_code: string;
|
|
114
117
|
city: string;
|
|
@@ -116,17 +119,23 @@ export interface Building extends Addressable {
|
|
|
116
119
|
updated_at: string | Date;
|
|
117
120
|
}
|
|
118
121
|
|
|
119
|
-
export interface
|
|
122
|
+
export interface Apartment {
|
|
120
123
|
id: string;
|
|
121
124
|
building_id: string;
|
|
122
125
|
apartment_number: string;
|
|
123
126
|
floor?: string | null;
|
|
124
127
|
area_m2?: number | string | null;
|
|
125
|
-
status:
|
|
128
|
+
status: ApartmentStatus;
|
|
126
129
|
created_at: string | Date;
|
|
127
130
|
updated_at: string | Date;
|
|
128
131
|
}
|
|
129
132
|
|
|
133
|
+
export type Property = Apartment;
|
|
134
|
+
|
|
135
|
+
export interface SingleBuilding extends Building {
|
|
136
|
+
apartments: Apartment[];
|
|
137
|
+
}
|
|
138
|
+
|
|
130
139
|
export interface PropertyLessor {
|
|
131
140
|
apartment_id: string;
|
|
132
141
|
user_id: string;
|
|
@@ -269,6 +278,8 @@ export declare const ACCESS_ROLES: readonly AccessRole[];
|
|
|
269
278
|
export declare const ACCESS_STATUSES: readonly AccessStatus[];
|
|
270
279
|
export declare const DEVICE_TYPES: readonly DeviceType[];
|
|
271
280
|
export declare const EmptyUser: User;
|
|
281
|
+
export declare const BUILDING_STATUSES: readonly BuildingStatus[];
|
|
282
|
+
export declare const APARTMENT_STATUSES: readonly ApartmentStatus[];
|
|
272
283
|
export declare const PROPERTY_STATUSES: readonly PropertyStatus[];
|
|
273
284
|
export declare const MANAGEMENT_ROLES: readonly ManagementRole[];
|
|
274
285
|
export declare const LEASE_STATUSES: readonly LeaseStatus[];
|
package/index.js
CHANGED
|
@@ -6,7 +6,9 @@ const ACCESS_CHANNELS = Object.freeze(['intranet_dashboard', 'mobile_app', 'webs
|
|
|
6
6
|
const ACCESS_ROLES = Object.freeze(['admin', 'manager', 'employee', 'lessor', 'inspector', 'editor']);
|
|
7
7
|
const ACCESS_STATUSES = Object.freeze(['active', 'revoked']);
|
|
8
8
|
const DEVICE_TYPES = Object.freeze(['web', 'mobile']);
|
|
9
|
-
const
|
|
9
|
+
const BUILDING_STATUSES = Object.freeze(['active', 'archived']);
|
|
10
|
+
const APARTMENT_STATUSES = Object.freeze(['active', 'archived']);
|
|
11
|
+
const PROPERTY_STATUSES = APARTMENT_STATUSES;
|
|
10
12
|
const MANAGEMENT_ROLES = Object.freeze(['primary', 'secondary', 'accounting', 'technical', 'other']);
|
|
11
13
|
const LEASE_STATUSES = Object.freeze(['planned', 'active', 'ended', 'cancelled']);
|
|
12
14
|
const INSPECTION_TYPES = Object.freeze(['move_in', 'move_out']);
|
|
@@ -129,6 +131,8 @@ module.exports = {
|
|
|
129
131
|
ACCESS_CHANNELS,
|
|
130
132
|
ACCESS_ROLES,
|
|
131
133
|
ACCESS_STATUSES,
|
|
134
|
+
APARTMENT_STATUSES,
|
|
135
|
+
BUILDING_STATUSES,
|
|
132
136
|
CLAIM_STATUSES,
|
|
133
137
|
COLOR_PALETTE,
|
|
134
138
|
CONDITION_STATUSES,
|
package/index.mjs
CHANGED