@7365admin1/layer-common 4.17.1-staging.330 → 4.18.0

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +10 -4
  2. package/components/DocumentForm.vue +112 -407
  3. package/components/DocumentManagement.vue +12 -213
  4. package/components/EntryPass/QrTemplatePreview.vue +25 -21
  5. package/components/EntryPassInformation.vue +24 -119
  6. package/components/Facility/BookingSetup.vue +0 -63
  7. package/components/HidIntercomManagement.vue +43 -193
  8. package/components/HidReaderManagement.vue +0 -26
  9. package/components/HidReaderUserRoster.vue +2 -32
  10. package/components/HidUserEnrollment.vue +213 -779
  11. package/components/InventoryImportDialog.vue +117 -0
  12. package/components/InventoryItemDetail.vue +158 -0
  13. package/components/InventoryItemDialog.vue +125 -0
  14. package/components/InventoryLinesDialog.vue +288 -0
  15. package/components/InventoryMain.vue +226 -0
  16. package/components/InventoryMyStockTab.vue +114 -0
  17. package/components/InventoryPhotoInput.vue +70 -0
  18. package/components/InventoryReportsTab.vue +181 -0
  19. package/components/InventoryRequestsTab.vue +218 -0
  20. package/components/InventorySettingsTab.vue +94 -0
  21. package/components/InventoryStockTab.vue +177 -0
  22. package/components/InventoryTechniciansTab.vue +81 -0
  23. package/components/InventoryUsageDialog.vue +203 -0
  24. package/components/InvitationClientForm.vue +1 -19
  25. package/components/Layout/Header.vue +0 -26
  26. package/components/VisitorManagement.vue +5 -267
  27. package/composables/useAccessManagement.ts +0 -5
  28. package/composables/useCleaningPermission.ts +2 -7
  29. package/composables/useCommonPermission.ts +22 -0
  30. package/composables/useDocument.ts +0 -7
  31. package/composables/useFacility.ts +0 -11
  32. package/composables/useHidAmico.ts +0 -97
  33. package/composables/useHidNavigation.ts +1 -25
  34. package/composables/useInventory.ts +97 -0
  35. package/composables/useInventoryPermission.ts +31 -0
  36. package/composables/useLandscapingPermission.ts +2 -6
  37. package/composables/useMechanicalElectricalPermission.ts +2 -0
  38. package/composables/usePeople.ts +0 -19
  39. package/composables/usePestControlPermission.ts +2 -0
  40. package/composables/usePoolMaintenancePermission.ts +2 -0
  41. package/composables/usePropertyPermission.ts +2 -0
  42. package/composables/useSecurityPermission.ts +9 -8
  43. package/composables/useWebUsb.ts +11 -14
  44. package/constants/permissions.ts +1 -1
  45. package/package.json +1 -1
  46. package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
  47. package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
  48. package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
  49. package/types/document.d.ts +0 -14
  50. package/types/facility.d.ts +0 -4
  51. package/types/inventory.d.ts +89 -0
  52. package/types/people.d.ts +1 -4
  53. package/utils/materialSymbols.ts +0 -3
  54. package/utils/module-routes.ts +1 -0
  55. package/components/HidAccessPermissions.vue +0 -424
  56. package/components/HidProfileQrCode.vue +0 -323
  57. package/components/NotificationBell.vue +0 -321
  58. package/composables/useNotification.ts +0 -78
  59. package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +0 -23
  60. package/utils/hid-permission-assignments.ts +0 -190
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Inventory API (`/api/inventory`). What a person may do in a store comes back
3
+ * on the store itself (`store.access`), decided by the server — screens show
4
+ * or hide actions from that, never from a guess on the client.
5
+ */
6
+ export default function useInventory() {
7
+ const api = <T = any>(url: string, options: Record<string, any> = {}) =>
8
+ useNuxtApp().$api<T>(`/api/inventory${url}`, options);
9
+
10
+ const typeLabels: Record<string, string> = {
11
+ opening: "Opening stock",
12
+ receive: "Received",
13
+ issue: "Issued",
14
+ use: "Used",
15
+ return: "Returned",
16
+ adjust: "Stock count",
17
+ };
18
+
19
+ return {
20
+ typeLabels,
21
+
22
+ getStores: (site: string) => api<TInventoryStore[]>("/stores", { query: { site } }),
23
+ createStore: (body: { org: string; sites: string[]; name: string }) =>
24
+ api<TInventoryStore>("/stores", { method: "POST", body }),
25
+ updateStore: (id: string, body: Partial<Pick<TInventoryStore, "name" | "sites" | "showInResidentApp" | "showCostInResidentApp">>) =>
26
+ api<TInventoryStore>(`/stores/${id}`, { method: "PATCH", body }),
27
+
28
+ getItems: (store: string, query: { page?: number; limit?: number; search?: string; lowStock?: boolean; includeInactive?: boolean }) =>
29
+ api<{ items: TInventoryItem[]; total: number; lowCount: number; page: number; pages: number }>(`/stores/${store}/items`, { query }),
30
+ createItem: (store: string, body: Record<string, any>) => api(`/stores/${store}/items`, { method: "POST", body }),
31
+ updateItem: (id: string, body: Record<string, any>) => api(`/items/${id}`, { method: "PATCH", body }),
32
+
33
+ receive: (store: string, body: Record<string, any>) => api(`/stores/${store}/receive`, { method: "POST", body }),
34
+ count: (store: string, body: { item: string; countedQty: number; reason: string }) =>
35
+ api(`/stores/${store}/counts`, { method: "POST", body }),
36
+ issue: (store: string, body: Record<string, any>) => api(`/stores/${store}/issue`, { method: "POST", body }),
37
+ receiveReturn: (store: string, body: Record<string, any>) => api(`/stores/${store}/returns`, { method: "POST", body }),
38
+ recordUsage: (store: string, body: Record<string, any>) => api(`/stores/${store}/usage`, { method: "POST", body }),
39
+
40
+ getRequests: (store: string, query: { page?: number; limit?: number; status?: string; mine?: boolean }) =>
41
+ api<{ items: TInventoryRequest[]; total: number; pendingCount: number; page: number; pages: number }>(`/stores/${store}/requests`, { query }),
42
+ createRequest: (store: string, body: Record<string, any>) => api(`/stores/${store}/requests`, { method: "POST", body }),
43
+ approveRequest: (id: string, body: { lines?: TInventoryLine[]; remarks?: string }) =>
44
+ api(`/requests/${id}/approve`, { method: "POST", body }),
45
+ rejectRequest: (id: string, remarks: string) => api(`/requests/${id}/reject`, { method: "POST", body: { remarks } }),
46
+ cancelRequest: (id: string) => api(`/requests/${id}/cancel`, { method: "POST" }),
47
+
48
+ getHoldings: (store: string, holder: string = "me") => api<TInventoryHolding[]>(`/stores/${store}/holdings`, { query: { holder } }),
49
+ getTransactions: (store: string, query: Record<string, any>) =>
50
+ api<{ items: TInventoryTransaction[]; total: number; page: number; pages: number }>(`/stores/${store}/transactions`, { query }),
51
+
52
+ getUnits: (store: string, site: string, search = "") =>
53
+ api<{ _id: string; name: string; tenantName: string }[]>(`/stores/${store}/units`, { query: { site, search } }),
54
+ getCommonAreas: (store: string, site: string) => api<string[]>(`/stores/${store}/common-areas`, { query: { site } }),
55
+ getPeople: (store: string, search = "") => api<{ _id: string; name: string; orgName: string }[]>(`/stores/${store}/people`, { query: { search } }),
56
+
57
+ getReport: (store: string, report: "movement" | "usage" | "technicians", query: TInventoryPeriod) =>
58
+ api<{ rows: any[]; totalQty?: number; totalCost?: number }>(`/stores/${store}/reports/${report}`, { query }),
59
+ exportReport: (store: string, report: string, query: TInventoryPeriod) =>
60
+ api<Blob>(`/stores/${store}/reports/${report}/export`, { query, responseType: "blob" }),
61
+ importTemplate: () => api<Blob>("/import-template", { responseType: "blob" }),
62
+ importItems: (store: string, file: File, commit: boolean) => {
63
+ const body = new FormData();
64
+ body.append("file", file);
65
+ return api<{ committed: boolean; ready: number; skipped: number; errors: number; rows: { row: number; name: string; status: string; message: string }[] }>(
66
+ `/stores/${store}/import`,
67
+ { method: "POST", body, query: { commit } },
68
+ );
69
+ },
70
+ };
71
+ }
72
+
73
+ /** Save a Blob as a file download in the browser. */
74
+ export function saveBlob(blob: Blob, filename: string) {
75
+ const url = URL.createObjectURL(blob);
76
+ const a = document.createElement("a");
77
+ a.href = url;
78
+ a.download = filename;
79
+ a.click();
80
+ URL.revokeObjectURL(url);
81
+ }
82
+
83
+ /**
84
+ * A date picked in a form, as the API wants it: omitted for today (the server
85
+ * stamps the current time), noon local time for an earlier day.
86
+ */
87
+ export function pickedDate(value: string) {
88
+ if (!value || value >= new Date().toLocaleDateString("en-CA")) return undefined;
89
+ return new Date(`${value}T12:00:00`).toISOString();
90
+ }
91
+
92
+ /** Start and end of a local calendar month, as ISO strings the API accepts. */
93
+ export function monthPeriod(date = new Date()) {
94
+ const from = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0, 0);
95
+ const to = new Date(date.getFullYear(), date.getMonth() + 1, 0, 23, 59, 59, 999);
96
+ return { from: from.toISOString(), to: to.toISOString() };
97
+ }
@@ -0,0 +1,31 @@
1
+ import { useCommonPermissions } from "./useCommonPermission";
2
+ import { useLocalSetup } from "./useLocalSetup";
3
+ import usePermission from "./usePermission";
4
+ import { permissionsDenied } from "../utils/module-routes";
5
+
6
+ /**
7
+ * Whether to show the Inventory menu. Any one of the four inventory
8
+ * permissions is enough (an empty list or `*` grants all, the estate rule);
9
+ * which buttons appear inside the screen is decided by the API per store.
10
+ */
11
+ export default function useInventoryPermission() {
12
+ const { hasPermission } = usePermission();
13
+ const { inventoryPermissions } = useCommonPermissions();
14
+ const { userAppRole, userAppModulesDenied } = useLocalSetup();
15
+ const permissions = { inventory: inventoryPermissions };
16
+
17
+ const canSeeInventory = computed(() => {
18
+ const role = userAppRole.value;
19
+ if (!role) return false;
20
+ if (permissionsDenied(["inventory"], userAppModulesDenied?.value)) return false;
21
+ if (role.permissions.includes("*")) return true;
22
+ return (
23
+ hasPermission(role, permissions, "inventory", "view-inventory") ||
24
+ hasPermission(role, permissions, "inventory", "request-stock") ||
25
+ hasPermission(role, permissions, "inventory", "approve-requests") ||
26
+ hasPermission(role, permissions, "inventory", "manage-inventory")
27
+ );
28
+ });
29
+
30
+ return { canSeeInventory };
31
+ }
@@ -30,8 +30,10 @@ export default function useLandscapingPermission() {
30
30
  bulletinBoardPermissions,
31
31
  serviceProviderPermissions,
32
32
 
33
+ inventoryPermissions,
33
34
  } = useCommonPermissions();
