@7365admin1/layer-common 3.0.2 → 3.0.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 3.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 8cae579: add document management layer fix
8
+
3
9
  ## 3.0.2
4
10
 
5
11
  ### Patch Changes
@@ -395,12 +395,12 @@
395
395
  </div>
396
396
  <v-chip
397
397
  size="small"
398
- :color="getStaffTone(item.status)"
398
+ color="blue-grey-darken-1"
399
399
  variant="tonal"
400
400
  label
401
- class="ml-auto flex-shrink-0"
401
+ class="ml-auto flex-shrink-0 font-weight-bold"
402
402
  >
403
- {{ item.status }}
403
+ {{ item.totalHours || 0 }} hrs
404
404
  </v-chip>
405
405
  </div>
406
406
  </v-card>
@@ -625,6 +625,7 @@ type StaffItem = {
625
625
  name: string;
626
626
  role: string;
627
627
  status: string;
628
+ totalHours?: number | string;
628
629
  raw?: Record<string, any>;
629
630
  };
630
631
 
@@ -1549,6 +1550,7 @@ function normalizeStaffItem(
1549
1550
  item.attendanceStatus ||
1550
1551
  "Off duty"
1551
1552
  ),
1553
+ totalHours: item.totalHours || 0,
1552
1554
  raw: item,
1553
1555
  };
1554
1556
  }
@@ -501,7 +501,7 @@
501
501
  </v-col>
502
502
  <v-col cols="3" class="d-flex align-center justify-end">
503
503
  <v-switch
504
- v-model="facility.isBookingUnitLimitEnabled"
504
+ v-model="isBookingUnitLimitEnabled"
505
505
  class="d-flex align-center"
506
506
  color="primary"
507
507
  hide-details
@@ -519,7 +519,7 @@
519
519
  :min="1"
520
520
  :max="500"
521
521
  hide-details
522
- :disabled="!facility.isBookingUnitLimitEnabled"
522
+ :disabled="!isBookingUnitLimitEnabled"
523
523
  />
524
524
  </v-col>
525
525
  </v-row>
@@ -539,7 +539,7 @@
539
539
  </v-col>
540
540
  <v-col cols="3" class="d-flex align-center justify-end">
541
541
  <v-switch
542
- v-model="facility.isMaxNumberGuestLimitEnabled"
542
+ v-model="isMaxNumberGuestLimitEnabled"
543
543
  class="d-flex align-center"
544
544
  color="primary"
545
545
  hide-details
@@ -557,7 +557,7 @@
557
557
  :min="1"
558
558
  :max="500"
559
559
  hide-details
560
- :disabled="!facility.isMaxNumberGuestLimitEnabled"
560
+ :disabled="!isMaxNumberGuestLimitEnabled"
561
561
  />
562
562
  </v-col>
563
563
  </v-row>
@@ -576,7 +576,7 @@
576
576
  </v-col>
577
577
  <v-col cols="3" class="d-flex align-center justify-end">
578
578
  <v-switch
579
- v-model="facility.isCancelAllowedLimitEnabled"
579
+ v-model="isCancelAllowedLimitEnabled"
580
580
  class="d-flex align-center"
581
581
  color="primary"
582
582
  hide-details
@@ -594,7 +594,7 @@
594
594
  :min="1"
595
595
  :max="500"
596
596
  hide-details
597
- :disabled="!facility.isCancelAllowedLimitEnabled"
597
+ :disabled="!isCancelAllowedLimitEnabled"
598
598
  />
599
599
  </v-col>
600
600
  </v-row>
@@ -1013,32 +1013,56 @@ const handlePolicy = (newContent: string) => {
1013
1013
  facility.value.bookingPolicy = newContent;
1014
1014
  };
1015
1015
 
