@7365admin1/layer-common 4.82.0 → 4.82.1-staging.469
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 +4 -4
- package/assets/css/primitives.css +57 -0
- package/assets/css/screens.css +8 -4
- package/components/AccessCardDetailsDialog.vue +57 -4
- package/components/AccessCardPreviewDialog.vue +291 -50
- package/components/AppSelect.vue +143 -4
- 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 +1521 -248
- package/components/InvitationClientForm.vue +19 -1
- package/components/TableMain.vue +22 -7
- 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/useMember.ts +12 -0
- package/composables/usePeople.ts +19 -0
- package/composables/useServiceProvider.ts +40 -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/member.d.ts +4 -0
- package/types/people.d.ts +28 -1
- package/types/service-provider.d.ts +5 -0
- package/utils/hid-enrolment-subject.ts +144 -0
- package/utils/hid-permission-assignments.ts +190 -0
- package/utils/hid-reader-selection.ts +52 -0
- package/utils/occupancy-role.ts +109 -0
- package/utils/service-type.ts +30 -0
|
@@ -388,9 +388,27 @@ watch(
|
|
|
388
388
|
const roles = ref<any[]>([])
|
|
389
389
|
const { getRoles } = useRole()
|
|
390
390
|
|
|
391
|
+
/*
|
|
392
|
+
* `type` is the ROLE type, not the service the client subscribes to, and the
|
|
393
|
+
* only caller (`ClientMain.vue` "Invite Client") passes no `app` prop -- so
|
|
394
|
+
* this sent `type: ""` and the endpoint applied no type filter at all. The
|
|
395
|
+
* dropdown therefore listed every org-less role of every type, which includes
|
|
396
|
+
* the platform's OWN staff roles (`type: "admin"` -- the two rows the console's
|
|
397
|
+
* `/super-admin/role-permissions` screen edits). Offering a Seven365 console
|
|
398
|
+
* staff role on a CLIENT invitation is the defect.
|
|
399
|
+
*
|
|
400
|
+
* A client admin's role is `type: "organization"`, which is what the client
|
|
401
|
+
* roles screen (`org/[organization]/roles-permissions.vue`) already lists. This
|
|
402
|
+
* narrows to exactly that. It is a narrowing of this one picker only: no role
|
|
403
|
+
* changes, no permission changes, and the org-less `organization` roles that
|
|
404
|
+
* were already being picked are all still offered.
|
|
405
|
+
*
|
|
406
|
+
* Keying off the selected service instead would empty the dropdown -- no
|
|
407
|
+
* org-less role carries a service type -- so `props.app` is not the filter.
|
|
408
|
+
*/
|
|
391
409
|
const { data: roleData, refresh: refreshRoles } = await useLazyAsyncData(
|
|
392
410
|
"roles",
|
|
393
|
-
() => getRoles({ org: org.value?._id, type:
|
|
411
|
+
() => getRoles({ org: org.value?._id, type: "organization", limit: 50 }),
|
|
394
412
|
{ watch: [() => props.app] }
|
|
395
413
|
)
|
|
396
414
|
|
package/components/TableMain.vue
CHANGED
|
@@ -59,17 +59,32 @@
|
|
|
59
59
|
>
|
|
60
60
|
{{ createLabel }}
|
|
61
61
|
</v-btn>
|
|
62
|
-
|
|
62
|
+
<!--
|
|
63
|
+
The design's search field. This was a `v-text-field` with only a
|
|
64
|
+
`max-width`, so inside the actions row it shrank to its minimum
|
|
65
|
+
and showed "Se" and a magnifier, at a different height and
|
|
66
|
+
border from the button beside it. Same `search` model; clearing
|
|
67
|
+
now sets "" instead of Vuetify's null.
|
|
68
|
+
-->
|
|
69
|
+
<AppField
|
|
63
70
|
v-if="canSearch"
|
|
64
71
|
v-model="searchInput"
|
|
65
|
-
|
|
72
|
+
search
|
|
66
73
|
placeholder="Search"
|
|
67
|
-
|
|
68
|
-
max-width="300"
|
|
69
|
-
append-inner-icon="mdi-magnify"
|
|
70
|
-
hide-details
|
|
74
|
+
aria-label="Search"
|
|
71
75
|
class="table-card__search"
|
|
72
|
-
|
|
76
|
+
>
|
|
77
|
+
<template v-if="searchInput" #trailing>
|
|
78
|
+
<button
|
|
79
|
+
type="button"
|
|
80
|
+
class="app-field__trailing"
|
|
81
|
+
aria-label="Clear search"
|
|
82
|
+
@click="searchInput = ''"
|
|
83
|
+
>
|
|
84
|
+
<v-icon icon="mdi-close" size="16" />
|
|
85
|
+
</button>
|
|
86
|
+
</template>
|
|
87
|
+
</AppField>
|
|
73
88
|
<!-- Ghost/secondary, as the design specifies for Scan QR Code. -->
|
|
74
89
|
<v-btn
|
|
75
90
|
v-if="canScanVisitorQRCode"
|
|
@@ -910,8 +910,20 @@ const hidQrReaderId = computed(() => (
|
|
|
910
910
|
hidQrConfiguredReaderId.value || String(hidQrReader.value?._id || "")
|
|
911
911
|
));
|
|
912
912
|
|
|
913
|
+
/*
|
|
914
|
+
* Visitor QR passes are hidden at the manager's request (2026-09-23).
|
|
915
|
+
*
|
|
916
|
+
* A flag rather than a deletion: issuing, the preview dialog, printing and the
|
|
917
|
+
* regenerate handler below are all intact and untouched, so bringing the
|
|
918
|
+
* feature back is this one line. Every surface that offers a Visitor QR reads
|
|
919
|
+
* `hidQrCodePassAllowed`, which is why the switch belongs here and not in each
|
|
920
|
+
* of them.
|
|
921
|
+
*/
|
|
922
|
+
const HID_VISITOR_QR_ENABLED = false;
|
|
923
|
+
|
|
913
924
|
const hidQrCodePassAllowed = computed(() => {
|
|
914
925
|
return (
|
|
926
|
+
HID_VISITOR_QR_ENABLED &&
|
|
915
927
|
hidQrCodePassEnabled.value &&
|
|
916
928
|
["guest", "contractor", "walk-in"].includes(prop.type)
|
|
917
929
|
);
|
|
@@ -749,11 +749,35 @@
|
|
|
749
749
|
class="visitor-preview__row"
|
|
750
750
|
>
|
|
751
751
|
<div class="visitor-preview__label">{{ label }}</div>
|
|
752
|
-
<div
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
752
|
+
<div>
|
|
753
|
+
<!-- Was a hover tooltip on the value: the full NRIC only
|
|
754
|
+
reachable by hovering, which says nothing is there to
|
|
755
|
+
reach and cannot be reached at all on a touch screen.
|
|
756
|
+
The eye alone, at the 14px the Incident Report screens
|
|
757
|
+
draw it, is a 14px target - the floor is 24px. So the
|
|
758
|
+
NUMBER is the control and the eye is its affordance:
|
|
759
|
+
the whole masked value is pressable, which makes the
|
|
760
|
+
target the width of the digits rather than of a glyph,
|
|
761
|
+
and being a real `button` it also takes a tab stop,
|
|
762
|
+
which a `v-icon` with a click handler never did. -->
|
|
763
|
+
<button
|
|
764
|
+
type="button"
|
|
765
|
+
class="visitor-preview__reveal"
|
|
766
|
+
:aria-label="showVisitorNric ? 'Hide NRIC' : 'Show NRIC'"
|
|
767
|
+
:aria-pressed="showVisitorNric"
|
|
768
|
+
@click="showVisitorNric = !showVisitorNric"
|
|
769
|
+
>
|
|
770
|
+
<span class="visitor-preview__value">
|
|
771
|
+
{{
|
|
772
|
+
showVisitorNric
|
|
773
|
+
? selectedVisitorObject[key]
|
|
774
|
+
: maskNRIC(selectedVisitorObject[key])
|
|
775
|
+
}}
|
|
776
|
+
</span>
|
|
777
|
+
<v-icon size="16" class="visitor-preview__eye">
|
|
778
|
+
{{ showVisitorNric ? "mdi-eye-off-outline" : "mdi-eye-outline" }}
|
|
779
|
+
</v-icon>
|
|
780
|
+
</button>
|
|
757
781
|
</div>
|
|
758
782
|
</div>
|
|
759
783
|
|
|
@@ -803,6 +827,84 @@
|
|
|
803
827
|
</div>
|
|
804
828
|
</div>
|
|
805
829
|
|
|
830
|
+
<!--
|
|
831
|
+
THE CONTRACTOR'S PARTY.
|
|
832
|
+
|
|
833
|
+
The list row has always said `( +2 members)` beside the name
|
|
834
|
+
and then had nowhere to send you for the names themselves. The
|
|
835
|
+
block spans both columns rather than sitting in the 116px
|
|
836
|
+
value track: a member is a record, not a value, and several of
|
|
837
|
+
them in a 250px column is unreadable.
|
|
838
|
+
|
|
839
|
+
Read off `selectedVisitorDataObject` (the raw row) and not
|
|
840
|
+
`selectedVisitorObject`, which filters itself down to
|
|
841
|
+
`typeFieldMap` plus five fixed keys - `members` is on neither
|
|
842
|
+
list, and widening that computed would change what four other
|
|
843
|
+
dialogs on this screen see.
|
|
844
|
+
-->
|
|
845
|
+
<div
|
|
846
|
+
v-else-if="key === 'members' && selectedVisitorMembers.length"
|
|
847
|
+
class="visitor-preview__row visitor-preview__row--block"
|
|
848
|
+
>
|
|
849
|
+
<div class="visitor-preview__label">
|
|
850
|
+
{{ label }} ({{ selectedVisitorMembers.length }})
|
|
851
|
+
</div>
|
|
852
|
+
<div class="visitor-preview__members">
|
|
853
|
+
<div
|
|
854
|
+
v-for="(member, index) in selectedVisitorMembers"
|
|
855
|
+
:key="member?.nric || member?.name || index"
|
|
856
|
+
class="visitor-preview__member"
|
|
857
|
+
>
|
|
858
|
+
<div class="visitor-preview__value">
|
|
859
|
+
{{ member?.name || "N/A" }}
|
|
860
|
+
</div>
|
|
861
|
+
<template v-for="field in memberDetailFields" :key="field.key">
|
|
862
|
+
<div
|
|
863
|
+
v-if="member?.[field.key]"
|
|
864
|
+
class="visitor-preview__member-line"
|
|
865
|
+
>
|
|
866
|
+
<span class="visitor-preview__member-key">
|
|
867
|
+
{{ field.label }}
|
|
868
|
+
</span>
|
|
869
|
+
<!-- A member's NRIC is the same class of data as the
|
|
870
|
+
visitor's, so it gets the same control. Each
|
|
871
|
+
member reveals separately - one toggle for the
|
|
872
|
+
whole card would show three people's NRICs to
|
|
873
|
+
read one. -->
|
|
874
|
+
<button
|
|
875
|
+
v-if="field.key === 'nric'"
|
|
876
|
+
type="button"
|
|
877
|
+
class="visitor-preview__reveal"
|
|
878
|
+
:aria-label="
|
|
879
|
+
isMemberNricShown(index)
|
|
880
|
+
? `Hide NRIC for ${member?.name || 'this member'}`
|
|
881
|
+
: `Show NRIC for ${member?.name || 'this member'}`
|
|
882
|
+
"
|
|
883
|
+
:aria-pressed="isMemberNricShown(index)"
|
|
884
|
+
@click="toggleMemberNric(index)"
|
|
885
|
+
>
|
|
886
|
+
<span>
|
|
887
|
+
{{
|
|
888
|
+
isMemberNricShown(index)
|
|
889
|
+
? member.nric
|
|
890
|
+
: maskNRIC(member.nric)
|
|
891
|
+
}}
|
|
892
|
+
</span>
|
|
893
|
+
<v-icon size="16" class="visitor-preview__eye">
|
|
894
|
+
{{
|
|
895
|
+
isMemberNricShown(index)
|
|
896
|
+
? "mdi-eye-off-outline"
|
|
897
|
+
: "mdi-eye-outline"
|
|
898
|
+
}}
|
|
899
|
+
</v-icon>
|
|
900
|
+
</button>
|
|
901
|
+
<span v-else>{{ member[field.key] }}</span>
|
|
902
|
+
</div>
|
|
903
|
+
</template>
|
|
904
|
+
</div>
|
|
905
|
+
</div>
|
|
906
|
+
</div>
|
|
907
|
+
|
|
806
908
|
<!-- The vehicle number, with Block on its right: the Registered
|
|
807
909
|
tab only, for someone who may add vehicles. It opens the
|
|
808
910
|
Vehicle Mgmt Block Listed form with the category taken from
|
|
@@ -2123,6 +2225,71 @@ const isSelectedVisitorPendingApproval = computed(
|
|
|
2123
2225
|
() => selectedVisitorStatus.value === "pending"
|
|
2124
2226
|
);
|
|
2125
2227
|
|
|
2228
|
+
/**
|
|
2229
|
+
* The members a contractor brought with them. Not gated on the Guests tab: the
|
|
2230
|
+
* list row's own `( +N members)` count is not either, and a contractor with a
|
|
2231
|
+
* party has one wherever the screen shows it.
|
|
2232
|
+
*
|
|
2233
|
+
* Blank entries are dropped rather than drawn as an empty card - the payload
|
|
2234
|
+
* carries `""` for every detail nobody filled in, so a member with no name and
|
|
2235
|
+
* no details would otherwise render as a bare inset box.
|
|
2236
|
+
*/
|
|
2237
|
+
const selectedVisitorMembers = computed<Record<string, any>[]>(() => {
|
|
2238
|
+
const members = selectedVisitorDataObject.value?.members;
|
|
2239
|
+
if (!Array.isArray(members)) return [];
|
|
2240
|
+
|
|
2241
|
+
return members.filter(
|
|
2242
|
+
(member: Record<string, any>) =>
|
|
2243
|
+
member?.name || member?.nric || member?.contact || member?.plateNumber
|
|
2244
|
+
);
|
|
2245
|
+
});
|
|
2246
|
+
|
|
2247
|
+
/**
|
|
2248
|
+
* WHICH NRICs ARE UNCOVERED RIGHT NOW.
|
|
2249
|
+
*
|
|
2250
|
+
* Per member and not per card, so revealing one person's number does not
|
|
2251
|
+
* uncover the rest of the party's. Both are cleared when the dialog closes -
|
|
2252
|
+
* a preview must not open on the next visitor with the last one's NRIC
|
|
2253
|
+
* already showing, and it is the same `selectedVisitorId` that would carry it
|
|
2254
|
+
* across if the same row were reopened.
|
|
2255
|
+
*/
|
|
2256
|
+
const showVisitorNric = ref(false);
|
|
2257
|
+
const shownMemberNrics = ref<number[]>([]);
|
|
2258
|
+
|
|
2259
|
+
function isMemberNricShown(index: number) {
|
|
2260
|
+
return shownMemberNrics.value.includes(index);
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
function toggleMemberNric(index: number) {
|
|
2264
|
+
shownMemberNrics.value = isMemberNricShown(index)
|
|
2265
|
+
? shownMemberNrics.value.filter((x) => x !== index)
|
|
2266
|
+
: [...shownMemberNrics.value, index];
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
watch(
|
|
2270
|
+
() => dialog.viewVisitor,
|
|
2271
|
+
(open) => {
|
|
2272
|
+
if (open) return;
|
|
2273
|
+
showVisitorNric.value = false;
|
|
2274
|
+
shownMemberNrics.value = [];
|
|
2275
|
+
}
|
|
2276
|
+
);
|
|
2277
|
+
|
|
2278
|
+
/**
|
|
2279
|
+
* What a member row prints under the name, in order. `plateNumber` is in here
|
|
2280
|
+
* because the API returns it on `members[]` even though neither
|
|
2281
|
+
* `TMemberInfo` (this package) nor `TContractorMembers` (API-core's visitor
|
|
2282
|
+
* model, name and nric only) declares it - the two types have drifted from the
|
|
2283
|
+
* document and from each other. Reading the key defensively costs nothing and
|
|
2284
|
+
* shows the vehicle a member actually arrived in; the types are somebody's to
|
|
2285
|
+
* reconcile separately.
|
|
2286
|
+
*/
|
|
2287
|
+
const memberDetailFields = [
|
|
2288
|
+
{ key: "nric", label: "NRIC" },
|
|
2289
|
+
{ key: "contact", label: "Contact" },
|
|
2290
|
+
{ key: "plateNumber", label: "Vehicle" },
|
|
2291
|
+
] as const;
|
|
2292
|
+
|
|
2126
2293
|
const formatType = (item: any) =>
|
|
2127
2294
|
(item.deliveryType ? item.deliveryType + "-" : "") + item.type;
|
|
2128
2295
|
|
|
@@ -2136,6 +2303,7 @@ const formattedFields = {
|
|
|
2136
2303
|
level: "Level",
|
|
2137
2304
|
unit: "Unit",
|
|
2138
2305
|
purpose: "Purpose",
|
|
2306
|
+
members: "Members",
|
|
2139
2307
|
checkIn: "Check In",
|
|
2140
2308
|
snapshotEntryImage: "Entry Image",
|
|
2141
2309
|
checkOut: "Check Out",
|
|
@@ -3142,6 +3310,100 @@ watchEffect(async () => {
|
|
|
3142
3310
|
word-break: break-word;
|
|
3143
3311
|
}
|
|
3144
3312
|
|
|
3313
|
+
/* A row whose value is a set of records rather than a value - it drops the
|
|
3314
|
+
two-column grid and runs the full width of the card body. */
|
|
3315
|
+
.visitor-preview__row--block {
|
|
3316
|
+
display: block;
|
|
3317
|
+
}
|
|
3318
|
+
|
|
3319
|
+
.visitor-preview__members {
|
|
3320
|
+
display: flex;
|
|
3321
|
+
flex-direction: column;
|
|
3322
|
+
gap: 8px;
|
|
3323
|
+
margin-top: 8px;
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
/*
|
|
3327
|
+
* An added member reads as an inset on the card it sits in - `--hover` on
|
|
3328
|
+
* `--border` at the inner radius. Those are `Card/MemberInfoSummary`'s three
|
|
3329
|
+
* decisions, unchanged, so a member looks the same in the preview as it does
|
|
3330
|
+
* in the form that created it. Only the TYPE differs: that card still prints
|
|
3331
|
+
* `<strong>Label:</strong> value`, which is the pattern this dialog just moved
|
|
3332
|
+
* off, so the lines below are set on the scale rather than inherited.
|
|
3333
|
+
*/
|
|
3334
|
+
.visitor-preview__member {
|
|
3335
|
+
padding: 9px 12px;
|
|
3336
|
+
border: 1px solid var(--border);
|
|
3337
|
+
border-radius: var(--r-inner);
|
|
3338
|
+
background: var(--hover);
|
|
3339
|
+
}
|
|
3340
|
+
|
|
3341
|
+
.visitor-preview__member-line {
|
|
3342
|
+
display: flex;
|
|
3343
|
+
gap: 8px;
|
|
3344
|
+
margin-top: 3px;
|
|
3345
|
+
font-size: var(--fs-breadcrumb);
|
|
3346
|
+
color: var(--text2);
|
|
3347
|
+
word-break: break-word;
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
.visitor-preview__member-key {
|
|
3351
|
+
flex: 0 0 52px;
|
|
3352
|
+
color: var(--muted);
|
|
3353
|
+
}
|
|
3354
|
+
|
|
3355
|
+
/*
|
|
3356
|
+
* THE NRIC REVEAL.
|
|
3357
|
+
*
|
|
3358
|
+
* The pressable thing is the masked number, not the glyph beside it: an eye on
|
|
3359
|
+
* its own is a 14-16px target where 24px is the floor, and on a 12.5px member
|
|
3360
|
+
* line an `AppButton variant="icon"` - the layer's 32px icon square - would
|
|
3361
|
+
* make the NRIC line half again the height of the Contact line under it.
|
|
3362
|
+
* Pressing the digits gives a target the width of the value at no cost to the
|
|
3363
|
+
* rhythm, and reads the right way round: the number is what changes.
|
|
3364
|
+
*
|
|
3365
|
+
* It inherits its type rather than setting any, so the visitor's NRIC stays on
|
|
3366
|
+
* `--fs-cell` and a member's on the `--fs-breadcrumb` of the line it sits in.
|
|
3367
|
+
* The negative margin pays back the padding, so a revealed value starts on the
|
|
3368
|
+
* same left edge as every other value in the card.
|
|
3369
|
+
*/
|
|
3370
|
+
.visitor-preview__reveal {
|
|
3371
|
+
display: inline-flex;
|
|
3372
|
+
align-items: center;
|
|
3373
|
+
gap: 6px;
|
|
3374
|
+
margin: -3px -7px;
|
|
3375
|
+
padding: 3px 7px;
|
|
3376
|
+
border: none;
|
|
3377
|
+
border-radius: var(--r-inner-sm);
|
|
3378
|
+
background: transparent;
|
|
3379
|
+
font: inherit;
|
|
3380
|
+
color: inherit;
|
|
3381
|
+
text-align: left;
|
|
3382
|
+
cursor: pointer;
|
|
3383
|
+
transition: background var(--motion) ease;
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3386
|
+
.visitor-preview__reveal:hover {
|
|
3387
|
+
background: var(--hover);
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
.visitor-preview__reveal:focus-visible {
|
|
3391
|
+
outline: 2px solid var(--accent);
|
|
3392
|
+
outline-offset: 1px;
|
|
3393
|
+
}
|
|
3394
|
+
|
|
3395
|
+
/* The design's interactive ink - not Vuetify's fixed blue, which is one colour
|
|
3396
|
+
on both themes. `affectedEntities` gives its NRIC eye the same value. */
|
|
3397
|
+
.visitor-preview__eye {
|
|
3398
|
+
color: var(--accent-text);
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3401
|
+
@media (prefers-reduced-motion: reduce) {
|
|
3402
|
+
.visitor-preview__reveal {
|
|
3403
|
+
transition: none;
|
|
3404
|
+
}
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3145
3407
|
/* The width the type filter carried as `max-width="200"` on the v-select. */
|
|
3146
3408
|
.visitor-type-filter {
|
|
3147
3409
|
max-width: 200px;
|
|
@@ -6,6 +6,7 @@ export default function useDocument() {
|
|
|
6
6
|
type = "all",
|
|
7
7
|
site = "",
|
|
8
8
|
parentId = "",
|
|
9
|
+
expiry = "all",
|
|
9
10
|
}: {
|
|
10
11
|
page?: number;
|
|
11
12
|
search?: string;
|
|
@@ -13,6 +14,11 @@ export default function useDocument() {
|
|
|
13
14
|
type?: string;
|
|
14
15
|
site?: string;
|
|
15
16
|
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;
|
|
16
22
|
} = {}) {
|
|
17
23
|
const query: Record<string, any> = {
|
|
18
24
|
page,
|
|
@@ -21,6 +27,7 @@ export default function useDocument() {
|
|
|
21
27
|
type,
|
|
22
28
|
site,
|
|
23
29
|
parentId,
|
|
30
|
+
expiry,
|
|
24
31
|
};
|
|
25
32
|
|
|
26
33
|
return useNuxtApp().$api<Record<string, any>>(`/api/documents`, {
|
|
@@ -76,6 +76,8 @@ export default function usetFacility() {
|
|
|
76
76
|
hourInterval?: number;
|
|
77
77
|
isBookingFeeEnabled: boolean;
|
|
78
78
|
isGuestEnabled: boolean;
|
|
79
|
+
isResidentChecklistEnabled: boolean;
|
|
80
|
+
isSecurityChecklistEnabled: boolean;
|
|
79
81
|
bookingAmount: number | null;
|
|
80
82
|
peakBookingFeeAmount?: number | null;
|
|
81
83
|
bookingFeeGuestAmount?: number | null;
|
|
@@ -173,6 +175,8 @@ export default function usetFacility() {
|
|
|
173
175
|
hourInterval = 1,
|
|
174
176
|
isBookingFeeEnabled = false,
|
|
175
177
|
isGuestEnabled = false,
|
|
178
|
+
isResidentChecklistEnabled = false,
|
|
179
|
+
isSecurityChecklistEnabled = false,
|
|
176
180
|
bookingAmount = 0,
|
|
177
181
|
peakBookingFeeAmount = 0,
|
|
178
182
|
bookingFeeGuestAmount = 0,
|
|
@@ -236,6 +240,13 @@ export default function usetFacility() {
|
|
|
236
240
|
this.hourInterval = hourInterval;
|
|
237
241
|
this.isBookingFeeEnabled = isBookingFeeEnabled;
|
|
238
242
|
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;
|
|
239
250
|
this.bookingAmount = bookingAmount;
|
|
240
251
|
this.peakBookingFeeAmount = peakBookingFeeAmount;
|
|
241
252
|
this.bookingFeeGuestAmount = bookingFeeGuestAmount;
|
|
@@ -28,6 +28,22 @@ 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
|
+
|
|
31
47
|
type HidIdentityPayload = {
|
|
32
48
|
site?: string;
|
|
33
49
|
hidUserId?: string | number;
|
|
@@ -139,6 +155,28 @@ export type HidSipAccountData = {
|
|
|
139
155
|
provisionedAt: string;
|
|
140
156
|
};
|
|
141
157
|
|
|
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
|
+
|
|
142
180
|
/**
|
|
143
181
|
* True only for the specific validation error an API that predates core #1878
|
|
144
182
|
* returns when the discover body carries `site`. Deliberately narrow: after
|
|
@@ -166,6 +204,36 @@ export default function useHidAmico() {
|
|
|
166
204
|
});
|
|
167
205
|
}
|
|
168
206
|
|
|
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
|
+
|
|
169
237
|
function createReader(payload: HidReaderPayload) {
|
|
170
238
|
return useNuxtApp().$api<HidApiRecord>(`${basePath}/readers`, {
|
|
171
239
|
method: "POST",
|
|
@@ -257,6 +325,36 @@ export default function useHidAmico() {
|
|
|
257
325
|
});
|
|
258
326
|
}
|
|
259
327
|
|
|
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
|
+
|
|
260
358
|
function getIdentities(readerId: string, query: HidApiRecord = {}) {
|
|
261
359
|
return useNuxtApp().$api<HidApiRecord>(`${basePath}/readers/${readerId}/identities`, {
|
|
262
360
|
method: "GET",
|
|
@@ -414,6 +512,27 @@ export default function useHidAmico() {
|
|
|
414
512
|
);
|
|
415
513
|
}
|
|
416
514
|
|
|
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
|
+
|
|
417
536
|
function deleteUserPin(readerId: string, hidUserId: string | number) {
|
|
418
537
|
return useNuxtApp().$api<{ data: { pinEnrolled: boolean } }>(
|
|
419
538
|
`${basePath}/readers/${readerId}/users/${hidUserId}/pin`,
|
|
@@ -474,6 +593,42 @@ export default function useHidAmico() {
|
|
|
474
593
|
);
|
|
475
594
|
}
|
|
476
595
|
|
|
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
|
+
|
|
477
632
|
function getPermissionCandidates(
|
|
478
633
|
siteId: string,
|
|
479
634
|
query: {
|
|
@@ -505,6 +660,9 @@ export default function useHidAmico() {
|
|
|
505
660
|
|
|
506
661
|
return {
|
|
507
662
|
getReaders,
|
|
663
|
+
getProfileQr,
|
|
664
|
+
issueProfileQr,
|
|
665
|
+
deleteProfileQr,
|
|
508
666
|
discoverReader,
|
|
509
667
|
createReader,
|
|
510
668
|
updateReader,
|
|
@@ -519,6 +677,8 @@ export default function useHidAmico() {
|
|
|
519
677
|
issueVisitorQr,
|
|
520
678
|
getReaderConfiguration,
|
|
521
679
|
setReaderConfiguration,
|
|
680
|
+
setReaderIdentificationMethods,
|
|
681
|
+
reconcileReaderIdentificationMethods,
|
|
522
682
|
getLogs,
|
|
523
683
|
setUserImage,
|
|
524
684
|
deleteUserImage,
|
|
@@ -530,6 +690,9 @@ export default function useHidAmico() {
|
|
|
530
690
|
getUserPinStatus,
|
|
531
691
|
setUserPin,
|
|
532
692
|
deleteUserPin,
|
|
693
|
+
getUserPasswordStatus,
|
|
694
|
+
setUserPassword,
|
|
695
|
+
deleteUserPassword,
|
|
533
696
|
getIdentities,
|
|
534
697
|
getReaderUsers,
|
|
535
698
|
getReaderAccessLogs,
|
|
@@ -540,6 +703,8 @@ export default function useHidAmico() {
|
|
|
540
703
|
makeIntercomCall,
|
|
541
704
|
finalizeIntercomCall,
|
|
542
705
|
ensureSipAccount,
|
|
706
|
+
getSipAccounts,
|
|
707
|
+
notifyIntercomCall,
|
|
543
708
|
getSitePermissions,
|
|
544
709
|
getPermissionCandidates,
|
|
545
710
|
updateSitePermissions,
|