@7365admin1/layer-common 4.72.0 → 4.73.1-staging.452
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/CHANGELOG.md +10 -4
- package/assets/css/primitives.css +43 -0
- package/components/AccessCardPreviewDialog.vue +286 -50
- package/components/AppSelect.vue +77 -3
- package/components/BuildingUnitFormEdit.vue +6 -0
- package/components/BuildingUnitManagement.vue +298 -0
- package/components/Dialog/UpdateMoreAction.vue +11 -1
- package/components/DocumentForm.vue +407 -112
- package/components/DocumentManagement.vue +213 -12
- package/components/Facility/BookingSetup.vue +63 -0
- package/components/HidAccessLogDashboard.vue +74 -17
- package/components/HidAccessPermissions.vue +424 -0
- package/components/HidIntercomManagement.vue +183 -14
- package/components/HidProfileQrCode.vue +332 -0
- package/components/HidQrCodeConfiguration.vue +17 -195
- package/components/HidReaderManagement.vue +398 -0
- package/components/HidReaderUserRoster.vue +44 -3
- package/components/HidUserEnrollment.vue +845 -155
- package/components/InventoryHistoryDialog.vue +205 -0
- package/components/InventoryMain.vue +23 -2
- package/components/InventoryMyStockTab.vue +63 -8
- package/components/InventoryPhotoThumbs.vue +67 -0
- package/components/InventoryReportsTab.vue +154 -28
- package/components/InventoryUsageDialog.vue +119 -28
- package/components/InvitationClientForm.vue +19 -1
- package/components/VisitorForm.vue +12 -0
- package/components/VisitorManagement.vue +267 -5
- package/composables/useDocument.ts +7 -0
- package/composables/useFacility.ts +11 -0
- package/composables/useHidAmico.ts +165 -0
- package/composables/useHidNavigation.ts +25 -1
- package/composables/useHidReaderSelection.ts +50 -0
- package/composables/useInventory.ts +11 -3
- package/composables/useMember.ts +12 -0
- package/composables/usePeople.ts +19 -0
- package/composables/useSecurityPermission.ts +20 -0
- package/composables/useServiceProvider.ts +33 -2
- package/composables/useSiteCategory.ts +45 -0
- package/package.json +1 -1
- package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +23 -0
- package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
- package/types/document.d.ts +14 -0
- package/types/facility.d.ts +4 -0
- package/types/inventory.d.ts +18 -2
- package/types/member.d.ts +4 -0
- package/types/people.d.ts +28 -1
- package/types/service-provider.d.ts +5 -0
- package/utils/hid-permission-assignments.ts +190 -0
- package/utils/hid-reader-selection.ts +52 -0
- package/utils/inventory-usage.ts +94 -0
- package/utils/occupancy-role.ts +109 -0
- package/utils/service-type.ts +30 -0
|
@@ -15,6 +15,7 @@ export default function useInventory() {
|
|
|
15
15
|
receive: "Received",
|
|
16
16
|
issue: "Issued",
|
|
17
17
|
use: "Used",
|
|
18
|
+
use_draft: "Draft",
|
|
18
19
|
return: "Returned",
|
|
19
20
|
adjust: "Stock count",
|
|
20
21
|
handover: "Hand-over",
|
|
@@ -44,6 +45,13 @@ export default function useInventory() {
|
|
|
44
45
|
issue: (store: string, body: Record<string, any>) => api(`/stores/${store}/issue`, { method: "POST", body }),
|
|
45
46
|
receiveReturn: (store: string, body: Record<string, any>) => api(`/stores/${store}/returns`, { method: "POST", body }),
|
|
46
47
|
recordUsage: (store: string, body: Record<string, any>) => api(`/stores/${store}/usage`, { method: "POST", body }),
|
|
48
|
+
/** Usage drafts: before photo now, after photo and submit after the job (stock is deducted on submit). */
|
|
49
|
+
getUsageDrafts: (store: string, everyone = false) =>
|
|
50
|
+
api<{ items: TInventoryUsageDraft[]; staleAfterDays: number }>(`/stores/${store}/usage-drafts`, { query: everyone ? { everyone: true } : {} }),
|
|
51
|
+
createUsageDraft: (store: string, body: Record<string, any>) => api<TInventoryUsageDraft>(`/stores/${store}/usage-drafts`, { method: "POST", body }),
|
|
52
|
+
updateUsageDraft: (id: string, body: Record<string, any>) => api<TInventoryUsageDraft>(`/usage-drafts/${id}`, { method: "PATCH", body }),
|
|
53
|
+
discardUsageDraft: (id: string) => api(`/usage-drafts/${id}/discard`, { method: "POST" }),
|
|
54
|
+
submitUsageDraft: (id: string, body: { photosAfter?: string[]; date?: string }) => api<TInventoryTransaction>(`/usage-drafts/${id}/submit`, { method: "POST", body }),
|
|
47
55
|
|
|
48
56
|
getRequests: (store: string, query: { page?: number; limit?: number; status?: string; mine?: boolean }) =>
|
|
49
57
|
api<{ items: TInventoryRequest[]; total: number; pendingCount: number; page: number; pages: number }>(`/stores/${store}/requests`, { query }),
|
|
@@ -74,9 +82,9 @@ export default function useInventory() {
|
|
|
74
82
|
getPeople: (store: string, search = "") =>
|
|
75
83
|
api<{ _id: string; name: string; orgName: string; email?: string; company?: string; service?: string; serviceLabel?: string; label?: string }[]>(`/stores/${store}/people`, { query: { search } }),
|
|
76
84
|
|
|
77
|
-
getReport: (store: string, report: "movement" | "usage" | "technicians" | "purchases" | "handovers", query: TInventoryPeriod &
|
|
78
|
-
api<{ rows: any[]; totalQty?: number; totalCost?: number }>(`/stores/${store}/reports/${report}`, { query }),
|
|
79
|
-
exportReport: (store: string, report: string, query: TInventoryPeriod &
|
|
85
|
+
getReport: (store: string, report: "movement" | "usage" | "technicians" | "purchases" | "handovers", query: TInventoryPeriod & Record<string, any>) =>
|
|
86
|
+
api<{ rows: any[]; totalQty?: number; totalCost?: number; scope?: "all" | "own_company"; staleAfterDays?: number }>(`/stores/${store}/reports/${report}`, { query }),
|
|
87
|
+
exportReport: (store: string, report: string, query: TInventoryPeriod & Record<string, any>) =>
|
|
80
88
|
api<Blob>(`/stores/${store}/reports/${report}/export`, { query, responseType: "blob" }),
|
|
81
89
|
checkUsage: (store: string, ids: string[], checked: boolean) =>
|
|
82
90
|
api<{ updated: number }>(`/stores/${store}/usage/check`, { method: "POST", body: { ids, checked } }),
|
package/composables/useMember.ts
CHANGED
|
@@ -70,6 +70,8 @@ export default function useMember() {
|
|
|
70
70
|
status = "active",
|
|
71
71
|
siteId = "",
|
|
72
72
|
roleState = "",
|
|
73
|
+
/** A building unit id, or "none": members on no unit yet. */
|
|
74
|
+
unit = "",
|
|
73
75
|
} = {}) {
|
|
74
76
|
const query: Record<string, any> = { page, limit, type, status };
|
|
75
77
|
|
|
@@ -79,6 +81,7 @@ export default function useMember() {
|
|
|
79
81
|
if (user) query.user = user;
|
|
80
82
|
if (org) query.org = org;
|
|
81
83
|
if (siteId) query.siteId = siteId;
|
|
84
|
+
if (unit) query.unit = unit;
|
|
82
85
|
return useNuxtApp().$api<Record<string, any>>("/api/members", {
|
|
83
86
|
method: "GET",
|
|
84
87
|
query,
|
|
@@ -154,6 +157,14 @@ export default function useMember() {
|
|
|
154
157
|
});
|
|
155
158
|
}
|
|
156
159
|
|
|
160
|
+
/** Attach a member to a building unit, or detach them (`unit` ""). */
|
|
161
|
+
function updateMemberUnit(id: string, unit: string) {
|
|
162
|
+
return useNuxtApp().$api<Record<string, any>>("/api/members/unit", {
|
|
163
|
+
method: "PUT",
|
|
164
|
+
body: { id, unit },
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
157
168
|
function getByUserTypeOrg(user: string, type: string, org: string) {
|
|
158
169
|
return useNuxtApp().$api<TMember>(
|
|
159
170
|
`/api/members/user/${user}/app/${type}/org`,
|
|
@@ -197,6 +208,7 @@ export default function useMember() {
|
|
|
197
208
|
return {
|
|
198
209
|
getSiteAccess,
|
|
199
210
|
saveSiteAccess,
|
|
211
|
+
updateMemberUnit,
|
|
200
212
|
members,
|
|
201
213
|
member,
|
|
202
214
|
page,
|
package/composables/usePeople.ts
CHANGED
|
@@ -115,6 +115,24 @@ export default function () {
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
/**
|
|
119
|
+
* The blocks, levels and units at a site that actually have an occupant.
|
|
120
|
+
* The other half of the unit picker: this narrows the cascade, then
|
|
121
|
+
* `getPeopleByUnit` answers "which person in this unit?".
|
|
122
|
+
*/
|
|
123
|
+
async function getOccupiedStructure(
|
|
124
|
+
site: string,
|
|
125
|
+
{ type = "", status = "active", block = "", level = "" } = {}
|
|
126
|
+
) {
|
|
127
|
+
return await useNuxtApp().$api<Record<string, any>>(
|
|
128
|
+
`/api/people/site/${site}/occupied-structure`,
|
|
129
|
+
{
|
|
130
|
+
method: "GET",
|
|
131
|
+
query: { type, status, block, level },
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
118
136
|
async function getPeopleByUnit(
|
|
119
137
|
_id: string,
|
|
120
138
|
{ status = "active", type = "" } = {}
|
|
@@ -148,6 +166,7 @@ export default function () {
|
|
|
148
166
|
findPersonByPlateNumberMultipleResult,
|
|
149
167
|
findPersonByContact,
|
|
150
168
|
getPeopleByUnit,
|
|
169
|
+
getOccupiedStructure,
|
|
151
170
|
searchCompanyList,
|
|
152
171
|
findUsersByPlateNumber,
|
|
153
172
|
reviewResidentPerson,
|
|
@@ -714,6 +714,21 @@ export default function useSecurityPermission() {
|
|
|
714
714
|
description:
|
|
715
715
|
"Allows the user to start NFC patrolling on a specific route.",
|
|
716
716
|
},
|
|
717
|
+
// Copied from Property. The security web app's NFC Patrol > Routes page
|
|
718
|
+
// gates Add, Edit and Delete on these, and API-core's `nfcPatrol` gate
|
|
719
|
+
// asks for the same strings on route create and update.
|
|
720
|
+
"add-nfc-patrol": {
|
|
721
|
+
check: true,
|
|
722
|
+
description: "Allows the user to add routes.",
|
|
723
|
+
},
|
|
724
|
+
"update-nfc-patrol": {
|
|
725
|
+
check: true,
|
|
726
|
+
description: "Allows the user to edit routes.",
|
|
727
|
+
},
|
|
728
|
+
"delete-nfc-patrol": {
|
|
729
|
+
check: true,
|
|
730
|
+
description: "Allows the user to delete routes.",
|
|
731
|
+
},
|
|
717
732
|
},
|
|
718
733
|
// NEW. Seeing the CCTV wall, as distinct from setting cameras up
|
|
719
734
|
// (`site-settings:manage-cctv-camera`).
|
|
@@ -743,6 +758,11 @@ export default function useSecurityPermission() {
|
|
|
743
758
|
siteSettingsPermissions["manage-resident-visitors"],
|
|
744
759
|
"manage-work-order-settings":
|
|
745
760
|
siteSettingsPermissions["manage-work-order-settings"],
|
|
761
|
+
// The security web app's Site Settings shows the NFC Management and NFC
|
|
762
|
+
// Patrol Settings panels on these, as Property's does.
|
|
763
|
+
"manage-nfc-management": siteSettingsPermissions["manage-nfc-management"],
|
|
764
|
+
"manage-nfc-patrol-settings":
|
|
765
|
+
siteSettingsPermissions["manage-nfc-patrol-settings"],
|
|
746
766
|
"manage-red-dot-settings": {
|
|
747
767
|
check: true,
|
|
748
768
|
description:
|
|
@@ -15,6 +15,9 @@ export type TSiteProviderMember = {
|
|
|
15
15
|
lastLoginAt?: string | null;
|
|
16
16
|
/** a subcontractor: the provider that brought its company onto the site */
|
|
17
17
|
invitedVia?: string;
|
|
18
|
+
/** The building unit this person is attached to (a unit's Management tab). */
|
|
19
|
+
unit?: string | null;
|
|
20
|
+
unitName?: string;
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export type TSiteProviderCompany = {
|
|
@@ -90,6 +93,8 @@ export default function useServiceProvider() {
|
|
|
90
93
|
status = "",
|
|
91
94
|
/** "engagements": also providers engaged through an accepted invitation. */
|
|
92
95
|
include = "",
|
|
96
|
+
/** A building unit id, or "none": providers on no unit yet. */
|
|
97
|
+
unit = "",
|
|
93
98
|
} = {}) {
|
|
94
99
|
return useNuxtApp().$api<Record<string, any>>("/api/service-providers", {
|
|
95
100
|
method: "GET",
|
|
@@ -102,6 +107,7 @@ export default function useServiceProvider() {
|
|
|
102
107
|
siteId,
|
|
103
108
|
...(status ? { status } : {}),
|
|
104
109
|
...(include ? { include } : {}),
|
|
110
|
+
...(unit ? { unit } : {}),
|
|
105
111
|
},
|
|
106
112
|
});
|
|
107
113
|
}
|
|
@@ -269,6 +275,17 @@ export default function useServiceProvider() {
|
|
|
269
275
|
);
|
|
270
276
|
}
|
|
271
277
|
|
|
278
|
+
/** Attach a provider to a building unit, or detach it (`unit` ""). */
|
|
279
|
+
async function updateUnit(id: string, unit: string) {
|
|
280
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
281
|
+
`/api/service-providers/${id}/unit`,
|
|
282
|
+
{
|
|
283
|
+
method: "PATCH",
|
|
284
|
+
body: { unit },
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
272
289
|
async function getByEmail({
|
|
273
290
|
email = "",
|
|
274
291
|
orgId = "",
|
|
@@ -293,17 +310,29 @@ export default function useServiceProvider() {
|
|
|
293
310
|
* Members > Service Providers: the provider people with access to this
|
|
294
311
|
* site, and one entry per provider company with its head count. The
|
|
295
312
|
* site's own organisation only - the server refuses anyone else.
|
|
313
|
+
* `unit`: a building unit id, or "none" (people on no unit yet).
|
|
296
314
|
*/
|
|
297
|
-
function getSiteMembers(siteId: string): Promise<{
|
|
315
|
+
function getSiteMembers(siteId: string, unit = ""): Promise<{
|
|
298
316
|
items: TSiteProviderMember[];
|
|
299
317
|
companies: TSiteProviderCompany[];
|
|
300
318
|
}> {
|
|
301
319
|
return useNuxtApp().$api("/api/service-providers/site-members", {
|
|
302
320
|
method: "GET",
|
|
303
|
-
query: { siteId },
|
|
321
|
+
query: { siteId, ...(unit ? { unit } : {}) },
|
|
304
322
|
});
|
|
305
323
|
}
|
|
306
324
|
|
|
325
|
+
/** Attach one of those people to a building unit, or detach them (`unit` ""). */
|
|
326
|
+
function updateSiteMemberUnit(id: string, unit: string) {
|
|
327
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
328
|
+
`/api/service-providers/site-members/${id}/unit`,
|
|
329
|
+
{
|
|
330
|
+
method: "PATCH",
|
|
331
|
+
body: { unit },
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
|
|
307
336
|
/** The same list as an Excel file, under the same filters. */
|
|
308
337
|
function exportSiteMembers(
|
|
309
338
|
siteId: string,
|
|
@@ -320,6 +349,7 @@ export default function useServiceProvider() {
|
|
|
320
349
|
|
|
321
350
|
return {
|
|
322
351
|
getSiteMembers,
|
|
352
|
+
updateSiteMemberUnit,
|
|
323
353
|
exportSiteMembers,
|
|
324
354
|
serviceProviders,
|
|
325
355
|
serviceProvider,
|
|
@@ -338,6 +368,7 @@ export default function useServiceProvider() {
|
|
|
338
368
|
add,
|
|
339
369
|
addViaInvite,
|
|
340
370
|
updateStatus,
|
|
371
|
+
updateUnit,
|
|
341
372
|
getByEmail,
|
|
342
373
|
};
|
|
343
374
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE CATEGORY OF THE SITE THE USER IS CURRENTLY IN.
|
|
3
|
+
*
|
|
4
|
+
* One shared answer, published once by the application's layout from the site
|
|
5
|
+
* it already loaded for the switcher, and read by anything that has to behave
|
|
6
|
+
* differently on a commercial or industrial site - the business Add Tenant
|
|
7
|
+
* form, the tenant list. Publishing it rather than re-fetching it per
|
|
8
|
+
* component means no two screens can disagree about which site this is.
|
|
9
|
+
*
|
|
10
|
+
* READ FROM THE CUSTOMER-SITE RECORD, NOT THE SITE RECORD. Both carry a
|
|
11
|
+
* `category` and `customer-site.service` keeps them equal (it writes the site
|
|
12
|
+
* on create and on update), but `siteSchema` DEFAULTS the site's own copy to
|
|
13
|
+
* `commercial` - so a site created without an explicit category reads back as
|
|
14
|
+
* commercial there even when it is a residential estate. The customer-site
|
|
15
|
+
* copy has no default: it is either the category somebody chose or nothing.
|
|
16
|
+
*
|
|
17
|
+
* An empty category means "not published yet" or "never set", and every
|
|
18
|
+
* caller must behave as it did before this existed - never assume commercial
|
|
19
|
+
* from silence.
|
|
20
|
+
*/
|
|
21
|
+
const BUSINESS_SITE_CATEGORIES: string[] = ["commercial", "industrial"];
|
|
22
|
+
|
|
23
|
+
export default function useSiteCategory() {
|
|
24
|
+
const siteCategory = useState<string>("current-site-category", () => "");
|
|
25
|
+
|
|
26
|
+
function setSiteCategory(value?: string | null) {
|
|
27
|
+
siteCategory.value = typeof value === "string" ? value : "";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The categories whose units are LET TO A BUSINESS rather than lived in.
|
|
32
|
+
*
|
|
33
|
+
* These are the sites where a unit has an owner, an occupier and often a
|
|
34
|
+
* person in charge who is neither, so they are the sites that ask for a
|
|
35
|
+
* tenant's standing and print it back (see `OCCUPANCY_ROLE_OPTIONS`).
|
|
36
|
+
*
|
|
37
|
+
* The category never changes what the APPLICATION is called: the rail says
|
|
38
|
+
* Property Management on every site it serves.
|
|
39
|
+
*/
|
|
40
|
+
const isBusinessSite = computed(() =>
|
|
41
|
+
BUSINESS_SITE_CATEGORIES.includes(siteCategory.value),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
return { siteCategory, isBusinessSite, setSiteCategory };
|
|
45
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.73.1-staging.452",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:org="orgId"
|
|
6
6
|
message="Enable HID as a service for this site before managing physical HID cards."
|
|
7
7
|
>
|
|
8
|
-
<HidUserEnrollment :site="siteId" card-management />
|
|
8
|
+
<HidUserEnrollment :site="siteId" :org="orgId" card-management />
|
|
9
9
|
</HidEnabledGate>
|
|
10
10
|
</v-container>
|
|
11
11
|
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container fluid>
|
|
3
|
+
<HidEnabledGate
|
|
4
|
+
:site="siteId"
|
|
5
|
+
:org="orgId"
|
|
6
|
+
message="Enable HID as a service for this site before generating a QR code."
|
|
7
|
+
>
|
|
8
|
+
<HidProfileQrCode :site="siteId" />
|
|
9
|
+
</HidEnabledGate>
|
|
10
|
+
</v-container>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
definePageMeta({
|
|
15
|
+
layout: "default",
|
|
16
|
+
middleware: ["01-auth", "02-org"],
|
|
17
|
+
memberOnly: true,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const route = useRoute();
|
|
21
|
+
const siteId = computed(() => String(route.params.site ?? ""));
|
|
22
|
+
const orgId = computed(() => String(route.params.org ?? ""));
|
|
23
|
+
</script>
|
package/types/document.d.ts
CHANGED
|
@@ -3,4 +3,18 @@ declare type TDocument = {
|
|
|
3
3
|
name: string;
|
|
4
4
|
attachment: string;
|
|
5
5
|
type: string;
|
|
6
|
+
/**
|
|
7
|
+
* Set at upload or renewal, absent when the document never expires.
|
|
8
|
+
*
|
|
9
|
+
* An ISO instant on the way out of the API and a `YYYY-MM-DD` string on the
|
|
10
|
+
* way back in, which is what `InputDatePicker` binds to - hence the loose
|
|
11
|
+
* type rather than `string`.
|
|
12
|
+
*/
|
|
13
|
+
expiryDate?: string | Date | null;
|
|
14
|
+
remarks?: string;
|
|
15
|
+
size?: number;
|
|
16
|
+
parentId?: string | null;
|
|
17
|
+
createdAt?: string | Date;
|
|
18
|
+
updatedAt?: string | Date;
|
|
19
|
+
status?: string;
|
|
6
20
|
};
|
package/types/facility.d.ts
CHANGED
|
@@ -73,6 +73,10 @@ declare type TFacility = {
|
|
|
73
73
|
hourInterval?: number;
|
|
74
74
|
isBookingFeeEnabled: boolean;
|
|
75
75
|
isGuestEnabled: boolean;
|
|
76
|
+
/** Residents may complete this facility's checklist themselves. */
|
|
77
|
+
isResidentChecklistEnabled?: boolean;
|
|
78
|
+
/** Security may complete it. Mutually exclusive with the above. */
|
|
79
|
+
isSecurityChecklistEnabled?: boolean;
|
|
76
80
|
bookingAmount: number | null;
|
|
77
81
|
peakBookingFeeAmount?: number | null;
|
|
78
82
|
bookingFeeGuestAmount?: number | null;
|
package/types/inventory.d.ts
CHANGED
|
@@ -82,6 +82,11 @@ declare type TInventoryHolding = {
|
|
|
82
82
|
packing?: string;
|
|
83
83
|
/** Used by this holder since the start of the month (Singapore time). */
|
|
84
84
|
usedThisMonth?: number;
|
|
85
|
+
holderLabel?: string;
|
|
86
|
+
/** How many sit in the holder's own usage drafts (not deducted until submitted), and what is still free. */
|
|
87
|
+
inDrafts?: number;
|
|
88
|
+
draftCount?: number;
|
|
89
|
+
free?: number;
|
|
85
90
|
};
|
|
86
91
|
|
|
87
92
|
declare type TInventoryTransaction = {
|
|
@@ -89,7 +94,7 @@ declare type TInventoryTransaction = {
|
|
|
89
94
|
item: string;
|
|
90
95
|
itemName: string;
|
|
91
96
|
unit: string;
|
|
92
|
-
type: "opening" | "receive" | "issue" | "use" | "return" | "adjust" | "handover";
|
|
97
|
+
type: "opening" | "receive" | "issue" | "use" | "return" | "adjust" | "handover" | "use_draft";
|
|
93
98
|
qty: number;
|
|
94
99
|
storeChange: number;
|
|
95
100
|
storeBalance: number;
|
|
@@ -97,7 +102,7 @@ declare type TInventoryTransaction = {
|
|
|
97
102
|
holderChange?: number;
|
|
98
103
|
holderBalance?: number;
|
|
99
104
|
site?: string;
|
|
100
|
-
location?: { type: "common_area" | "tenant_unit"; area?: string; unitName?: string; tenantName?: string };
|
|
105
|
+
location?: { type: "common_area" | "tenant_unit"; area?: string; unit?: string; unitName?: string; tenantName?: string };
|
|
101
106
|
reference?: string;
|
|
102
107
|
supplier?: string;
|
|
103
108
|
unitCost: number;
|
|
@@ -109,8 +114,19 @@ declare type TInventoryTransaction = {
|
|
|
109
114
|
receivedBy?: string;
|
|
110
115
|
date: string;
|
|
111
116
|
createdByName: string;
|
|
117
|
+
holder?: string;
|
|
118
|
+
holderLabel?: string;
|
|
119
|
+
createdByLabel?: string;
|
|
120
|
+
/** Usage saved as a draft first. */
|
|
121
|
+
draftedAt?: string;
|
|
122
|
+
photosBeforeAt?: string | null;
|
|
123
|
+
photosAfterAt?: string | null;
|
|
124
|
+
submittedAt?: string;
|
|
112
125
|
};
|
|
113
126
|
|
|
127
|
+
/** A usage record saved with its before photo, waiting for the after photo (no stock deducted yet). */
|
|
128
|
+
declare type TInventoryUsageDraft = TInventoryTransaction & { type: "use_draft"; stale: boolean; mine: boolean; clientRef?: string };
|
|
129
|
+
|
|
114
130
|
declare type TInventoryPeriod = { from: string; to: string; site?: string; locationType?: string; usedBy?: string };
|
|
115
131
|
|
|
116
132
|
/** An organisation's supplier (shared by its stores). Only the name is required. */
|
package/types/member.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ declare type TMember = {
|
|
|
10
10
|
customerOrgId?: string;
|
|
11
11
|
customerSiteId?: string;
|
|
12
12
|
status?: string;
|
|
13
|
+
email?: string;
|
|
14
|
+
/** The building unit this member manages (a unit's Management tab). */
|
|
15
|
+
unit?: string | null;
|
|
16
|
+
unitName?: string;
|
|
13
17
|
createdAt?: string;
|
|
14
18
|
updatedAt?: string;
|
|
15
19
|
deletedAt?: string;
|
package/types/people.d.ts
CHANGED
|
@@ -22,11 +22,38 @@ declare type TPeople = {
|
|
|
22
22
|
email?: string;
|
|
23
23
|
files?: { name: string, id: string }[];
|
|
24
24
|
isOwner?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Owner / occupant / person-in-charge, as the BUSINESS people form asks it.
|
|
27
|
+
* Absent on everyone else - `isOwner` is still the flag that decides unit
|
|
28
|
+
* ownership, and the server derives it from this when it is sent. See
|
|
29
|
+
* `OccupancyRoles` in core's `person.model.ts`.
|
|
30
|
+
*/
|
|
31
|
+
occupancyRole?: TOccupancyRole;
|
|
32
|
+
// Link to this person's `users` row. Empty for the person types that carry
|
|
33
|
+
// no login, and empty for a resident whose account was never written.
|
|
34
|
+
user?: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
declare type TOccupancyRole = "owner" | "occupant" | "person-in-charge";
|
|
38
|
+
|
|
39
|
+
/** One standing and everything the product says about it. See `utils/occupancy-role.ts`. */
|
|
40
|
+
declare type TOccupancyRoleOption = {
|
|
41
|
+
value: TOccupancyRole;
|
|
42
|
+
/** The label a stored role is printed with. */
|
|
43
|
+
title: string;
|
|
44
|
+
/** The row menu's wording. */
|
|
45
|
+
action: string;
|
|
46
|
+
/** The confirmation's heading and its sentence. */
|
|
47
|
+
prompt: string;
|
|
48
|
+
description: string;
|
|
25
49
|
};
|
|
26
50
|
|
|
27
51
|
declare type TPlateNumber = { plateNumber: string, recNo?: string, _id?: string, status: TVehicleStatus, type: TVehicleType, anprCameras?: TVehicleAnprCamera[] };
|
|
28
52
|
|
|
29
53
|
|
|
30
|
-
|
|
54
|
+
// `""` is the FORM's "nothing picked yet" - it is stripped from the payload
|
|
55
|
+
// before it is sent, because absence is what the server reads as "never
|
|
56
|
+
// asked". See `PeopleFormMgmt.vue`.
|
|
57
|
+
declare type TPeoplePayload = Pick<TGuest, "name" | "block" | "level" | "unit" | "unitName" | "contact" | "plateNumber" | "nric" | "contact" | "remarks" | "org" | "site" | "start" | "end" | "type" | "isOwner"> & { status?: string; user?: string; occupancyRole?: TOccupancyRole | "" }
|
|
31
58
|
|
|
32
59
|
declare type TPeopleType = "guest" | "resident" | "tenant"
|
|
@@ -7,6 +7,11 @@ declare type TServiceProvider = {
|
|
|
7
7
|
serviceProviderOrgId: string;
|
|
8
8
|
type: string;
|
|
9
9
|
nature: string;
|
|
10
|
+
status?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
/** The building unit this provider serves (a unit's Management tab). */
|
|
13
|
+
unit?: string | null;
|
|
14
|
+
unitName?: string;
|
|
10
15
|
};
|
|
11
16
|
|
|
12
17
|
declare type TServiceProviderName = {
|