@7365admin1/layer-common 4.8.0 → 4.8.1-staging.305

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.
@@ -511,6 +511,15 @@ export default function usePropertyPermission() {
511
511
  "Allows the user to view the site's cameras. (Legacy name — this is the camera wall.)",
512
512
  },
513
513
  },
514
+ // NEW, owner answer Q9, 2026-09-11 — the iMA365 CCTV tile's own right.
515
+ // Same string and description as `useSecurityPermission`. Catalogue-only:
516
+ // nothing reads it yet, and the four `virtual-patrol:` strings above stay.
517
+ "cctv-mgmt": {
518
+ "see-all-cctv": {
519
+ check: true,
520
+ description: "Allows the user to view the site's CCTV cameras.",
521
+ },
522
+ },
514
523
  "nfc-patrol": {
515
524
  "see-all-nfc-patrol": {
516
525
  check: true,
@@ -427,6 +427,12 @@ export default function useSecurityPermission() {
427
427
  description:
428
428
  "Allows the user to view the details of a specific incident report.",
429
429
  },
430
+ // Owner answer Q10, 2026-09-11. Property's spelling and description,
431
+ // verbatim; the iSecure365 mobile app already accepts this string.
432
+ "review-incident-report": {
433
+ check: true,
434
+ description: "Allows the user to approve or reject incident report.",
435
+ },
430
436
  "delete-incident-report": {
431
437
  check: true,
432
438
  description:
@@ -590,6 +596,118 @@ export default function useSecurityPermission() {
590
596
  "Allows the user to open the notification feed on the iSecure365 mobile app.",
591
597
  },
592
598
  },
599
+
600
+ /*
601
+ * THE GUARD APP'S TILES THAT NO ROLE COULD BE GRANTED — owner answers Q5,
602
+ * Q9 and Q10, 2026-09-11: "tiles with no permission: build them".
603
+ *
604
+ * Every string below already exists verbatim in another application's
605
+ * catalogue (Property, or Cleaning for the 3A emergency set) and is copied
606
+ * from there, spelling and description. Two are new, and only two:
607
+ * `nfc-patrol:start-nfc-patrol` (mirrors `start-virtual-patrol-route`) and
608
+ * `cctv-mgmt:see-all-cctv` (today only `site-settings:manage-cctv-camera`,
609
+ * a setup action, exists). Pinned by `test/no-duplicate-spelling.test.mjs`.
610
+ *
611
+ * Catalogue-only: this widens what the role editor may OFFER and grants
612
+ * nobody anything. No gate reads these here yet.
613
+ */
614
+ "emergency-contact": {
615
+ "see-all": {
616
+ check: true,
617
+ description: "Allows the user to view the list of all emergency contacts.",
618
+ },
619
+ "see-details": {
620
+ check: true,
621
+ description:
622
+ "Allows the user to view the details of a specific emergency contact.",
623
+ },
624
+ "add-emergency-contact": {
625
+ check: true,
626
+ description: "Allows the user to add a new emergency contact to the system.",
627
+ },
628
+ "update-emergency-contact": {
629
+ check: true,
630
+ description: "Allows the user to update emergency contact details.",
631
+ },
632
+ "delete-emergency-contact": {
633
+ check: true,
634
+ description:
635
+ "Allows the user to remove an emergency contact from the system permanently.",
636
+ },
637
+ "add-emergency-contact-category": {
638
+ check: true,
639
+ description:
640
+ "Allows the user to add a new emergency contact category to the system.",
641
+ },
642
+ "delete-emergency-contact-category": {
643
+ check: true,
644
+ description:
645
+ "Allows the user to delete an emergency contact category from the system.",
646
+ },
647
+ },
648
+ "facility-booking-mgmt": {
649
+ "add-facility-booking": {
650
+ check: true,
651
+ description:
652
+ "Allows the user to add a new facility-booking to the system.",
653
+ },
654
+ "see-all-facility-booking": {
655
+ check: true,
656
+ description: "Allows the user to view the list of all facilities.",
657
+ },
658
+ "see-facility-booking-details": {
659
+ check: true,
660
+ description:
661
+ "Allows the user to view the details of a specific facility-booking.",
662
+ },
663
+ "update-facility-booking": {
664
+ check: true,
665
+ description: "Allows the user to update facility-booking details.",
666
+ },
667
+ "delete-facility-booking": {
668
+ check: true,
669
+ description:
670
+ "Allows the user to remove a facility-booking from the system permanently.",
671
+ },
672
+ },
673
+ // Property's descriptions minus its "Checked by the iMA365 mobile app."
674
+ // sentence, which is not true of this application.
675
+ "passes-and-keys-mgmt": {
676
+ "see-all-passes-and-keys": {
677
+ check: true,
678
+ description:
679
+ "Allows the user to view the list of all passes and keys on mobile.",
680
+ },
681
+ },
682
+ "resident-transactions": {
683
+ "see-all-resident-transactions": {
684
+ check: true,
685
+ description:
686
+ "Allows the user to view the list of all resident transactions on mobile.",
687
+ },
688
+ },
689
+ "nfc-patrol": {
690
+ "see-all-nfc-patrol": {
691
+ check: true,
692
+ description:
693
+ "Allows the user to view created routes and patrol logs.",
694
+ },
695
+ // NEW. Mirrors `virtual-patrol:start-virtual-patrol-route`.
696
+ "start-nfc-patrol": {
697
+ check: true,
698
+ description:
699
+ "Allows the user to start NFC patrolling on a specific route.",
700
+ },
701
+ },
702
+ // NEW. Seeing the CCTV wall, as distinct from setting cameras up
703
+ // (`site-settings:manage-cctv-camera`).
704
+ "cctv-mgmt": {
705
+ "see-all-cctv": {
706
+ check: true,
707
+ description: "Allows the user to view the site's CCTV cameras.",
708
+ },
709
+ },
710
+
593
711
  members: memberPermissions,
594
712
  invitations: invitationPermissions,
595
713
  roles: rolePermissions,
@@ -345,16 +345,19 @@ export default function useWebUsb() {
345
345
  70,
346
346
  );
347
347
 
348
- const qrSmall = 140;
349
- const qrCenter = 250;
350
- const margin = 20;
351
- const qrCanvas = await QRCode.toCanvas(qrUrlImage, { width: qrCenter });
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
+ });
352
359
 
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);
360
+ ctx.drawImage(qrCanvas, (canvas.width - qrSize) / 2, 90, qrSize, qrSize);
358
361
 