1016
+ const isBookingUnitLimitEnabled = ref<boolean>(false);
1017
+ const isMaxNumberGuestLimitEnabled = ref<boolean>(false);
1018
+ const isCancelAllowedLimitEnabled = ref<boolean>(false);
1019
+
1020
+ watchEffect(() => {
1021
+ if (facility.value.bookingUnitLimit > 0) {
1022
+ isBookingUnitLimitEnabled.value = true;
1023
+ } else {
1024
+ isBookingUnitLimitEnabled.value = false;
1025
+ }
1026
+
1027
+ if (facility.value.maxNumberGuestLimit > 0) {
1028
+ isMaxNumberGuestLimitEnabled.value = true;
1029
+ } else {
1030
+ isMaxNumberGuestLimitEnabled.value = false;
1031
+ }
1032
+
1033
+ if (facility.value.daysAllowedCancel > 0) {
1034
+ isCancelAllowedLimitEnabled.value = true;
1035
+ } else {
1036
+ isCancelAllowedLimitEnabled.value = false;
1037
+ }
1038
+ });
1039
+
1016
1040
  function onToggleBookingUnitLimit(val: any) {
1017
1041
  if (val) {
1018
- facility.value.isBookingUnitLimitEnabled = true;
1042
+ isBookingUnitLimitEnabled.value = true;
1019
1043
  facility.value.bookingUnitLimit = 1;
1020
1044
  } else {
1021
- facility.value.isBookingUnitLimitEnabled = false;
1045
+ isBookingUnitLimitEnabled.value = false;
1022
1046
  facility.value.bookingUnitLimit = null;
1023
1047
  }
1024
1048
  }
1025
1049
 
1026
1050
  function onToggleMaxNumberGuestLimit(val: any) {
1027
1051
  if (val) {
1028
- facility.value.isMaxNumberGuestLimitEnabled = true;
1052
+ isMaxNumberGuestLimitEnabled.value = true;
1029
1053
  facility.value.maxNumberGuestLimit = 1;
1030
1054
  } else {
1031
- facility.value.isMaxNumberGuestLimitEnabled = false;
1055
+ isMaxNumberGuestLimitEnabled.value = false;
1032
1056
  facility.value.maxNumberGuestLimit = null;
1033
1057
  }
1034
1058
  }
1035
1059
 
1036
1060
  function onToggleCancelAllowedLimit(val: any) {
1037
1061
  if (val) {
1038
- facility.value.isCancelAllowedLimitEnabled = true;
1062
+ isCancelAllowedLimitEnabled.value = true;
1039
1063
  facility.value.daysAllowedCancel = 1;
1040
1064
  } else {
1041
- facility.value.isCancelAllowedLimitEnabled = false;
1065
+ isCancelAllowedLimitEnabled.value = false;
1042
1066
  facility.value.daysAllowedCancel = null;
1043
1067
  }
1044
1068
  }
@@ -29,8 +29,8 @@
29
29
  </v-col>
30
30
 
31
31
  <v-col v-if="!visitorInfo.checkIn" cols="12">
32
- <InputLabel class="text-capitalize" title="NRIC/Passport/ID No." />
33
- <v-text-field
32
+ <InputLabel class="text-capitalize" title="NRIC" />
33
+ <!-- <v-text-field
34
34
  v-if="!visitorInfo.checkIn"
35
35
  v-model="visitorInfo.nric"
36
36
  density="comfortable"
@@ -43,7 +43,17 @@
43
43
  density="comfortable"
44
44
  hide-details
45
45
  readonly
46
- />
46
+ /> -->
47
+ <NRICNumber v-if="!visitorInfo.checkIn"
48
+ v-model="visitorInfo.nric"
49
+ density="comfortable"
50
+ hide-details
51
+ clearable />
52
+ <NRICNumber v-else
53
+ v-model="visitorNric"
54
+ density="comfortable"
55
+ hide-details
56
+ readonly />
47
57
  </v-col>
48
58
 
49
59
  <v-col v-if="!visitorInfo.checkIn" cols="12" class="mt-4">
@@ -222,6 +232,8 @@
222
232
  </v-card>
223
233
  </template>
224
234
  <script setup lang="ts">
