@7365admin1/layer-common 1.11.8 → 1.11.10
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 +12 -0
- package/components/Avatar/Main.vue +1 -1
- package/components/EquipmentItemMain.vue +4 -1
- package/components/VehicleForm.vue +93 -61
- package/components/VehicleManagement.vue +3 -3
- package/composables/useEquipmentItem.ts +2 -1
- package/composables/useEquipmentManagement.ts +2 -2
- package/composables/useFacilityBookings.ts +3 -1
- package/composables/useKey.ts +6 -2
- package/composables/usePassKey.ts +6 -0
- package/composables/usePayment.ts +21 -3
- package/composables/useTemplateReusable.ts +41 -39
- package/composables/useVehicle.ts +2 -3
- package/package.json +1 -1
- package/types/equipment-item.d.ts +1 -0
- package/types/payment.d.ts +51 -0
- package/types/qr-code-template.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -449,6 +449,7 @@ import useUtils from "../composables/useUtils";
|
|
|
449
449
|
const props = defineProps({
|
|
450
450
|
orgId: { type: String, default: "" },
|
|
451
451
|
site: { type: String, default: "" },
|
|
452
|
+
serviceType: { type: String, default: "" },
|
|
452
453
|
});
|
|
453
454
|
|
|
454
455
|
const { canCreateEquipmentItem } = useEquipmentItemPermission();
|
|
@@ -492,6 +493,7 @@ const {
|
|
|
492
493
|
page: page.value,
|
|
493
494
|
search: searchInput.value,
|
|
494
495
|
site: props.site,
|
|
496
|
+
serviceType: props.serviceType,
|
|
495
497
|
}),
|
|
496
498
|
{
|
|
497
499
|
watch: [page, () => props.site],
|
|
@@ -557,6 +559,7 @@ const { data: getSuppliesReq } = await useLazyAsyncData(
|
|
|
557
559
|
getSupplies({
|
|
558
560
|
site: props.site,
|
|
559
561
|
limit: 100,
|
|
562
|
+
serviceType: props.serviceType,
|
|
560
563
|
}),
|
|
561
564
|
{}
|
|
562
565
|
);
|
|
@@ -661,7 +664,7 @@ async function _equipmentItem() {
|
|
|
661
664
|
: {}),
|
|
662
665
|
}));
|
|
663
666
|
|
|
664
|
-
await equipmentItemApi(props.site, { items });
|
|
667
|
+
await equipmentItemApi(props.site, { items, serviceType: props.serviceType });
|
|
665
668
|
|
|
666
669
|
showMessage(
|
|
667
670
|
`Checked out ${equipmentItems.value.length} item(s).`,
|
|
@@ -32,16 +32,37 @@
|
|
|
32
32
|
</v-combobox>
|
|
33
33
|
</v-col>
|
|
34
34
|
|
|
35
|
+
<v-col v-if="shouldShowField('block')" cols="12">
|
|
36
|
+
<InputLabel class="text-capitalize" title="Block" required />
|
|
37
|
+
<v-select v-model="vehicle.block" :items="blocksArray" item-value="value" item-title="title"
|
|
38
|
+
@update:model-value="handleChangeBlock" density="comfortable" :rules="[requiredRule]"
|
|
39
|
+
/>
|
|
40
|
+
</v-col>
|
|
41
|
+
|
|
42
|
+
<v-col v-if="shouldShowField('level')" cols="12">
|
|
43
|
+
<InputLabel class="text-capitalize" title="Level" required />
|
|
44
|
+
<v-select v-model="vehicle.level" :items="levelsArray" density="comfortable"
|
|
45
|
+
:disabled="!vehicle.block" @update:model-value="handleChangeLevel"
|
|
46
|
+
:rules="[requiredRule]" />
|
|
47
|
+
</v-col>
|
|
48
|
+
|
|
49
|
+
<v-col v-if="shouldShowField('unit')" cols="12">
|
|
50
|
+
<InputLabel class="text-capitalize" title="Unit" required />
|
|
51
|
+
<v-select v-model="vehicle.unit" :items="unitsArray" density="comfortable"
|
|
52
|
+
:disabled="!vehicle.level" :rules="[requiredRule]" />
|
|
53
|
+
</v-col>
|
|
54
|
+
|
|
35
55
|
<v-col v-if="shouldShowField('nric')" cols="12">
|
|
36
56
|
<InputLabel class="text-capitalize" title="NRIC" required />
|
|
37
|
-
<InputNRICNumber v-model="vehicle.nric" density="comfortable" :rules="[requiredRule]"
|
|
57
|
+
<InputNRICNumber v-model="vehicle.nric" density="comfortable" :rules="[requiredRule]" />
|
|
38
58
|
</v-col>
|
|
39
59
|
|
|
40
60
|
<v-col v-if="shouldShowField('name')" cols="12">
|
|
41
61
|
<v-row>
|
|
42
62
|
<v-col cols="12">
|
|
43
63
|
<InputLabel class="text-capitalize" title="Full Name" required />
|
|
44
|
-
<v-text-field v-model.trim="vehicle.name" density="comfortable" :rules="[requiredRule]"
|
|
64
|
+
<v-text-field v-model.trim="vehicle.name" density="comfortable" :rules="[requiredRule]"
|
|
65
|
+
/>
|
|
45
66
|
</v-col>
|
|
46
67
|
</v-row>
|
|
47
68
|
</v-col>
|
|
@@ -50,36 +71,16 @@
|
|
|
50
71
|
|
|
51
72
|
<v-col v-if="shouldShowField('phone')" cols="12">
|
|
52
73
|
<InputLabel class="text-capitalize" title="Phone Number" required />
|
|
53
|
-
<InputPhoneNumberV2 v-model="vehicle.phoneNumber" density="comfortable" :rules="[requiredRule]"
|
|
54
|
-
:disabled="disablePrefilledInputs" />
|
|
55
|
-
</v-col>
|
|
56
|
-
|
|
57
|
-
<v-col v-if="shouldShowField('block')" cols="12">
|
|
58
|
-
<InputLabel class="text-capitalize" title="Block" required />
|
|
59
|
-
<v-select v-model="vehicle.block" :items="blocksArray" item-value="value" item-title="title"
|
|
60
|
-
@update:model-value="handleChangeBlock" density="comfortable" :rules="[requiredRule]"
|
|
61
|
-
:disabled="disablePrefilledInputs" />
|
|
62
|
-
</v-col>
|
|
63
|
-
|
|
64
|
-
<v-col v-if="shouldShowField('level')" cols="12">
|
|
65
|
-
<InputLabel class="text-capitalize" title="Level" required />
|
|
66
|
-
<v-select v-model="vehicle.level" :items="levelsArray" density="comfortable"
|
|
67
|
-
:disabled="!vehicle.block || disablePrefilledInputs" @update:model-value="handleChangeLevel"
|
|
68
|
-
:rules="[requiredRule]" />
|
|
69
|
-
</v-col>
|
|
70
|
-
|
|
71
|
-
<v-col v-if="shouldShowField('unit')" cols="12">
|
|
72
|
-
<InputLabel class="text-capitalize" title="Unit" required />
|
|
73
|
-
<v-select v-model="vehicle.unit" :items="unitsArray" density="comfortable"
|
|
74
|
-
:disabled="!vehicle.level || disablePrefilledInputs" :rules="[requiredRule]" />
|
|
74
|
+
<InputPhoneNumberV2 v-model="vehicle.phoneNumber" density="comfortable" :rules="[requiredRule]" />
|
|
75
75
|
</v-col>
|
|
76
76
|
|
|
77
77
|
<v-col v-if="shouldShowField('plateNumber')" cols="12">
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
<!-- <v-text-field v-model="vehicle.plateNumber" density="comfortable" :rules="[requiredRule]" /> -->
|
|
80
80
|
<template v-for="plate in vehicle.plates" :key="plate.plateNumber">
|
|
81
|
+
<InputLabel class="text-capitalize" title="Existing Vehicle Numbers" required />
|
|
81
82
|
<v-text-field v-model="plate.plateNumber" density="comfortable" :rules="[requiredRule]" class="mb-2"
|
|
82
|
-
readonly>
|
|
83
|
+
readonly disabled>
|
|
83
84
|
<template #append-inner>
|
|
84
85
|
<v-chip size="small" class="ma-0" :color="formatVehicleStatus(plate?.status)?.color as string">{{
|
|
85
86
|
formatVehicleStatus(plate?.status)?.label }}</v-chip>
|
|
@@ -87,11 +88,12 @@
|
|
|
87
88
|
</v-text-field>
|
|
88
89
|
</template>
|
|
89
90
|
|
|
91
|
+
<InputLabel class="text-capitalize" title="New Vehicle Numbers" required />
|
|
90
92
|
<template v-for="(plate, index) in newPlateNumbers" :key="index">
|
|
91
93
|
<v-row class="" :class="`${index === newPlateNumbers.length - 1 ? 'mb-1' : 'mb-5'}`" no-gutters>
|
|
92
94
|
<v-col :cols="newPlateNumbers.length > 1 ? '11' : '12'">
|
|
93
95
|
<InputVehicleNumber v-model="newPlateNumbers[index]" density="comfortable"
|
|
94
|
-
placeholder="New Vehicle Number" :rules="[requiredRule]"
|
|
96
|
+
placeholder="New Vehicle Number" :rules="[requiredRule]" />
|
|
95
97
|
</v-col>
|
|
96
98
|
|
|
97
99
|
<v-col :cols="newPlateNumbers.length > 1 ? '1' : '0'" class="d-flex align-start">
|
|
@@ -114,7 +116,7 @@
|
|
|
114
116
|
<v-col v-if="shouldShowField('start')" cols="12">
|
|
115
117
|
<v-expand-transition v-if="showSubscriptionDateOptions">
|
|
116
118
|
<v-row no-gutters>
|
|
117
|
-
<v-row dense justify="space-between">
|
|
119
|
+
<!-- <v-row dense justify="space-between">
|
|
118
120
|
<template v-for="option in subscriptionOptions" :key="option.value">
|
|
119
121
|
<v-col cols="4">
|
|
120
122
|
<v-btn :text="option.label" class="text-capitalize" min-width="120" :ripple="false"
|
|
@@ -123,7 +125,7 @@
|
|
|
123
125
|
</v-col>
|
|
124
126
|
|
|
125
127
|
</template>
|
|
126
|
-
</v-row>
|
|
128
|
+
</v-row> -->
|
|
127
129
|
|
|
128
130
|
<v-row no-gutters class="mt-5">
|
|
129
131
|
<v-col cols="12">
|
|
@@ -187,7 +189,7 @@
|
|
|
187
189
|
<v-toolbar-title>
|
|
188
190
|
<v-row no-gutters class="d-flex align-center justify-space-between">
|
|
189
191
|
<span class="font-weight-bold">
|
|
190
|
-
Matching Records for
|
|
192
|
+
Matching Records for "{{ searchUnitName ?? "-" }}"
|
|
191
193
|
</span>
|
|
192
194
|
<span>
|
|
193
195
|
<v-btn v-if="matchingPeople.length === 0" icon="mdi-close" variant="text"
|
|
@@ -200,14 +202,14 @@
|
|
|
200
202
|
<v-card-text>
|
|
201
203
|
|
|
202
204
|
<v-list lines="three">
|
|
203
|
-
<v-list-item v-if="matchingPeople.length > 0 ||
|
|
205
|
+
<v-list-item v-if="matchingPeople.length > 0 || checkingUnit" v-for="v in matchingPeople" :key="v._id"
|
|
204
206
|
class="cursor-pointer">
|
|
205
207
|
<v-list-item-title>
|
|
206
208
|
{{ v.name }}
|
|
207
209
|
</v-list-item-title>
|
|
208
210
|
|
|
209
211
|
<v-list-item-subtitle>
|
|
210
|
-
|
|
212
|
+
NRIC: {{ v.nric || "-" }}
|
|
211
213
|
</v-list-item-subtitle>
|
|
212
214
|
|
|
213
215
|
<div class="mt-1">
|
|
@@ -217,7 +219,7 @@
|
|
|
217
219
|
</div>
|
|
218
220
|
|
|
219
221
|
<template #append>
|
|
220
|
-
<v-btn variant="flat" color="primary" @click="
|
|
222
|
+
<v-btn variant="flat" color="primary" @click="selectPeopleRecord(v)">Select</v-btn>
|
|
221
223
|
</template>
|
|
222
224
|
|
|
223
225
|
</v-list-item>
|
|
@@ -266,7 +268,7 @@ const prop = defineProps({
|
|
|
266
268
|
const { requiredRule, formatDateISO8601, debounce } = useUtils();
|
|
267
269
|
const { addVehicle, getCustomSeasonPassTypes, updateVehicle, formatVehicleStatus } = useVehicle();
|
|
268
270
|
const { getSiteById, getSiteLevels, getSiteUnits } = useSiteSettings();
|
|
269
|
-
const { findPersonByNRICMultipleResult } = usePeople();
|
|
271
|
+
const { findPersonByNRICMultipleResult, getPeopleByUnit } = usePeople();
|
|
270
272
|
|
|
271
273
|
const emit = defineEmits(['back', 'select', 'done', 'error', 'close', 'close:all']);
|
|
272
274
|
|
|
@@ -291,7 +293,7 @@ const vehicle = reactive<Omit<ExceptPartial<TVehicle>, 'type'> & { type: TVehicl
|
|
|
291
293
|
});
|
|
292
294
|
|
|
293
295
|
const newPlateNumbers = ref<string[]>(['']);
|
|
294
|
-
const disablePrefilledInputs = ref(
|
|
296
|
+
const disablePrefilledInputs = ref(true);
|
|
295
297
|
|
|
296
298
|
const blocksArray = ref<TDefaultOptionObj[]>([]);
|
|
297
299
|
const levelsArray = ref<TDefaultOptionObj[]>([]);
|
|
@@ -301,6 +303,7 @@ const seasonPassTypeArray = ref<{ title: string, value: string }[]>([]);
|
|
|
301
303
|
const matchingPeople = ref<Partial<TPeople>[]>([]);
|
|
302
304
|
const showMatchingPeopleDialog = ref(false);
|
|
303
305
|
const checkingNRIC = ref(false);
|
|
306
|
+
const checkingUnit = ref(false);
|
|
304
307
|
|
|
305
308
|
const defaultSeasonPassTypeArray = computed(() => {
|
|
306
309
|
return [
|
|
@@ -329,6 +332,11 @@ const shouldShowField = (fieldKey: string): boolean => {
|
|
|
329
332
|
};
|
|
330
333
|
|
|
331
334
|
|
|
335
|
+
const searchUnitName = computed(() => {
|
|
336
|
+
return unitsArray.value.find(u => u.value === vehicle.unit)?.title || vehicle.unit;
|
|
337
|
+
})
|
|
338
|
+
|
|
339
|
+
|
|
332
340
|
const validForm = ref(false);
|
|
333
341
|
const seasonPassTypeInput = ref('')
|
|
334
342
|
const formRef = ref<HTMLFormElement | null>(null);
|
|
@@ -636,36 +644,62 @@ watch([() => vehicle.end, () => vehicle.start], () => {
|
|
|
636
644
|
});
|
|
637
645
|
|
|
638
646
|
|
|
639
|
-
function
|
|
647
|
+
function selectPeopleRecord(record: TPeople) {
|
|
640
648
|
|
|
641
649
|
vehicle.name = record.name;
|
|
642
650
|
vehicle.phoneNumber = record.contact;
|
|
643
|
-
vehicle.
|
|
644
|
-
vehicle.level = record.level;
|
|
645
|
-
vehicle.unit = record.unit;
|
|
646
|
-
|
|
651
|
+
vehicle.nric = record.nric;
|
|
647
652
|
vehicle.plates = record.plates || [];
|
|
648
|
-
|
|
649
653
|
disablePrefilledInputs.value = true;
|
|
650
654
|
showMatchingPeopleDialog.value = false;
|
|
651
|
-
|
|
652
|
-
refreshLevelsData();
|
|
653
|
-
refreshUnitsData();
|
|
654
655
|
}
|
|
655
656
|
|
|
656
657
|
|
|
657
|
-
async function checkNRIC() {
|
|
658
|
-
|
|
658
|
+
// async function checkNRIC() {
|
|
659
|
+
// if (!vehicle.nric || vehicle.nric.length < 5) return;
|
|
660
|
+
|
|
661
|
+
// checkingNRIC.value = true;
|
|
662
|
+
// showMatchingPeopleDialog.value = true;
|
|
663
|
+
// // Lock editable fields while we verify if this NRIC has existing records.
|
|
664
|
+
// disablePrefilledInputs.value = true;
|
|
665
|
+
// try {
|
|
666
|
+
// const res = await findPersonByNRICMultipleResult(vehicle.nric, prop.site) as { items: TPeople[] } | null;
|
|
667
|
+
|
|
668
|
+
// if (res?.items && res.items.length > 0) {
|
|
669
|
+
// matchingPeople.value = res.items || []
|
|
670
|
+
// // Force selection from matched records.
|
|
671
|
+
// disablePrefilledInputs.value = true;
|
|
672
|
+
// } else {
|
|
673
|
+
// matchingPeople.value = [];
|
|
674
|
+
// // No match found, allow manual input.
|
|
675
|
+
// disablePrefilledInputs.value = false;
|
|
676
|
+
// }
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
// } catch (error) {
|
|
680
|
+
// console.error("NRIC search failed:", error);
|
|
681
|
+
// disablePrefilledInputs.value = false;
|
|
682
|
+
// } finally {
|
|
683
|
+
// checkingNRIC.value = false;
|
|
684
|
+
// }
|
|
685
|
+
// }
|
|
686
|
+
|
|
687
|
+
// const debounceedCheckNRIC = debounce(checkNRIC, 500);
|
|
688
|
+
|
|
689
|
+
|
|
659
690
|
|
|
660
|
-
|
|
691
|
+
async function checkPeopleById() {
|
|
692
|
+
if (!vehicle.unit) return;
|
|
693
|
+
|
|
694
|
+
checkingUnit.value = true;
|
|
661
695
|
showMatchingPeopleDialog.value = true;
|
|
662
696
|
// Lock editable fields while we verify if this NRIC has existing records.
|
|
663
697
|
disablePrefilledInputs.value = true;
|
|
664
698
|
try {
|
|
665
|
-
const res = await
|
|
699
|
+
const res = await getPeopleByUnit(vehicle.unit) as TPeople[]| null;
|
|
666
700
|
|
|
667
|
-
if (res
|
|
668
|
-
matchingPeople.value = res
|
|
701
|
+
if (Array.isArray(res) && res.length > 0) {
|
|
702
|
+
matchingPeople.value = res || []
|
|
669
703
|
// Force selection from matched records.
|
|
670
704
|
disablePrefilledInputs.value = true;
|
|
671
705
|
} else {
|
|
@@ -676,23 +710,23 @@ async function checkNRIC() {
|
|
|
676
710
|
|
|
677
711
|
|
|
678
712
|
} catch (error) {
|
|
679
|
-
console.error("
|
|
680
|
-
disablePrefilledInputs.value = false;
|
|
713
|
+
console.error("Unit search failed:", error);
|
|
714
|
+
// disablePrefilledInputs.value = false;
|
|
681
715
|
} finally {
|
|
682
|
-
|
|
716
|
+
checkingUnit.value = false;
|
|
683
717
|
}
|
|
684
718
|
}
|
|
685
719
|
|
|
686
|
-
const
|
|
720
|
+
const debounceedCheckUnit = debounce(checkPeopleById, 500);
|
|
687
721
|
|
|
688
722
|
watch(
|
|
689
|
-
() => vehicle.
|
|
690
|
-
async (
|
|
723
|
+
() => vehicle.unit,
|
|
724
|
+
async (newUnit) => {
|
|
691
725
|
resetVehicleDetails();
|
|
692
726
|
matchingPeople.value = [];
|
|
693
|
-
if (!
|
|
727
|
+
if (!newUnit) return;
|
|
694
728
|
|
|
695
|
-
|
|
729
|
+
debounceedCheckUnit();
|
|
696
730
|
}
|
|
697
731
|
);
|
|
698
732
|
|
|
@@ -700,10 +734,8 @@ watch(
|
|
|
700
734
|
const resetVehicleDetails = () => {
|
|
701
735
|
vehicle.name = '';
|
|
702
736
|
vehicle.phoneNumber = '';
|
|
703
|
-
vehicle.block = '';
|
|
704
|
-
vehicle.level = '';
|
|
705
|
-
vehicle.unit = '';
|
|
706
737
|
vehicle.plates = [];
|
|
738
|
+
vehicle.nric = '';
|
|
707
739
|
disablePrefilledInputs.value = false;
|
|
708
740
|
}
|
|
709
741
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
:org="org" :site="site" @close:all="handleCloseAll" />
|
|
48
48
|
</v-dialog> -->
|
|
49
49
|
|
|
50
|
-
<v-dialog v-if="canViewVehicleDetails" v-model="dialog.showMoreActions" width="
|
|
50
|
+
<v-dialog v-if="canViewVehicleDetails" v-model="dialog.showMoreActions" width="800" persistent>
|
|
51
51
|
<DialogUpdateMoreAction title="Preview" :can-update="false" :can-delete="false"
|
|
52
52
|
@close="dialog.showMoreActions = false">
|
|
53
53
|
<template v-slot:content>
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
<v-btn text="Add Vehicle Number" class="mt-6 text-capitalize" prepend-icon="mdi-plus"
|
|
75
75
|
@click="addNewPlateNumbers" color="primary" />
|
|
76
76
|
</v-card>
|
|
77
|
-
</v-col
|
|
77
|
+
</v-col>
|
|
78
78
|
|
|
79
79
|
</v-col>
|
|
80
80
|
|
|
@@ -240,7 +240,7 @@ const selectedVehicleObject = computed(() => {
|
|
|
240
240
|
|
|
241
241
|
const { data: getVehiclesReq, refresh: getVehiclesRefresh, pending: getVehiclesPending } =
|
|
242
242
|
await useLazyAsyncData(
|
|
243
|
-
|
|
243
|
+
`get-all-vehicles-${props.site}`,
|
|
244
244
|
() =>
|
|
245
245
|
getVehicles({
|
|
246
246
|
page: page.value,
|
|
@@ -4,12 +4,13 @@ export default function useEquipmentItem() {
|
|
|
4
4
|
search = "",
|
|
5
5
|
limit = 10,
|
|
6
6
|
site = "",
|
|
7
|
+
serviceType = "",
|
|
7
8
|
} = {}) {
|
|
8
9
|
return useNuxtApp().$api<Record<string, any>>(
|
|
9
10
|
`/api/hygiene-checkout-items/site/${site}`,
|
|
10
11
|
{
|
|
11
12
|
method: "GET",
|
|
12
|
-
query: { page, search, limit, site },
|
|
13
|
+
query: { page, search, limit, site, serviceType },
|
|
13
14
|
},
|
|
14
15
|
);
|
|
15
16
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export default function useEquipmentManagement() {
|
|
2
|
-
function getSupplies({ page = 1, search = "", limit = 10, site = "" } = {}) {
|
|
2
|
+
function getSupplies({ page = 1, search = "", limit = 10, site = "", serviceType = "" } = {}) {
|
|
3
3
|
return useNuxtApp().$api<Record<string, any>>(
|
|
4
4
|
`/api/hygiene-supplies/site/${site}`,
|
|
5
5
|
{
|
|
6
6
|
method: "GET",
|
|
7
|
-
query: { page, search, limit, site },
|
|
7
|
+
query: { page, search, limit, site, serviceType },
|
|
8
8
|
}
|
|
9
9
|
);
|
|
10
10
|
}
|
|
@@ -254,17 +254,19 @@ export default function useFacilityBookings() {
|
|
|
254
254
|
remarks = "",
|
|
255
255
|
status = "",
|
|
256
256
|
site = "",
|
|
257
|
+
userType,
|
|
257
258
|
updatedBy,
|
|
258
259
|
}: {
|
|
259
260
|
_ids?: string[];
|
|
260
261
|
remarks?: string;
|
|
261
262
|
status?: string;
|
|
262
263
|
site?: string;
|
|
264
|
+
userType?: string;
|
|
263
265
|
updatedBy?: string;
|
|
264
266
|
}) {
|
|
265
267
|
return useNuxtApp().$api("/api/facilities-booking/update-booking/v1", {
|
|
266
268
|
method: "POST",
|
|
267
|
-
body: { _ids, remarks, status, site, updatedBy },
|
|
269
|
+
body: { _ids, remarks, status, site, userType, updatedBy },
|
|
268
270
|
});
|
|
269
271
|
}
|
|
270
272
|
|
package/composables/useKey.ts
CHANGED
|
@@ -331,16 +331,20 @@ export default function useKey() {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
async function getKeyWithSequence(
|
|
334
|
-
{ site, _id } = {} as {
|
|
334
|
+
{ site, _id, userType, updatedBy } = {} as {
|
|
335
335
|
site?: string;
|
|
336
336
|
_id?: string;
|
|
337
|
+
userType?: string;
|
|
338
|
+
updatedBy?: string;
|
|
337
339
|
}
|
|
338
340
|
) {
|
|
339
341
|
const response = useNuxtApp().$api<TKeyLog[]>(keyLogApiUrl, {
|
|
340
342
|
method: "PUT",
|
|
341
|
-
|
|
343
|
+
body: {
|
|
342
344
|
site,
|
|
343
345
|
_id,
|
|
346
|
+
userType,
|
|
347
|
+
updatedBy,
|
|
344
348
|
},
|
|
345
349
|
});
|
|
346
350
|
keyList.value = response;
|
|
@@ -228,12 +228,16 @@ export default function usePassKey() {
|
|
|
228
228
|
site = "",
|
|
229
229
|
quantity = 0,
|
|
230
230
|
nextNumber = 0,
|
|
231
|
+
userType,
|
|
232
|
+
updatedBy,
|
|
231
233
|
} = {} as {
|
|
232
234
|
template?: any | null;
|
|
233
235
|
passType?: any | null;
|
|
234
236
|
site?: any;
|
|
235
237
|
quantity?: number | null;
|
|
236
238
|
nextNumber: number;
|
|
239
|
+
userType?: string;
|
|
240
|
+
updatedBy?: string;
|
|
237
241
|
}
|
|
238
242
|
) {
|
|
239
243
|
return useNuxtApp().$api("/api/keys/generate/v1", {
|
|
@@ -244,6 +248,8 @@ export default function usePassKey() {
|
|
|
244
248
|
site,
|
|
245
249
|
quantity,
|
|
246
250
|
nextNumber,
|
|
251
|
+
userType,
|
|
252
|
+
updatedBy,
|
|
247
253
|
},
|
|
248
254
|
});
|
|
249
255
|
}
|
|
@@ -168,9 +168,25 @@ export default function useRedDot() {
|
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
function createRDPAccount(payload: TReddotCreateAccount) {
|
|
172
|
+
return useNuxtApp().$api("/api/payment-gateways/v1", {
|
|
173
|
+
method: "POST",
|
|
174
|
+
body: payload,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function getBySiteTypeMethod(
|
|
179
|
+
site: string,
|
|
180
|
+
paymentType: string,
|
|
181
|
+
paymentMethod: string,
|
|
182
|
+
userType: string
|
|
183
|
+
) {
|
|
184
|
+
const payload = { site, paymentType, paymentMethod, userType };
|
|
185
|
+
return useNuxtApp().$api("/api/payment-gateways/get/v1", {
|
|
186
|
+
method: "POST",
|
|
187
|
+
body: payload,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
174
190
|
|
|
175
191
|
return {
|
|
176
192
|
item,
|
|
@@ -187,5 +203,7 @@ export default function useRedDot() {
|
|
|
187
203
|
getMerchantDetailsById,
|
|
188
204
|
getCartById,
|
|
189
205
|
cancelCart,
|
|
206
|
+
createRDPAccount,
|
|
207
|
+
getBySiteTypeMethod,
|
|
190
208
|
};
|
|
191
209
|
}
|
|
@@ -7,6 +7,7 @@ export default function useTemplateReusable() {
|
|
|
7
7
|
updatedBy?: string;
|
|
8
8
|
site: string;
|
|
9
9
|
status?: string;
|
|
10
|
+
userType?: string;
|
|
10
11
|
A4Enabled?: boolean;
|
|
11
12
|
A4Orientation?: string;
|
|
12
13
|
A4FrontWysiwyg?: string;
|
|
@@ -55,6 +56,7 @@ export default function useTemplateReusable() {
|
|
|
55
56
|
updatedBy,
|
|
56
57
|
site,
|
|
57
58
|
status = "",
|
|
59
|
+
userType,
|
|
58
60
|
A4Enabled = false,
|
|
59
61
|
A4Orientation = "portrait",
|
|
60
62
|
A4FrontWysiwyg = "",
|
|
@@ -93,7 +95,7 @@ export default function useTemplateReusable() {
|
|
|
93
95
|
CCBackQREnabled = false,
|
|
94
96
|
CCFrontQREnabled = false,
|
|
95
97
|
// prefixKey = "",
|
|
96
|
-
} = {} as TQrCodeTemplate
|
|
98
|
+
} = {} as TQrCodeTemplate
|
|
97
99
|
) {
|
|
98
100
|
this._id = _id;
|
|
99
101
|
this.name = name;
|
|
@@ -102,6 +104,7 @@ export default function useTemplateReusable() {
|
|
|
102
104
|
this.updatedBy = updatedBy;
|
|
103
105
|
this.site = site;
|
|
104
106
|
this.status = status;
|
|
107
|
+
this.userType = userType;
|
|
105
108
|
this.A4Enabled = A4Enabled;
|
|
106
109
|
this.A4Orientation = A4Orientation;
|
|
107
110
|
this.A4FrontWysiwyg = A4FrontWysiwyg;
|
|
@@ -145,11 +148,11 @@ export default function useTemplateReusable() {
|
|
|
145
148
|
const tab = useState("templatesTab", () => "active");
|
|
146
149
|
const templateQrCode = useState(
|
|
147
150
|
"templateQrCode",
|
|
148
|
-
() => new MQrCodeTemplate()
|
|
151
|
+
() => new MQrCodeTemplate()
|
|
149
152
|
);
|
|
150
153
|
const templateQrCodes = useState(
|
|
151
154
|
"templateQrCodes",
|
|
152
|
-
(): TQrCodeTemplate[] => []
|
|
155
|
+
(): TQrCodeTemplate[] => []
|
|
153
156
|
);
|
|
154
157
|
const page = useState("templatesPage", () => 1);
|
|
155
158
|
const pages = useState("templatesPages", () => 0);
|
|
@@ -166,7 +169,7 @@ export default function useTemplateReusable() {
|
|
|
166
169
|
templateQrCode.value = data || new MQrCodeTemplate();
|
|
167
170
|
}
|
|
168
171
|
|
|
169
|
-
|
|
172
|
+
function setTemplates(
|
|
170
173
|
{
|
|
171
174
|
_id,
|
|
172
175
|
sites,
|
|
@@ -181,11 +184,11 @@ export default function useTemplateReusable() {
|
|
|
181
184
|
name?: string;
|
|
182
185
|
statuses?: string[];
|
|
183
186
|
//date?: any;
|
|
184
|
-
}
|
|
187
|
+
}
|
|
185
188
|
) {
|
|
186
189
|
try {
|
|
187
190
|
isTemplatesLoading.value = true;
|
|
188
|
-
const _templateQrCodes: any =
|
|
191
|
+
const _templateQrCodes: any = getTemplatesByPageSearch({
|
|
189
192
|
_id,
|
|
190
193
|
page: page.value,
|
|
191
194
|
search: search,
|
|
@@ -207,7 +210,7 @@ export default function useTemplateReusable() {
|
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
|
|
210
|
-
|
|
213
|
+
function getTemplatesByPageSearch({
|
|
211
214
|
_id = "",
|
|
212
215
|
page = 1,
|
|
213
216
|
search = "",
|
|
@@ -215,8 +218,8 @@ export default function useTemplateReusable() {
|
|
|
215
218
|
limit = 10,
|
|
216
219
|
sites = [],
|
|
217
220
|
statuses = [],
|
|
218
|
-
|
|
219
|
-
|
|
221
|
+
}: //date = "",
|
|
222
|
+
{
|
|
220
223
|
_id?: string;
|
|
221
224
|
page?: number;
|
|
222
225
|
search?: string;
|
|
@@ -226,44 +229,43 @@ export default function useTemplateReusable() {
|
|
|
226
229
|
statuses?: string[];
|
|
227
230
|
//date?: any;
|
|
228
231
|
}) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
232
|
+
return useNuxtApp().$api("/api/qr-code-templates/v1", {
|
|
233
|
+
method: "PATCH",
|
|
234
|
+
body: {
|
|
235
|
+
_id,
|
|
236
|
+
page,
|
|
237
|
+
search,
|
|
238
|
+
name,
|
|
239
|
+
limit,
|
|
240
|
+
sites,
|
|
241
|
+
statuses,
|
|
242
|
+
},
|
|
243
|
+
});
|
|
241
244
|
}
|
|
242
245
|
|
|
243
246
|
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
244
247
|
|
|
245
|
-
|
|
248
|
+
function getTemplatesByPageSearchReusable({
|
|
246
249
|
dataArgument,
|
|
247
250
|
method = "GET",
|
|
248
251
|
}: {
|
|
249
252
|
dataArgument: any;
|
|
250
253
|
method?: HttpMethod;
|
|
251
254
|
}) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
return useNuxtApp().$api("/api/qr-code-templates/v1", {
|
|
256
|
+
method,
|
|
257
|
+
body: dataArgument,
|
|
258
|
+
});
|
|
256
259
|
}
|
|
257
260
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
function addQrCodeTemplate(templateQrCode: TQrCodeTemplate) {
|
|
262
|
+
return useNuxtApp().$api("/api/qr-code-templates/v1", {
|
|
263
|
+
method: "POST",
|
|
264
|
+
body: JSON.stringify(new MQrCodeTemplate(templateQrCode)),
|
|
265
|
+
});
|
|
264
266
|
}
|
|
265
267
|
|
|
266
|
-
|
|
268
|
+
function updateTemplateStatus({
|
|
267
269
|
_id,
|
|
268
270
|
site,
|
|
269
271
|
status,
|
|
@@ -272,10 +274,10 @@ export default function useTemplateReusable() {
|
|
|
272
274
|
site?: string;
|
|
273
275
|
status?: string;
|
|
274
276
|
}) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
return useNuxtApp().$api("/api/qr-code-templates/v1", {
|
|
278
|
+
method: "PUT",
|
|
279
|
+
body: { _id, site, status },
|
|
280
|
+
});
|
|
279
281
|
}
|
|
280
282
|
|
|
281
283
|
function nextPage(
|
|
@@ -289,7 +291,7 @@ export default function useTemplateReusable() {
|
|
|
289
291
|
search?: string;
|
|
290
292
|
|
|
291
293
|
statuses?: string[];
|
|
292
|
-
}
|
|
294
|
+
}
|
|
293
295
|
) {
|
|
294
296
|
page.value++;
|
|
295
297
|
setTemplates({
|
|
@@ -311,7 +313,7 @@ export default function useTemplateReusable() {
|
|
|
311
313
|
search?: string;
|
|
312
314
|
|
|
313
315
|
statuses?: string[];
|
|
314
|
-
}
|
|
316
|
+
}
|
|
315
317
|
) {
|
|
316
318
|
page.value--;
|
|
317
319
|
setTemplates({
|
|
@@ -3,14 +3,13 @@ export default function useVehicle() {
|
|
|
3
3
|
search = "",
|
|
4
4
|
page = 1,
|
|
5
5
|
limit = 10,
|
|
6
|
-
|
|
7
|
-
order = "",
|
|
6
|
+
order = "desc",
|
|
8
7
|
type = "",
|
|
9
8
|
category = "",
|
|
10
9
|
} = {}) {
|
|
11
10
|
return await useNuxtApp().$api<Record<string, any>>("/api/vehicles", {
|
|
12
11
|
method: "GET",
|
|
13
|
-
query: { search, page, limit,
|
|
12
|
+
query: { search, page, limit, order, type, category },
|
|
14
13
|
});
|
|
15
14
|
}
|
|
16
15
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
declare interface TPayment extends IBaseModel {
|
|
2
|
+
orderId: string;
|
|
3
|
+
amount: number;
|
|
4
|
+
googlePayToken: any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare type TStripeCreateAccount = {
|
|
8
|
+
country: string;
|
|
9
|
+
email: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
declare type TStripeCreateAccountResponse = {
|
|
13
|
+
accountLink: any;
|
|
14
|
+
accountId: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare interface TPaymentRequest {
|
|
18
|
+
apiVersion: number;
|
|
19
|
+
apiVersionMinor: number;
|
|
20
|
+
allowedPaymentMethods: [
|
|
21
|
+
{
|
|
22
|
+
type: string;
|
|
23
|
+
parameters: {
|
|
24
|
+
allowedAuthMethods: string[];
|
|
25
|
+
allowedCardNetworks: string[];
|
|
26
|
+
};
|
|
27
|
+
tokenizationSpecification: {
|
|
28
|
+
type: string;
|
|
29
|
+
parameters: {
|
|
30
|
+
gateway: string;
|
|
31
|
+
gatewayMerchantId: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
merchantInfo: {
|
|
37
|
+
merchantId: string;
|
|
38
|
+
merchantName: string;
|
|
39
|
+
};
|
|
40
|
+
transactionInfo: {
|
|
41
|
+
totalPriceStatus: string;
|
|
42
|
+
totalPrice: number;
|
|
43
|
+
currencyCode: string;
|
|
44
|
+
countryCode: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare type TReddotCreateAccount = {
|
|
49
|
+
merchant_id: string;
|
|
50
|
+
secret_key: string;
|
|
51
|
+
};
|