tango-app-api-trax 3.6.0-sec-3 → 3.6.0-sec-4
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/package.json
CHANGED
|
@@ -159,7 +159,11 @@ export async function startChecklist( req, res ) {
|
|
|
159
159
|
currentDateTime = dayjs();
|
|
160
160
|
}
|
|
161
161
|
} else {
|
|
162
|
-
|
|
162
|
+
if ( requestData.currentTime && requestData.currentTime !='' ) {
|
|
163
|
+
currentDateTime = requestData?.currentTime ? dayjs( requestData.currentTime, 'HH:mm:ss' ) : dayjs();
|
|
164
|
+
} else {
|
|
165
|
+
currentDateTime = dayjs();
|
|
166
|
+
}
|
|
163
167
|
}
|
|
164
168
|
updateData.checklistStatus = 'inprogress';
|
|
165
169
|
updateData.startMobileTime = requestData?.currentTime;
|
|
@@ -343,13 +347,29 @@ export async function startTask( req, res ) {
|
|
|
343
347
|
}
|
|
344
348
|
}
|
|
345
349
|
|
|
346
|
-
const storeTimeZone = await storeService.findOne(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
);
|
|
350
|
-
const currentDateTime = storeTimeZone?.storeProfile?.timeZone ?
|
|
351
|
-
|
|
352
|
-
|
|
350
|
+
// const storeTimeZone = await storeService.findOne(
|
|
351
|
+
// { storeName: task.storeName },
|
|
352
|
+
// { 'storeProfile.timeZone': 1 },
|
|
353
|
+
// );
|
|
354
|
+
// const currentDateTime = storeTimeZone?.storeProfile?.timeZone ?
|
|
355
|
+
// dayjs().tz( storeTimeZone.storeProfile.timeZone ) :
|
|
356
|
+
// dayjs();
|
|
357
|
+
|
|
358
|
+
let currentDateTime;
|
|
359
|
+
if ( getBeforeTask[0].storeName && getBeforeTask[0].storeName!='' ) {
|
|
360
|
+
let storeTimeZone = await storeService.findOne( { storeName: { $regex: getBeforeTask[0].storeName, $options: 'i' }, clientId: getBeforeTask[0].client_id }, { 'storeProfile.timeZone': 1 } );
|
|
361
|
+
if ( storeTimeZone?.storeProfile?.timeZone ) {
|
|
362
|
+
currentDateTime = dayjs().tz( storeTimeZone?.storeProfile?.timeZone );
|
|
363
|
+
} else {
|
|
364
|
+
currentDateTime = dayjs();
|
|
365
|
+
}
|
|
366
|
+
} else {
|
|
367
|
+
if ( requestData.currentTime && requestData.currentTime !='' ) {
|
|
368
|
+
currentDateTime = requestData?.currentTime ? dayjs( requestData.currentTime, 'HH:mm:ss' ) : dayjs();
|
|
369
|
+
} else {
|
|
370
|
+
currentDateTime = dayjs();
|
|
371
|
+
}
|
|
372
|
+
}
|
|
353
373
|
|
|
354
374
|
const updateData = {
|
|
355
375
|
checklistStatus: 'inprogress',
|
|
@@ -140,6 +140,7 @@ export const mobileChecklistValidation = {
|
|
|
140
140
|
export const startSchema = joi.object( {
|
|
141
141
|
date: joi.string().required(),
|
|
142
142
|
processedcheckListId: joi.string().required(),
|
|
143
|
+
currentTime: joi.string().optional().allow( '' ),
|
|
143
144
|
} );
|
|
144
145
|
|
|
145
146
|
export const startValidation = {
|