34
35
  const permissions: TPermissions = {
36
+ inventory: inventoryPermissions,
35
37
  members: memberPermissions,
36
38
  roles: rolePermissions,
37
39
  invitations: invitationPermissions,
@@ -74,12 +76,6 @@ export default function useLandscapingPermission() {
74
76
  description: "Allows the user to delete an emergency contact category from the system.",
75
77
  },
76
78
  },
77
- inventory: {
78
- "view-inventory": {
79
- check: true,
80
- description: "Allows the user to view the inventory list.",
81
- },
82
- },
83
79
  // area management permissions
84
80
  "area-mgmt": {
85
81
  "see-all-areas": {
@@ -30,10 +30,12 @@ export default function useMechanicalElectricalPermission() {
30
30
  workOrderPermissions,
31
31
  bulletinBoardPermissions,
32
32
 
33
+ inventoryPermissions,
33
34
  } = useCommonPermissions();
34
35
  const { permissions: schedulePermissions } = useCleaningPermission();
35
36
 
36
37
  const permissions: TPermissions = {
38
+ inventory: inventoryPermissions,
37
39
  members: memberPermissions,
38
40
  roles: rolePermissions,
39
41
  invitations: invitationPermissions,
@@ -115,24 +115,6 @@ 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
-
136
118
  async function getPeopleByUnit(
137
119
  _id: string,
138
120
  { status = "active", type = "" } = {}
@@ -166,7 +148,6 @@ export default function () {
166
148
  findPersonByPlateNumberMultipleResult,
167
149
  findPersonByContact,
168
150
  getPeopleByUnit,
169
- getOccupiedStructure,
170
151
  searchCompanyList,
171
152
  findUsersByPlateNumber,
172
153
  reviewResidentPerson,
@@ -30,8 +30,10 @@ export default function usePestControlPermission() {
30
30
  bulletinBoardPermissions,
31
31
  serviceProviderPermissions,
32
32
 
33
+ inventoryPermissions,
33
34
  } = useCommonPermissions();
34
35
  const permissions: TPermissions = {
36
+ inventory: inventoryPermissions,
35
37
  members: memberPermissions,
36
38
  roles: rolePermissions,
37
39
  invitations: invitationPermissions,
@@ -30,8 +30,10 @@ export default function usePoolMaintenancePermission() {
30
30
  bulletinBoardPermissions,
31
31
  serviceProviderPermissions,
32
32
 
33
+ inventoryPermissions,
33
34
  } = useCommonPermissions();
34
35
  const permissions: TPermissions = {
36
+ inventory: inventoryPermissions,
35
37
  members: memberPermissions,
36
38
  roles: rolePermissions,
37
39
  invitations: invitationPermissions,
@@ -41,10 +41,12 @@ export default function usePropertyPermission() {
41
41
  buildingUnitManagementPermissions,
42
42
  siteSettingsPermissions,
43
43
 
44
+ inventoryPermissions,
44
45
  } = useCommonPermissions();
45
46
 
46
47
 
47
48
  const permissions: TPermissions = {
49
+ inventory: inventoryPermissions,
48
50
  members: memberPermissions,
49
51
  roles: rolePermissions,
50
52
  invitations: invitationPermissions,
@@ -32,22 +32,23 @@ export default function useSecurityPermission() {
32
32
  siteSettingsPermissions,
33
33
  bulletinBoardPermissions,
34
34
 
35
+ inventoryPermissions,
35
36
  } = useCommonPermissions();
36
37
 
37
38
  const permissions: TPermissions = {
39
+ inventory: inventoryPermissions,
38
40
  feedbacks: {
39
41
  "add-feedback": {
40
42
  check: true,
41
43
  description: "Allows the user to add a new feedback to the system.",
42
44
  },
43
- // ONE row for "see all feedbacks" (2026-09-17). The editor showed two -
44
- // `see-all-feedbacks` and `see-all-feedback` - for the same right.
45
- // Kept: `see-all-feedback`, the canonical spelling ~95 live roles hold and
46
- // the iSecure365 app checks. Removed: the plural row. Roles that hold
47
- // `feedbacks:see-all-feedbacks` (~8) are NOT un-granted: it stays in
48
- // `LEGACY_PERMISSION_ALIASES`, so `hasPermission` still honours it and the
49
- // edit dialog shows it ticked on this row (and unticking removes it).
50
- // API-core and the mobile app accept both spellings too.
45
+ "see-all-feedbacks": {
46
+ check: true,
47
+ description: "Allows the user to view the list of all feedbacks.",
48
+ },
49
+ // The spelling the great majority of live roles actually hold, and the
50
+ // one the iSecure365 mobile app checks. Offered so an administrator can
51
+ // reproduce an existing grant.
51
52
  "see-all-feedback": {
52
53
  check: true,
53
54
  description: "Allows the user to view the list of all feedbacks.",
@@ -345,19 +345,16 @@ export default function useWebUsb() {
345
345
  70,
346
346
  );
347
347
 
348
- // The pass used to print five copies of the same QR - four 140px ones at
349
- // the corners around a 250px centre - so a strip could be cut apart. It now
350
- // prints a single large QR filling that same band (y 90 to 440, above the
351
- // company name at y 470), which scans far more reliably on a thermal print.
352
- // Generated at the size it is drawn at: the old corner copies were
353
- // downscaled from the 250px canvas, which softened their modules.
354
- const qrSize = 350;
355
- const qrCanvas = await QRCode.toCanvas(qrUrlImage, {
356
- width: qrSize,
357
- margin: 1,
358
- });
348
+ const qrSmall = 140;
349
+ const qrCenter = 250;
350
+ const margin = 20;
351
+ const qrCanvas = await QRCode.toCanvas(qrUrlImage, { width: qrCenter });
359
352
 
360
- ctx.drawImage(qrCanvas, (canvas.width - qrSize) / 2, 90, qrSize, qrSize);
353
+ ctx.drawImage(qrCanvas, margin, 90, qrSmall, qrSmall);
354
+ ctx.drawImage(qrCanvas, canvas.width - qrSmall - margin, 90, qrSmall, qrSmall);
355
+ ctx.drawImage(qrCanvas, (canvas.width - qrCenter) / 2, 110, qrCenter, qrCenter);
356
+ ctx.drawImage(qrCanvas, margin, 300, qrSmall, qrSmall);
357
+ ctx.drawImage(qrCanvas, canvas.width - qrSmall - margin, 300, qrSmall, qrSmall);
361
358
 
362
359
  ctx.font = "25px Arial";
363
360
  ctx.fillText(companyName || "", canvas.width / 2, 470);
@@ -404,8 +401,8 @@ export default function useWebUsb() {
404
401
  /**
405
402
  * The self-service onboarding QR: one large QR code, a "SCAN QR CODE"-style
406
403
  * subtext, and a dark site-name banner along the bottom - a single-purpose
407
- * gate sign, not the visitor-pass receipt `createReceiptLayout` produces
408
- * (that one pairs its QR with company, date, access and instruction lines).
404
+ * gate sign, not the multi-copy visitor-pass receipt `createReceiptLayout`
405
+ * produces (that one prints several QRs to be cut apart and handed out).
409
406
  */
410
407
  async function createOnboardingQrLayout(
411
408
  qrUrlImage: string,
@@ -169,6 +169,7 @@ export const PERMISSIONS = {
169
169
  "import-units",
170
170
  "delete-unit",
171
171
  ],
172
+ inventory: ["view-inventory", "request-stock", "approve-requests", "manage-inventory"],
172
173
  "supply-mgmt": [
173
174
  "see-all-supplies",
174
175
  "add-supply",
@@ -199,7 +200,6 @@ export const PERMISSIONS = {
199
200
  "manage-attendance-settings",
200
201
  ],
201
202
  "my-attendance": ["see-own-attendance", "check-in-out"],
202
- inventory: ["view-inventory"],
203
203
  toilet_locations: ["create-toilet-location"],
204
204
 
205
205
  // ---- per-trade schedules ----
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.17.1-staging.330",
5
+ "version": "4.18.0",
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 HID users."
7
7
  >
8
- <HidUserEnrollment :site="siteId" :org="orgId" />
8
+ <HidUserEnrollment :site="siteId" />
9
9
  </HidEnabledGate>
10
10
  </v-container>
11
11
  </template>
@@ -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" :org="orgId" card-management />
8
+ <HidUserEnrollment :site="siteId" card-management />
9
9
  </HidEnabledGate>
10
10
  </v-container>
11
11
  </template>
@@ -5,7 +5,7 @@
5
5
  :org="orgId"
6
6
  message="Enable HID as a service for this site before managing HID readers."
7
7
  >
8
- <HidReaderManagement :site="siteId" :org="orgId" />
8
+ <HidReaderManagement :site="siteId" />
9
9
  </HidEnabledGate>
10
10
  </v-container>
11
11
  </template>
@@ -3,18 +3,4 @@ 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;
20
6
  };
@@ -73,10 +73,6 @@ 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;
80
76
  bookingAmount: number | null;
81
77
  peakBookingFeeAmount?: number | null;
82
78
  bookingFeeGuestAmount?: number | null;
@@ -0,0 +1,89 @@
1
+ declare type TInventoryAccess = {
2
+ canView: boolean;
3
+ canManage: boolean;
4
+ canApprove: boolean;
5
+ canRequest: boolean;
6
+ };
7
+
8
+ declare type TInventoryStore = {
9
+ _id: string;
10
+ org: string;
11
+ orgName?: string;
12
+ ownerType: "property" | "service_provider";
13
+ name: string;
14
+ sites: string[];
15
+ showInResidentApp: boolean;
16
+ showCostInResidentApp: boolean;
17
+ access: TInventoryAccess;
18
+ };
19
+
20
+ declare type TInventoryItem = {
21
+ _id: string;
22
+ store: string;
23
+ name: string;
24
+ code: string;
25
+ category: string;
26
+ unit: string;
27
+ description: string;
28
+ photo: string;
29
+ reorderLevel: number;
30
+ unitCost?: number;
31
+ onHand: number;
32
+ status: "active" | "inactive";
33
+ lowStock: boolean;
34
+ };
35
+
36
+ declare type TInventoryLine = { item: string; qty: number };
37
+
38
+ declare type TInventoryRequest = {
39
+ _id: string;
40
+ store: string;
41
+ site: string;
42
+ requestedBy: string;
43
+ requestedByName: string;
44
+ lines: { item: string; itemName: string; unit: string; qty: number; issuedQty: number }[];
45
+ reference: string;
46
+ remarks: string;
47
+ status: "pending" | "issued" | "rejected" | "cancelled";
48
+ decidedByName?: string;
49
+ decidedAt?: string;
50
+ decisionRemarks?: string;
51
+ createdAt: string;
52
+ };
53
+
54
+ declare type TInventoryHolding = {
55
+ _id: string;
56
+ item: string;
57
+ itemName: string;
58
+ unit: string;
59
+ photo: string;
60
+ holder: string;
61
+ holderName: string;
62
+ qty: number;
63
+ };
64
+
65
+ declare type TInventoryTransaction = {
66
+ _id: string;
67
+ item: string;
68
+ itemName: string;
69
+ unit: string;
70
+ type: "opening" | "receive" | "issue" | "use" | "return" | "adjust";
71
+ qty: number;
72
+ storeChange: number;
73
+ storeBalance: number;
74
+ holderName?: string;
75
+ holderChange?: number;
76
+ holderBalance?: number;
77
+ site?: string;
78
+ location?: { type: "common_area" | "tenant_unit"; area?: string; unitName?: string; tenantName?: string };
79
+ reference?: string;
80
+ supplier?: string;
81
+ unitCost: number;
82
+ totalCost: number;
83
+ photos?: { before: string[]; after: string[]; other: string[] };
84
+ remarks?: string;
85
+ date: string;
86
+ createdByName: string;
87
+ };
88
+
89
+ declare type TInventoryPeriod = { from: string; to: string; site?: string; locationType?: string };
package/types/people.d.ts CHANGED
@@ -22,14 +22,11 @@ declare type TPeople = {
22
22
  email?: string;
23
23
  files?: { name: string, id: string }[];
24
24
  isOwner?: boolean;
25
- // Link to this person's `users` row. Empty for the person types that carry
26
- // no login, and empty for a resident whose account was never written.
27
- user?: string;
28
25
  };
29
26
 
30
27
  declare type TPlateNumber = { plateNumber: string, recNo: string, _id?: string, status: "active" | "deleted" | "pending", type: TVehicleType };
31
28
 
32
29
 
33
- 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 }
30
+ declare type TPeoplePayload = Pick<TGuest, "name" | "block" | "level" | "unit" | "unitName" | "contact" | "plateNumber" | "nric" | "contact" | "remarks" | "org" | "site" | "start" | "end" | "type" | "isOwner"> & { status?: string }
34
31
 
35
32
  declare type TPeopleType = "guest" | "resident" | "tenant"
@@ -242,9 +242,6 @@ export const MDI_TO_SYMBOL: Record<string, string> = {
242
242
  "mdi-link-variant": "link",
243
243
  "mdi-lan-connect": "lan",
244
244
  "mdi-lan-disconnect": "link_off", // NEAREST: no disconnected-LAN glyph
245
- "mdi-lan-check": "network_check",
246
- "mdi-dialpad": "dialpad",
247
- "mdi-headset": "headset_mic",
248
245
  "mdi-bluetooth": "bluetooth",
249
246
  "mdi-nfc": "nfc",
250
247
 
@@ -70,6 +70,7 @@ export const MODULE_ROUTES: Readonly<Record<string, string>> = Object.freeze({
70
70
  "org-site-soa-mgmt": "SOA-mgmt",
71
71
  "org-site-people-mgmt": "people-mgmt",
72
72
  "org-site-supply-mgmt": "supply-mgmt",
73
+ "org-site-inventory": "inventory",
73
74
  "org-site-facility": "facility-mgmt",
74
75
  "org-site-facility-mgmt": "facility-mgmt",
75
76
  "org-site-facility-booking": "facility-booking-mgmt",