tango-app-api-trax 3.2.1-beta-7 → 3.2.1-beta-9
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
|
@@ -149,7 +149,7 @@ export async function startChecklist( req, res ) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
let updateData = {};
|
|
152
|
-
let storeTimeZone = await storeService.findOne( { storeName: getBeforeChecklist[0].storeName }, { 'storeProfile.timeZone': 1 } );
|
|
152
|
+
let storeTimeZone = await storeService.findOne( { storeName: { $regex: getBeforeChecklist[0].storeName, $options: 'i' }, clientId: getBeforeChecklist[0].client_id }, { 'storeProfile.timeZone': 1 } );
|
|
153
153
|
let currentDateTime;
|
|
154
154
|
if ( storeTimeZone?.storeProfile?.timeZone ) {
|
|
155
155
|
currentDateTime = dayjs().tz( storeTimeZone?.storeProfile?.timeZone );
|
|
@@ -1700,12 +1700,12 @@ export async function submitChecklist( req, res ) {
|
|
|
1700
1700
|
updateQuery._id = new ObjectId( requestData.processedcheckListId );
|
|
1701
1701
|
updateQuery.userId = req.user._id;
|
|
1702
1702
|
updateQuery.date_string = requestData.date;
|
|
1703
|
-
let storeTimeZone = await storeService.findOne( { storeName: getchecklist[0].storeName }, { 'storeProfile.timeZone': 1 } );
|
|
1703
|
+
let storeTimeZone = await storeService.findOne( { storeName: { $regex: getchecklist[0].storeName, $options: 'i' }, clientId: getchecklist[0].client_id }, { 'storeProfile.timeZone': 1 } );
|
|
1704
1704
|
let currentDateTime;
|
|
1705
1705
|
if ( storeTimeZone?.storeProfile?.timeZone ) {
|
|
1706
1706
|
currentDateTime = dayjs().tz( storeTimeZone?.storeProfile?.timeZone );
|
|
1707
1707
|
} else {
|
|
1708
|
-
currentDateTime = dayjs();
|
|
1708
|
+
currentDateTime = requestData?.currentTime ? dayjs( requestData.currentTime, 'HH:mm:ss' ) : dayjs();
|
|
1709
1709
|
}
|
|
1710
1710
|
let updateData = {};
|
|
1711
1711
|
let flagCount = QuestionFlag( req, res );
|
|
@@ -564,7 +564,10 @@ export const flagCardsV1 = async ( req, res ) => {
|
|
|
564
564
|
{
|
|
565
565
|
$match: {
|
|
566
566
|
client_id: clientId,
|
|
567
|
-
|
|
567
|
+
$or: [
|
|
568
|
+
{ store_id: { $in: storeId } },
|
|
569
|
+
{ aiStoreList: { $in: storeId } },
|
|
570
|
+
],
|
|
568
571
|
date_iso: { $gte: adjustedFromDate, $lte: adjustedToDate },
|
|
569
572
|
},
|
|
570
573
|
},
|
|
@@ -697,7 +700,12 @@ export const flagComparisonCardsV1 = async ( req, res ) => {
|
|
|
697
700
|
}
|
|
698
701
|
|
|
699
702
|
const createFindQuery = ( fromDate, toDate ) => [
|
|
700
|
-
{ $match: { client_id: requestData.clientId,
|
|
703
|
+
{ $match: { client_id: requestData.clientId,
|
|
704
|
+
$or: [
|
|
705
|
+
{ store_id: { $in: requestData.storeId } },
|
|
706
|
+
{ aiStoreList: { $in: requestData.storeId } },
|
|
707
|
+
],
|
|
708
|
+
date_iso: { $gte: fromDate, $lte: toDate } } },
|
|
701
709
|
{
|
|
702
710
|
$project: {
|
|
703
711
|
timeFlag: 1,
|