@7365admin1/layer-common 1.11.9 → 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 +6 -0
- package/components/Avatar/Main.vue +1 -1
- package/components/VehicleForm.vue +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/package.json +1 -1
- package/types/payment.d.ts +51 -0
- package/types/qr-code-template.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
<v-col v-if="shouldShowField('nric')" cols="12">
|
|
56
56
|
<InputLabel class="text-capitalize" title="NRIC" required />
|
|
57
|
-
<InputNRICNumber v-model="vehicle.nric" density="comfortable" :rules="[requiredRule]"
|
|
57
|
+
<InputNRICNumber v-model="vehicle.nric" density="comfortable" :rules="[requiredRule]" />
|
|
58
58
|
</v-col>
|
|
59
59
|
|
|
60
60
|
<v-col v-if="shouldShowField('name')" cols="12">
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<v-col cols="12">
|
|
63
63
|
<InputLabel class="text-capitalize" title="Full Name" required />
|
|
64
64
|
<v-text-field v-model.trim="vehicle.name" density="comfortable" :rules="[requiredRule]"
|
|
65
|
-
|
|
65
|
+
/>
|
|
66
66
|
</v-col>
|
|
67
67
|
</v-row>
|
|
68
68
|
</v-col>
|
|
@@ -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({
|
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
|
+
};
|