@7365admin1/layer-common 4.90.2-staging.491 → 4.90.3
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 +16 -4
- package/assets/css/primitives.css +0 -57
- package/assets/css/screens.css +4 -8
- package/components/AccessCardDetailsDialog.vue +6 -59
- package/components/AccessCardPreviewDialog.vue +53 -371
- package/components/AppSelect.vue +4 -143
- package/components/BuildingUnitFormEdit.vue +0 -6
- package/components/Dialog/UpdateMoreAction.vue +1 -11
- package/components/DocumentForm.vue +112 -407
- package/components/DocumentManagement.vue +12 -213
- package/components/Facility/BookingSetup.vue +0 -63
- package/components/HidAccessLogDashboard.vue +17 -74
- package/components/HidIntercomManagement.vue +14 -183
- package/components/HidQrCodeConfiguration.vue +195 -17
- package/components/HidReaderManagement.vue +0 -398
- package/components/HidReaderUserRoster.vue +3 -44
- package/components/HidUserEnrollment.vue +292 -2255
- package/components/InventoryItemDetail.vue +1 -2
- package/components/InventoryLinesDialog.vue +13 -91
- package/components/InventoryPhotoInput.vue +6 -44
- package/components/InventoryReportsTab.vue +3 -23
- package/components/InventoryRequestsTab.vue +4 -27
- package/components/InventoryStockTab.vue +0 -3
- package/components/InvitationClientForm.vue +1 -19
- package/components/InvitationForm.vue +4 -31
- package/components/InvitationMain.vue +22 -124
- package/components/SiteSettings.vue +0 -48
- package/components/TableMain.vue +7 -22
- package/components/VehicleManagement.vue +5 -80
- package/components/VisitorForm.vue +0 -12
- package/components/VisitorManagement.vue +5 -267
- package/composables/useAccessManagement.ts +1 -17
- package/composables/useDocument.ts +0 -7
- package/composables/useFacility.ts +0 -11
- package/composables/useHidAmico.ts +0 -165
- package/composables/useHidNavigation.ts +1 -25
- package/composables/useInventory.ts +1 -4
- package/composables/useMember.ts +0 -12
- package/composables/useNFCPatrolReportFilters.ts +3 -21
- package/composables/useNFCPatrolRoute.ts +1 -8
- package/composables/usePeople.ts +0 -19
- package/composables/useServiceProvider.ts +2 -45
- package/composables/useSettingsPermission.ts +0 -14
- package/composables/useUser.ts +2 -6
- package/composables/useVehicle.ts +1 -40
- package/composables/useVerification.ts +0 -3
- package/middleware/01.auth.ts +7 -3
- 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-readers/index.vue +1 -1
- package/types/document.d.ts +0 -14
- package/types/facility.d.ts +0 -4
- package/types/inventory.d.ts +0 -27
- package/types/member.d.ts +0 -4
- package/types/people.d.ts +1 -28
- package/types/service-provider.d.ts +0 -5
- package/types/site.d.ts +1 -7
- package/components/BuildingUnitManagement.vue +0 -298
- package/components/HidAccessPermissions.vue +0 -424
- package/components/HidProfileQrCode.vue +0 -332
- package/components/InventoryPoDialog.vue +0 -111
- package/components/VehicleQrStickerDialog.vue +0 -249
- package/composables/useHidReaderSelection.ts +0 -50
- package/composables/useSiteCategory.ts +0 -45
- package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +0 -23
- package/utils/hid-enrolment-subject.ts +0 -344
- package/utils/hid-permission-assignments.ts +0 -198
- package/utils/hid-reader-selection.ts +0 -52
- package/utils/inventory-receiving.ts +0 -90
- package/utils/invite-group.ts +0 -61
- package/utils/invite-sites.ts +0 -25
- package/utils/occupancy-role.ts +0 -109
- package/utils/service-type.ts +0 -30
- package/utils/vehicle-qr-sticker.ts +0 -184
|
@@ -750,35 +750,11 @@
|
|
|
750
750
|
class="visitor-preview__row"
|
|
751
751
|
>
|
|
752
752
|
<div class="visitor-preview__label">{{ label }}</div>
|
|
753
|
-
<div
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
draw it, is a 14px target - the floor is 24px. So the
|
|
759
|
-
NUMBER is the control and the eye is its affordance:
|
|
760
|
-
the whole masked value is pressable, which makes the
|
|
761
|
-
target the width of the digits rather than of a glyph,
|
|
762
|
-
and being a real `button` it also takes a tab stop,
|
|
763
|
-
which a `v-icon` with a click handler never did. -->
|
|
764
|
-
<button
|
|
765
|
-
type="button"
|
|
766
|
-
class="visitor-preview__reveal"
|
|
767
|
-
:aria-label="showVisitorNric ? 'Hide NRIC' : 'Show NRIC'"
|
|
768
|
-
:aria-pressed="showVisitorNric"
|
|
769
|
-
@click="showVisitorNric = !showVisitorNric"
|
|
770
|
-
>
|
|
771
|
-
<span class="visitor-preview__value">
|
|
772
|
-
{{
|
|
773
|
-
showVisitorNric
|
|
774
|
-
? selectedVisitorObject[key]
|
|
775
|
-
: maskNRIC(selectedVisitorObject[key])
|
|
776
|
-
}}
|
|
777
|
-
</span>
|
|
778
|
-
<v-icon size="16" class="visitor-preview__eye">
|
|
779
|
-
{{ showVisitorNric ? "mdi-eye-off-outline" : "mdi-eye-outline" }}
|
|
780
|
-
</v-icon>
|
|
781
|
-
</button>
|
|
753
|
+
<div
|
|
754
|
+
v-tooltip:top="selectedVisitorObject[key]"
|
|
755
|
+
class="visitor-preview__value"
|
|
756
|
+
>
|
|
757
|
+
{{ maskNRIC(selectedVisitorObject[key]) }}
|
|
782
758
|
</div>
|
|
783
759
|
</div>
|
|
784
760
|
|
|
@@ -828,84 +804,6 @@
|
|
|
828
804
|
</div>
|
|
829
805
|
</div>
|
|
830
806
|
|
|
831
|
-
<!--
|
|
832
|
-
THE CONTRACTOR'S PARTY.
|
|
833
|
-
|
|
834
|
-
The list row has always said `( +2 members)` beside the name
|
|
835
|
-
and then had nowhere to send you for the names themselves. The
|
|
836
|
-
block spans both columns rather than sitting in the 116px
|
|
837
|
-
value track: a member is a record, not a value, and several of
|
|
838
|
-
them in a 250px column is unreadable.
|
|
839
|
-
|
|
840
|
-
Read off `selectedVisitorDataObject` (the raw row) and not
|
|
841
|
-
`selectedVisitorObject`, which filters itself down to
|
|
842
|
-
`typeFieldMap` plus five fixed keys - `members` is on neither
|
|
843
|
-
list, and widening that computed would change what four other
|
|
844
|
-
dialogs on this screen see.
|
|
845
|
-
-->
|
|
846
|
-
<div
|
|
847
|
-
v-else-if="key === 'members' && selectedVisitorMembers.length"
|
|
848
|
-
class="visitor-preview__row visitor-preview__row--block"
|
|
849
|
-
>
|
|
850
|
-
<div class="visitor-preview__label">
|
|
851
|
-
{{ label }} ({{ selectedVisitorMembers.length }})
|
|
852
|
-
</div>
|
|
853
|
-
<div class="visitor-preview__members">
|
|
854
|
-
<div
|
|
855
|
-
v-for="(member, index) in selectedVisitorMembers"
|
|
856
|
-
:key="member?.nric || member?.name || index"
|
|
857
|
-
class="visitor-preview__member"
|
|
858
|
-
>
|
|
859
|
-
<div class="visitor-preview__value">
|
|
860
|
-
{{ member?.name || "N/A" }}
|
|
861
|
-
</div>
|
|
862
|
-
<template v-for="field in memberDetailFields" :key="field.key">
|
|
863
|
-
<div
|
|
864
|
-
v-if="member?.[field.key]"
|
|
865
|
-
class="visitor-preview__member-line"
|
|
866
|
-
>
|
|
867
|
-
<span class="visitor-preview__member-key">
|
|
868
|
-
{{ field.label }}
|
|
869
|
-
</span>
|
|
870
|
-
<!-- A member's NRIC is the same class of data as the
|
|
871
|
-
visitor's, so it gets the same control. Each
|
|
872
|
-
member reveals separately - one toggle for the
|
|
873
|
-
whole card would show three people's NRICs to
|
|
874
|
-
read one. -->
|
|
875
|
-
<button
|
|
876
|
-
v-if="field.key === 'nric'"
|
|
877
|
-
type="button"
|
|
878
|
-
class="visitor-preview__reveal"
|
|
879
|
-
:aria-label="
|
|
880
|
-
isMemberNricShown(index)
|
|
881
|
-
? `Hide NRIC for ${member?.name || 'this member'}`
|
|
882
|
-
: `Show NRIC for ${member?.name || 'this member'}`
|
|
883
|
-
"
|
|
884
|
-
:aria-pressed="isMemberNricShown(index)"
|
|
885
|
-
@click="toggleMemberNric(index)"
|
|
886
|
-
>
|
|
887
|
-
<span>
|
|
888
|
-
{{
|
|
889
|
-
isMemberNricShown(index)
|
|
890
|
-
? member.nric
|
|
891
|
-
: maskNRIC(member.nric)
|
|
892
|
-
}}
|
|
893
|
-
</span>
|
|
894
|
-
<v-icon size="16" class="visitor-preview__eye">
|
|
895
|
-
{{
|
|
896
|
-
isMemberNricShown(index)
|
|
897
|
-
? "mdi-eye-off-outline"
|
|
898
|
-
: "mdi-eye-outline"
|
|
899
|
-
}}
|
|
900
|
-
</v-icon>
|
|
901
|
-
</button>
|
|
902
|
-
<span v-else>{{ member[field.key] }}</span>
|
|
903
|
-
</div>
|
|
904
|
-
</template>
|
|
905
|
-
</div>
|
|
906
|
-
</div>
|
|
907
|
-
</div>
|
|
908
|
-
|
|
909
807
|
<!-- The vehicle number, with Block on its right: the Registered
|
|
910
808
|
tab only, for someone who may add vehicles. It opens the
|
|
911
809
|
Vehicle Mgmt Block Listed form with the category taken from
|
|
@@ -2226,71 +2124,6 @@ const isSelectedVisitorPendingApproval = computed(
|
|
|
2226
2124
|
() => selectedVisitorStatus.value === "pending"
|
|
2227
2125
|
);
|
|
2228
2126
|
|
|
2229
|
-
/**
|
|
2230
|
-
* The members a contractor brought with them. Not gated on the Guests tab: the
|
|
2231
|
-
* list row's own `( +N members)` count is not either, and a contractor with a
|
|
2232
|
-
* party has one wherever the screen shows it.
|
|
2233
|
-
*
|
|
2234
|
-
* Blank entries are dropped rather than drawn as an empty card - the payload
|
|
2235
|
-
* carries `""` for every detail nobody filled in, so a member with no name and
|
|
2236
|
-
* no details would otherwise render as a bare inset box.
|
|
2237
|
-
*/
|
|
2238
|
-
const selectedVisitorMembers = computed<Record<string, any>[]>(() => {
|
|
2239
|
-
const members = selectedVisitorDataObject.value?.members;
|
|
2240
|
-
if (!Array.isArray(members)) return [];
|
|
2241
|
-
|
|
2242
|
-
return members.filter(
|
|
2243
|
-
(member: Record<string, any>) =>
|
|
2244
|
-
member?.name || member?.nric || member?.contact || member?.plateNumber
|
|
2245
|
-
);
|
|
2246
|
-
});
|
|
2247
|
-
|
|
2248
|
-
/**
|
|
2249
|
-
* WHICH NRICs ARE UNCOVERED RIGHT NOW.
|
|
2250
|
-
*
|
|
2251
|
-
* Per member and not per card, so revealing one person's number does not
|
|
2252
|
-
* uncover the rest of the party's. Both are cleared when the dialog closes -
|
|
2253
|
-
* a preview must not open on the next visitor with the last one's NRIC
|
|
2254
|
-
* already showing, and it is the same `selectedVisitorId` that would carry it
|
|
2255
|
-
* across if the same row were reopened.
|
|
2256
|
-
*/
|
|
2257
|
-
const showVisitorNric = ref(false);
|
|
2258
|
-
const shownMemberNrics = ref<number[]>([]);
|
|
2259
|
-
|
|
2260
|
-
function isMemberNricShown(index: number) {
|
|
2261
|
-
return shownMemberNrics.value.includes(index);
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
|
-
function toggleMemberNric(index: number) {
|
|
2265
|
-
shownMemberNrics.value = isMemberNricShown(index)
|
|
2266
|
-
? shownMemberNrics.value.filter((x) => x !== index)
|
|
2267
|
-
: [...shownMemberNrics.value, index];
|
|
2268
|
-
}
|
|
2269
|
-
|
|
2270
|
-
watch(
|
|
2271
|
-
() => dialog.viewVisitor,
|
|
2272
|
-
(open) => {
|
|
2273
|
-
if (open) return;
|
|
2274
|
-
showVisitorNric.value = false;
|
|
2275
|
-
shownMemberNrics.value = [];
|
|
2276
|
-
}
|
|
2277
|
-
);
|
|
2278
|
-
|
|
2279
|
-
/**
|
|
2280
|
-
* What a member row prints under the name, in order. `plateNumber` is in here
|
|
2281
|
-
* because the API returns it on `members[]` even though neither
|
|
2282
|
-
* `TMemberInfo` (this package) nor `TContractorMembers` (API-core's visitor
|
|
2283
|
-
* model, name and nric only) declares it - the two types have drifted from the
|
|
2284
|
-
* document and from each other. Reading the key defensively costs nothing and
|
|
2285
|
-
* shows the vehicle a member actually arrived in; the types are somebody's to
|
|
2286
|
-
* reconcile separately.
|
|
2287
|
-
*/
|
|
2288
|
-
const memberDetailFields = [
|
|
2289
|
-
{ key: "nric", label: "NRIC" },
|
|
2290
|
-
{ key: "contact", label: "Contact" },
|
|
2291
|
-
{ key: "plateNumber", label: "Vehicle" },
|
|
2292
|
-
] as const;
|
|
2293
|
-
|
|
2294
2127
|
const formatType = (item: any) =>
|
|
2295
2128
|
(item.deliveryType ? item.deliveryType + "-" : "") + item.type;
|
|
2296
2129
|
|
|
@@ -2304,7 +2137,6 @@ const formattedFields = {
|
|
|
2304
2137
|
level: "Level",
|
|
2305
2138
|
unit: "Unit",
|
|
2306
2139
|
purpose: "Purpose",
|
|
2307
|
-
members: "Members",
|
|
2308
2140
|
checkIn: "Check In",
|
|
2309
2141
|
snapshotEntryImage: "Entry Image",
|
|
2310
2142
|
checkOut: "Check Out",
|
|
@@ -3311,100 +3143,6 @@ watchEffect(async () => {
|
|
|
3311
3143
|
word-break: break-word;
|
|
3312
3144
|
}
|
|
3313
3145
|
|
|
3314
|
-
/* A row whose value is a set of records rather than a value - it drops the
|
|
3315
|
-
two-column grid and runs the full width of the card body. */
|
|
3316
|
-
.visitor-preview__row--block {
|
|
3317
|
-
display: block;
|
|
3318
|
-
}
|
|
3319
|
-
|
|
3320
|
-
.visitor-preview__members {
|
|
3321
|
-
display: flex;
|
|
3322
|
-
flex-direction: column;
|
|
3323
|
-
gap: 8px;
|
|
3324
|
-
margin-top: 8px;
|
|
3325
|
-
}
|
|
3326
|
-
|
|
3327
|
-
/*
|
|
3328
|
-
* An added member reads as an inset on the card it sits in - `--hover` on
|
|
3329
|
-
* `--border` at the inner radius. Those are `Card/MemberInfoSummary`'s three
|
|
3330
|
-
* decisions, unchanged, so a member looks the same in the preview as it does
|
|
3331
|
-
* in the form that created it. Only the TYPE differs: that card still prints
|
|
3332
|
-
* `<strong>Label:</strong> value`, which is the pattern this dialog just moved
|
|
3333
|
-
* off, so the lines below are set on the scale rather than inherited.
|
|
3334
|
-
*/
|
|
3335
|
-
.visitor-preview__member {
|
|
3336
|
-
padding: 9px 12px;
|
|
3337
|
-
border: 1px solid var(--border);
|
|
3338
|
-
border-radius: var(--r-inner);
|
|
3339
|
-
background: var(--hover);
|
|
3340
|
-
}
|
|
3341
|
-
|
|
3342
|
-
.visitor-preview__member-line {
|
|
3343
|
-
display: flex;
|
|
3344
|
-
gap: 8px;
|
|
3345
|
-
margin-top: 3px;
|
|
3346
|
-
font-size: var(--fs-breadcrumb);
|
|
3347
|
-
color: var(--text2);
|
|
3348
|
-
word-break: break-word;
|
|
3349
|
-
}
|
|
3350
|
-
|
|
3351
|
-
.visitor-preview__member-key {
|
|
3352
|
-
flex: 0 0 52px;
|
|
3353
|
-
color: var(--muted);
|
|
3354
|
-
}
|
|
3355
|
-
|
|
3356
|
-
/*
|
|
3357
|
-
* THE NRIC REVEAL.
|
|
3358
|
-
*
|
|
3359
|
-
* The pressable thing is the masked number, not the glyph beside it: an eye on
|
|
3360
|
-
* its own is a 14-16px target where 24px is the floor, and on a 12.5px member
|
|
3361
|
-
* line an `AppButton variant="icon"` - the layer's 32px icon square - would
|
|
3362
|
-
* make the NRIC line half again the height of the Contact line under it.
|
|
3363
|
-
* Pressing the digits gives a target the width of the value at no cost to the
|
|
3364
|
-
* rhythm, and reads the right way round: the number is what changes.
|
|
3365
|
-
*
|
|
3366
|
-
* It inherits its type rather than setting any, so the visitor's NRIC stays on
|
|
3367
|
-
* `--fs-cell` and a member's on the `--fs-breadcrumb` of the line it sits in.
|
|
3368
|
-
* The negative margin pays back the padding, so a revealed value starts on the
|
|
3369
|
-
* same left edge as every other value in the card.
|
|
3370
|
-
*/
|
|
3371
|
-
.visitor-preview__reveal {
|
|
3372
|
-
display: inline-flex;
|
|
3373
|
-
align-items: center;
|
|
3374
|
-
gap: 6px;
|
|
3375
|
-
margin: -3px -7px;
|
|
3376
|
-
padding: 3px 7px;
|
|
3377
|
-
border: none;
|
|
3378
|
-
border-radius: var(--r-inner-sm);
|
|
3379
|
-
background: transparent;
|
|
3380
|
-
font: inherit;
|
|
3381
|
-
color: inherit;
|
|
3382
|
-
text-align: left;
|
|
3383
|
-
cursor: pointer;
|
|
3384
|
-
transition: background var(--motion) ease;
|
|
3385
|
-
}
|
|
3386
|
-
|
|
3387
|
-
.visitor-preview__reveal:hover {
|
|
3388
|
-
background: var(--hover);
|
|
3389
|
-
}
|
|
3390
|
-
|
|
3391
|
-
.visitor-preview__reveal:focus-visible {
|
|
3392
|
-
outline: 2px solid var(--accent);
|
|
3393
|
-
outline-offset: 1px;
|
|
3394
|
-
}
|
|
3395
|
-
|
|
3396
|
-
/* The design's interactive ink - not Vuetify's fixed blue, which is one colour
|
|
3397
|
-
on both themes. `affectedEntities` gives its NRIC eye the same value. */
|
|
3398
|
-
.visitor-preview__eye {
|
|
3399
|
-
color: var(--accent-text);
|
|
3400
|
-
}
|
|
3401
|
-
|
|
3402
|
-
@media (prefers-reduced-motion: reduce) {
|
|
3403
|
-
.visitor-preview__reveal {
|
|
3404
|
-
transition: none;
|
|
3405
|
-
}
|
|
3406
|
-
}
|
|
3407
|
-
|
|
3408
3146
|
/* The width the type filter carried as `max-width="200"` on the v-select. */
|
|
3409
3147
|
.visitor-type-filter {
|
|
3410
3148
|
max-width: 200px;
|
|
@@ -319,23 +319,7 @@ export default function useAccessManagement() {
|
|
|
319
319
|
);
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
|
|
323
|
-
* `holderType` is the GROUP the card was given from — "Visitor/Resident",
|
|
324
|
-
* "Management" or "Service Provider" (core `EAccessCardHolderTypes`).
|
|
325
|
-
*
|
|
326
|
-
* It is what lets the server resolve the holder afterwards: `assignees`
|
|
327
|
-
* carries a `users` id for a resident, but a membership id for a service
|
|
328
|
-
* provider, and only the group says which collection to look in. Omit it and
|
|
329
|
-
* the card stores `holderType: null`, so card details cannot name the holder.
|
|
330
|
-
*/
|
|
331
|
-
function assignUser(payload: {
|
|
332
|
-
assignees: string[];
|
|
333
|
-
unit: string;
|
|
334
|
-
type: string;
|
|
335
|
-
acm_url: string;
|
|
336
|
-
id?: string;
|
|
337
|
-
holderType?: "Visitor/Resident" | "Management" | "Service Provider";
|
|
338
|
-
}) {
|
|
322
|
+
function assignUser(payload: { assignees: string[]; unit: string; type: string; acm_url: string; id?: string }) {
|
|
339
323
|
return useNuxtApp().$api<Record<string, any>>(
|
|
340
324
|
`/api/access-management/assign-user`,
|
|
341
325
|
{ method: "POST", body: payload }
|
|
@@ -6,7 +6,6 @@ export default function useDocument() {
|
|
|
6
6
|
type = "all",
|
|
7
7
|
site = "",
|
|
8
8
|
parentId = "",
|
|
9
|
-
expiry = "all",
|
|
10
9
|
}: {
|
|
11
10
|
page?: number;
|
|
12
11
|
search?: string;
|
|
@@ -14,11 +13,6 @@ export default function useDocument() {
|
|
|
14
13
|
type?: string;
|
|
15
14
|
site?: string;
|
|
16
15
|
parentId?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Which tab is asking: "active" for Documents, "expired" for
|
|
19
|
-
* Document (Expired). Defaults to "all" so existing callers are unaffected.
|
|
20
|
-
*/
|
|
21
|
-
expiry?: string;
|
|
22
16
|
} = {}) {
|
|
23
17
|
const query: Record<string, any> = {
|
|
24
18
|
page,
|
|
@@ -27,7 +21,6 @@ export default function useDocument() {
|
|
|
27
21
|
type,
|
|
28
22
|
site,
|
|
29
23
|
parentId,
|
|
30
|
-
expiry,
|
|
31
24
|
};
|
|
32
25
|
|
|
33
26
|
return useNuxtApp().$api<Record<string, any>>(`/api/documents`, {
|
|
@@ -76,8 +76,6 @@ export default function usetFacility() {
|
|
|
76
76
|
hourInterval?: number;
|
|
77
77
|
isBookingFeeEnabled: boolean;
|
|
78
78
|
isGuestEnabled: boolean;
|
|
79
|
-
isResidentChecklistEnabled: boolean;
|
|
80
|
-
isSecurityChecklistEnabled: boolean;
|
|
81
79
|
bookingAmount: number | null;
|
|
82
80
|
peakBookingFeeAmount?: number | null;
|
|
83
81
|
bookingFeeGuestAmount?: number | null;
|
|
@@ -175,8 +173,6 @@ export default function usetFacility() {
|
|
|
175
173
|
hourInterval = 1,
|
|
176
174
|
isBookingFeeEnabled = false,
|
|
177
175
|
isGuestEnabled = false,
|
|
178
|
-
isResidentChecklistEnabled = false,
|
|
179
|
-
isSecurityChecklistEnabled = false,
|
|
180
176
|
bookingAmount = 0,
|
|
181
177
|
peakBookingFeeAmount = 0,
|
|
182
178
|
bookingFeeGuestAmount = 0,
|
|
@@ -240,13 +236,6 @@ export default function usetFacility() {
|
|
|
240
236
|
this.hourInterval = hourInterval;
|
|
241
237
|
this.isBookingFeeEnabled = isBookingFeeEnabled;
|
|
242
238
|
this.isGuestEnabled = isGuestEnabled;
|
|
243
|
-
// Exactly one owner, always. `isResidentChecklistEnabled` is the flag
|
|
244
|
-
// the apps gate on, so it decides, and security is its complement —
|
|
245
|
-
// stored rather than computed so each app can read its own flag without
|
|
246
|
-
// knowing the rule. A facility predating both fields lands on security,
|
|
247
|
-
// which is how every one of them already behaved.
|
|
248
|
-
this.isResidentChecklistEnabled = isResidentChecklistEnabled === true;
|
|
249
|
-
this.isSecurityChecklistEnabled = !this.isResidentChecklistEnabled;
|
|
250
239
|
this.bookingAmount = bookingAmount;
|
|
251
240
|
this.peakBookingFeeAmount = peakBookingFeeAmount;
|
|
252
241
|
this.bookingFeeGuestAmount = bookingFeeGuestAmount;
|
|
@@ -28,22 +28,6 @@ export type HidReaderPayload = {
|
|
|
28
28
|
lastCallbackType?: string;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export type HidProfileQr = {
|
|
32
|
-
readerId: string;
|
|
33
|
-
userId: string;
|
|
34
|
-
memberId: string;
|
|
35
|
-
hidUserId: string;
|
|
36
|
-
registration: string;
|
|
37
|
-
readerName: string;
|
|
38
|
-
portalName: string;
|
|
39
|
-
qrEnabled: boolean;
|
|
40
|
-
issued: boolean;
|
|
41
|
-
qrValue: string;
|
|
42
|
-
issuedAt: string;
|
|
43
|
-
/** null when the permission lookup itself failed, so "unknown" stays distinct from "no". */
|
|
44
|
-
assigned: boolean | null;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
31
|
type HidIdentityPayload = {
|
|
48
32
|
site?: string;
|
|
49
33
|
hidUserId?: string | number;
|
|
@@ -155,28 +139,6 @@ export type HidSipAccountData = {
|
|
|
155
139
|
provisionedAt: string;
|
|
156
140
|
};
|
|
157
141
|
|
|
158
|
-
/** One row of the site's SIP account list - who owns the extension, never its password. */
|
|
159
|
-
export type HidSipAccountListItem = {
|
|
160
|
-
_id: string;
|
|
161
|
-
userId: string;
|
|
162
|
-
name: string;
|
|
163
|
-
email: string;
|
|
164
|
-
/**
|
|
165
|
-
* What the owner is called after their name on the contact list: their
|
|
166
|
-
* "Blk 1/Level 1/Unit 1" when they live here, and their membership type -
|
|
167
|
-
* "Security Agency" - when they do not. "" only when the site knows neither.
|
|
168
|
-
*
|
|
169
|
-
* Optional because an API still on the `@7365admin1/core` release that
|
|
170
|
-
* predates it answers without the field; the contact picker falls back to the
|
|
171
|
-
* bare name rather than showing a dangling separator.
|
|
172
|
-
*/
|
|
173
|
-
unitLabel?: string;
|
|
174
|
-
extension: string;
|
|
175
|
-
username: string;
|
|
176
|
-
status: string;
|
|
177
|
-
provisionedAt: string;
|
|
178
|
-
};
|
|
179
|
-
|
|
180
142
|
/**
|
|
181
143
|
* True only for the specific validation error an API that predates core #1878
|
|
182
144
|
* returns when the discover body carries `site`. Deliberately narrow: after
|
|
@@ -204,36 +166,6 @@ export default function useHidAmico() {
|
|
|
204
166
|
});
|
|
205
167
|
}
|
|
206
168
|
|
|
207
|
-
/**
|
|
208
|
-
* The signed-in member's own QR code on one reader.
|
|
209
|
-
*
|
|
210
|
-
* No user id in the path: the server takes the caller from the session, so
|
|
211
|
-
* these cannot be pointed at somebody else. `assigned` in the response says
|
|
212
|
-
* whether the HID permissions screen actually admits this member to the
|
|
213
|
-
* reader - issuing a code does not grant access, and the screen has to be
|
|
214
|
-
* able to say so.
|
|
215
|
-
*/
|
|
216
|
-
function getProfileQr(readerId: string) {
|
|
217
|
-
return useNuxtApp().$api<{ data: HidProfileQr }>(
|
|
218
|
-
`${basePath}/readers/${readerId}/profile-qr`,
|
|
219
|
-
{ method: "GET" },
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function issueProfileQr(readerId: string) {
|
|
224
|
-
return useNuxtApp().$api<{ data: HidProfileQr }>(
|
|
225
|
-
`${basePath}/readers/${readerId}/profile-qr`,
|
|
226
|
-
{ method: "POST" },
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function deleteProfileQr(readerId: string) {
|
|
231
|
-
return useNuxtApp().$api<{ data: HidProfileQr }>(
|
|
232
|
-
`${basePath}/readers/${readerId}/profile-qr`,
|
|
233
|
-
{ method: "DELETE" },
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
169
|
function createReader(payload: HidReaderPayload) {
|
|
238
170
|
return useNuxtApp().$api<HidApiRecord>(`${basePath}/readers`, {
|
|
239
171
|
method: "POST",
|
|
@@ -325,36 +257,6 @@ export default function useHidAmico() {
|
|
|
325
257
|
});
|
|
326
258
|
}
|
|
327
259
|
|
|
328
|
-
/**
|
|
329
|
-
* Which credentials a reader accepts at the door.
|
|
330
|
-
*
|
|
331
|
-
* Separate from `setReaderConfiguration` on purpose. That one is the generic
|
|
332
|
-
* configuration endpoint, gated by an allowlist of writable objects; this is
|
|
333
|
-
* a dedicated route that validates the four methods against the reader's own
|
|
334
|
-
* `capabilities` and confirms the write by reading the device back, so a
|
|
335
|
-
* refusal here names the credential the hardware would not take.
|
|
336
|
-
*/
|
|
337
|
-
function setReaderIdentificationMethods(readerId: string, payload: HidApiRecord) {
|
|
338
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
339
|
-
`${basePath}/readers/${readerId}/identification-methods`,
|
|
340
|
-
{ method: "PUT", body: payload },
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Put a reader back to the settings iService holds for it.
|
|
346
|
-
*
|
|
347
|
-
* A POST rather than a GET because it WRITES: reading the reader's
|
|
348
|
-
* configuration is only the first half, and anything that drifted is
|
|
349
|
-
* re-applied before this returns.
|
|
350
|
-
*/
|
|
351
|
-
function reconcileReaderIdentificationMethods(readerId: string) {
|
|
352
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
353
|
-
`${basePath}/readers/${readerId}/identification-methods/reconcile`,
|
|
354
|
-
{ method: "POST" },
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
260
|
function getIdentities(readerId: string, query: HidApiRecord = {}) {
|
|
359
261
|
return useNuxtApp().$api<HidApiRecord>(`${basePath}/readers/${readerId}/identities`, {
|
|
360
262
|
method: "GET",
|
|
@@ -512,27 +414,6 @@ export default function useHidAmico() {
|
|
|
512
414
|
);
|
|
513
415
|
}
|
|
514
416
|
|
|
515
|
-
function getUserPasswordStatus(readerId: string, hidUserId: string | number) {
|
|
516
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
517
|
-
`${basePath}/readers/${readerId}/users/${hidUserId}/password`,
|
|
518
|
-
{ method: "GET" },
|
|
519
|
-
);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
function setUserPassword(readerId: string, hidUserId: string | number, password: string) {
|
|
523
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
524
|
-
`${basePath}/readers/${readerId}/users/${hidUserId}/password`,
|
|
525
|
-
{ method: "PUT", body: { password } },
|
|
526
|
-
);
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
function deleteUserPassword(readerId: string, hidUserId: string | number) {
|
|
530
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
531
|
-
`${basePath}/readers/${readerId}/users/${hidUserId}/password`,
|
|
532
|
-
{ method: "DELETE" },
|
|
533
|
-
);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
417
|
function deleteUserPin(readerId: string, hidUserId: string | number) {
|
|
537
418
|
return useNuxtApp().$api<{ data: { pinEnrolled: boolean } }>(
|
|
538
419
|
`${basePath}/readers/${readerId}/users/${hidUserId}/pin`,
|
|
@@ -593,42 +474,6 @@ export default function useHidAmico() {
|
|
|
593
474
|
);
|
|
594
475
|
}
|
|
595
476
|
|
|
596
|
-
/**
|
|
597
|
-
* The site's SIP accounts for the intercom contact picker. Site-scoped only:
|
|
598
|
-
* the organisation never decided who may read this — the site guard does —
|
|
599
|
-
* and sending one narrowed the list on a customer site whose accounts were
|
|
600
|
-
* provisioned by a managing agent.
|
|
601
|
-
*/
|
|
602
|
-
function getSipAccounts(siteId: string) {
|
|
603
|
-
return useNuxtApp().$api<{ data: HidSipAccountListItem[] }>(
|
|
604
|
-
`${basePath}/sites/${siteId}/intercom/sip-accounts`,
|
|
605
|
-
{ method: "GET" },
|
|
606
|
-
);
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* Wake the resident's phone for a call the web phone has just placed.
|
|
611
|
-
*
|
|
612
|
-
* The SIP INVITE is the call and travels over the WebSocket, not through the
|
|
613
|
-
* API; this only rings the resident's mobile so somebody is there to answer
|
|
614
|
-
* it. It is therefore fired after the INVITE and never awaited in a way that
|
|
615
|
-
* could fail the call — see `startWebCall` in `HidIntercomManagement.vue`.
|
|
616
|
-
*
|
|
617
|
-
* `notified: false` with a reason is a normal response, not an error: staff
|
|
618
|
-
* extensions and external SIP addresses have no resident behind them.
|
|
619
|
-
*/
|
|
620
|
-
function notifyIntercomCall(
|
|
621
|
-
siteId: string,
|
|
622
|
-
payload: { orgId: string; destination: string; callId: string; readerId?: string },
|
|
623
|
-
) {
|
|
624
|
-
return useNuxtApp().$api<{
|
|
625
|
-
data: { notified: boolean; delivered?: number; reason?: string };
|
|
626
|
-
}>(
|
|
627
|
-
`${basePath}/sites/${siteId}/intercom/notify-call`,
|
|
628
|
-
{ method: "POST", body: payload },
|
|
629
|
-
);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
477
|
function getPermissionCandidates(
|
|
633
478
|
siteId: string,
|
|
634
479
|
query: {
|
|
@@ -660,9 +505,6 @@ export default function useHidAmico() {
|
|
|
660
505
|
|
|
661
506
|
return {
|
|
662
507
|
getReaders,
|
|
663
|
-
getProfileQr,
|
|
664
|
-
issueProfileQr,
|
|
665
|
-
deleteProfileQr,
|
|
666
508
|
discoverReader,
|
|
667
509
|
createReader,
|
|
668
510
|
updateReader,
|
|
@@ -677,8 +519,6 @@ export default function useHidAmico() {
|
|
|
677
519
|
issueVisitorQr,
|
|
678
520
|
getReaderConfiguration,
|
|
679
521
|
setReaderConfiguration,
|
|
680
|
-
setReaderIdentificationMethods,
|
|
681
|
-
reconcileReaderIdentificationMethods,
|
|
682
522
|
getLogs,
|
|
683
523
|
setUserImage,
|
|
684
524
|
deleteUserImage,
|
|
@@ -690,9 +530,6 @@ export default function useHidAmico() {
|
|
|
690
530
|
getUserPinStatus,
|
|
691
531
|
setUserPin,
|
|
692
532
|
deleteUserPin,
|
|
693
|
-
getUserPasswordStatus,
|
|
694
|
-
setUserPassword,
|
|
695
|
-
deleteUserPassword,
|
|
696
533
|
getIdentities,
|
|
697
534
|
getReaderUsers,
|
|
698
535
|
getReaderAccessLogs,
|
|
@@ -703,8 +540,6 @@ export default function useHidAmico() {
|
|
|
703
540
|
makeIntercomCall,
|
|
704
541
|
finalizeIntercomCall,
|
|
705
542
|
ensureSipAccount,
|
|
706
|
-
getSipAccounts,
|
|
707
|
-
notifyIntercomCall,
|
|
708
543
|
getSitePermissions,
|
|
709
544
|
getPermissionCandidates,
|
|
710
545
|
updateSitePermissions,
|
|
@@ -46,33 +46,9 @@ export default function useHidNavigation() {
|
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
// "HID Reader Users" now points at `access-mgmt/administrator`, not at
|
|
50
|
-
// `access-mgmt/hid-users`.
|
|
51
|
-
//
|
|
52
|
-
// Both routes mount a roster of the reader's users, but only this one
|
|
53
|
-
// can act on them. `administrator` renders HidUserEnrollment WITHOUT
|
|
54
|
-
// `card-management`, and that prop is what gates the Enroll action:
|
|
55
|
-
// <template v-if="!props.cardManagement" #actions>
|
|
56
|
-
// `hid-users` renders HidReaderUserRoster, which is read-only apart
|
|
57
|
-
// from PIN management. So the menu entry with this name used to lead
|
|
58
|
-
// to the screen that cannot enrol, while the screen that can was
|
|
59
|
-
// reachable only by typing the URL.
|
|
60
|
-
//
|
|
61
|
-
// `hid-users` is left in place and simply unlisted - the same state
|
|
62
|
-
// `administrator` was in - so any existing link to it still resolves.
|
|
63
49
|
title: "HID Reader Users",
|
|
64
50
|
route: {
|
|
65
|
-
name: "org-site-access-mgmt-
|
|
66
|
-
params: { org, site },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
// The signed-in member's own pass, not somebody else's. Every other
|
|
71
|
-
// entry in this group acts on a resident or a visitor; this one has
|
|
72
|
-
// no subject but the caller.
|
|
73
|
-
title: "HID QR Code",
|
|
74
|
-
route: {
|
|
75
|
-
name: "org-site-access-mgmt-hid-qr-code",
|
|
51
|
+
name: "org-site-access-mgmt-hid-users",
|
|
76
52
|
params: { org, site },
|
|
77
53
|
},
|
|
78
54
|
},
|
|
@@ -53,7 +53,7 @@ export default function useInventory() {
|
|
|
53
53
|
discardUsageDraft: (id: string) => api(`/usage-drafts/${id}/discard`, { method: "POST" }),
|
|
54
54
|
submitUsageDraft: (id: string, body: { photosAfter?: string[]; date?: string }) => api<TInventoryTransaction>(`/usage-drafts/${id}/submit`, { method: "POST", body }),
|
|
55
55
|
|
|
56
|
-
getRequests: (store: string, query: { page?: number; limit?: number; status?: string; mine?: boolean
|
|
56
|
+
getRequests: (store: string, query: { page?: number; limit?: number; status?: string; mine?: boolean }) =>
|
|
57
57
|
api<{ items: TInventoryRequest[]; total: number; pendingCount: number; page: number; pages: number }>(`/stores/${store}/requests`, { query }),
|
|
58
58
|
createRequest: (store: string, body: Record<string, any>) => api(`/stores/${store}/requests`, { method: "POST", body }),
|
|
59
59
|
approveRequest: (id: string, body: { lines?: TInventoryLine[]; remarks?: string }) =>
|
|
@@ -84,9 +84,6 @@ export default function useInventory() {
|
|
|
84
84
|
|
|
85
85
|
getReport: (store: string, report: "movement" | "usage" | "technicians" | "purchases" | "handovers", query: TInventoryPeriod & Record<string, any>) =>
|
|
86
86
|
api<{ rows: any[]; totalQty?: number; totalCost?: number; scope?: "all" | "own_company"; staleAfterDays?: number }>(`/stores/${store}/reports/${report}`, { query }),
|
|
87
|
-
/** One PO across all its deliveries: ordered vs received per item (report viewers and store keepers). */
|
|
88
|
-
getPurchaseOrder: (store: string, po: string) =>
|
|
89
|
-
api<{ po: string; lines: TInventoryPoLine[] }>(`/stores/${store}/reports/purchase-order`, { query: { po } }),
|
|
90
87
|
exportReport: (store: string, report: string, query: TInventoryPeriod & Record<string, any>) =>
|
|
91
88
|
api<Blob>(`/stores/${store}/reports/${report}/export`, { query, responseType: "blob" }),
|
|
92
89
|
checkUsage: (store: string, ids: string[], checked: boolean) =>
|