235
+ import NRICNumber from './Input/NRICNumber.vue';
236
+
225
237
  const prop = defineProps({
226
238
  site: {
227
239
  type: String,
@@ -271,15 +283,15 @@ const location = computed({
271
283
  get: () => {
272
284
  if (
273
285
  visitorInfo.value &&
274
- visitorInfo.value.block &&
275
- visitorInfo.value.level &&
286
+ visitorInfo.value.block?.name &&
287
+ visitorInfo.value.level?.name &&
276
288
  visitorInfo.value.unitName
277
289
  ) {
278
- return `${visitorInfo.value.block} / ${visitorInfo.value.level} / ${visitorInfo.value.unitName}`;
290
+ return `${visitorInfo.value.block?.name} / ${visitorInfo.value.level?.name} / ${visitorInfo.value.unitName}`;
279
291
  } else if (
280
292
  visitorInfo.value &&
281
- visitorInfo.value.block &&
282
- !visitorInfo.value.level &&
293
+ visitorInfo.value.block?.name &&
294
+ !visitorInfo.value.level?.name &&
283
295
  !visitorInfo.value.unitName
284
296
  ) {
285
297
  return visitorInfo.value.block;
@@ -95,11 +95,8 @@ export default function usetFacility() {
95
95
  count: number;
96
96
  permanentRemarks: string;
97
97
  }[] = [];
98
- isBookingUnitLimitEnabled: boolean;
99
98
  bookingUnitLimit: number | null;
100
- isMaxNumberGuestLimitEnabled: boolean;
101
99
  maxNumberGuestLimit: number | null;
102
- isCancelAllowedLimitEnabled: boolean;
103
100
  daysAllowedCancel: number | null;
104
101
 
105
102
  constructor(
@@ -191,11 +188,8 @@ export default function usetFacility() {
191
188
  isBookingPolicyEnabled = false,
192
189
  bookingPolicy = "",
193
190
  securityCheckList = [],
194
- isBookingUnitLimitEnabled = false,
195
191
  bookingUnitLimit = null,
196
- isMaxNumberGuestLimitEnabled = false,
197
192
  maxNumberGuestLimit = null,
198
- isCancelAllowedLimitEnabled = false,
199
193
  daysAllowedCancel = null,
200
194
  } = {} as TFacility
201
195
  ) {
@@ -256,11 +250,8 @@ export default function usetFacility() {
256
250
  this.isCancellationAutoRefundEnabled = isCancellationAutoRefundEnabled;
257
251
  this.bookingPolicy = bookingPolicy;
258
252
  this.securityCheckList = securityCheckList ?? [];
259
- this.isBookingUnitLimitEnabled = isBookingUnitLimitEnabled || false;
260
253
  this.bookingUnitLimit = bookingUnitLimit ?? null;
261
- this.isMaxNumberGuestLimitEnabled = isMaxNumberGuestLimitEnabled || false;
262
254
  this.maxNumberGuestLimit = maxNumberGuestLimit ?? null;
263
- this.isCancelAllowedLimitEnabled = isCancelAllowedLimitEnabled || false;
264
255
  this.daysAllowedCancel = daysAllowedCancel ?? null;
265
256
  this.isBookingPolicyEnabled = isBookingPolicyEnabled || false;
266
257
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "3.0.2",
5
+ "version": "3.0.3",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "publishConfig": {
@@ -92,11 +92,8 @@ declare type TFacility = {
92
92
  count: number;
93
93
  permanentRemarks: string;
94
94
  }[];
95
- isBookingUnitLimitEnabled: boolean;
96
95
  bookingUnitLimit: number | null;
97
- isMaxNumberGuestLimitEnabled: boolean;
98
96
  maxNumberGuestLimit: number | null;
99
- isCancelAllowedLimitEnabled: boolean;
100
97
  daysAllowedCancel: number | null;
101
98
  isBookingPolicyEnabled: boolean;
102
99
  updatedBy?: string;
@@ -3,8 +3,14 @@ declare type TVisitor = {
3
3
  name?: string;
4
4
  type: TVisitorType;
5
5
  company?: string | "";
6
- block?: number | string;
7
- level?: string;
6
+ block?: {
7
+ name: string;
8
+ _id: string;
9
+ };
10
+ level?: {
11
+ name: string;
12
+ _id: string;
13
+ };
8
14
  unit?: string;
9
15
  unitName?: string; // only for display purpose
10
16
  contact: string;