359
362
  ctx.font = "25px Arial";
360
363
  ctx.fillText(companyName || "", canvas.width / 2, 470);
@@ -401,8 +404,8 @@ export default function useWebUsb() {
401
404
  /**
402
405
  * The self-service onboarding QR: one large QR code, a "SCAN QR CODE"-style
403
406
  * subtext, and a dark site-name banner along the bottom - a single-purpose
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).
407
+ * gate sign, not the visitor-pass receipt `createReceiptLayout` produces
408
+ * (that one pairs its QR with company, date, access and instruction lines).
406
409
  */
407
410
  async function createOnboardingQrLayout(
408
411
  qrUrlImage: string,
@@ -327,7 +327,12 @@ export const PERMISSIONS = {
327
327
  "add-nfc-patrol",
328
328
  "update-nfc-patrol",
329
329
  "delete-nfc-patrol",
330
+ // Owner answer Q10, 2026-09-11. Mirrors `start-virtual-patrol-route`.
331
+ "start-nfc-patrol",
330
332
  ],
333
+ // Owner answer Q9, 2026-09-11: seeing the CCTV wall. Distinct from
334
+ // `site-settings:manage-cctv-camera`, which is camera setup.
335
+ "cctv-mgmt": ["see-all-cctv"],
331
336
  "billing-mgmt": [
332
337
  "see-all-billing-summary",
333
338
  "see-all-billing-items",
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.8.0",
5
+ "version": "4.8.1-staging.305",
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.",
@@ -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>
@@ -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/people.d.ts CHANGED
@@ -22,11 +22,14 @@ 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;
25
28
  };
26
29
 
27
30
  declare type TPlateNumber = { plateNumber: string, recNo: string, _id?: string, status: "active" | "deleted" | "pending", type: TVehicleType };
28
31
 
29
32
 
30
- declare type TPeoplePayload = Pick<TGuest, "name" | "block" | "level" | "unit" | "unitName" | "contact" | "plateNumber" | "nric" | "contact" | "remarks" | "org" | "site" | "start" | "end" | "type" | "isOwner"> & { status?: string }
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 }
31
34
 
32
35
  declare type TPeopleType = "guest" | "resident" | "tenant"
@@ -242,6 +242,9 @@ 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",
245
248
  "mdi-bluetooth": "bluetooth",
246
249
  "mdi-nfc": "nfc",
247
250