tango-app-api-trax 3.7.33 → 3.7.34

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-trax",
3
- "version": "3.7.33",
3
+ "version": "3.7.34",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -343,7 +343,29 @@ export async function PCLconfigCreation( req, res ) {
343
343
  checkListId: element2,
344
344
  isdeleted: false,
345
345
  },
346
- } );
346
+ }, {
347
+ $lookup: {
348
+ from: 'stores',
349
+ let: { store: '$store_id' },
350
+ pipeline: [
351
+ {
352
+ $match: {
353
+ $expr: {
354
+ $eq: [ '$storeId', '$$store' ],
355
+ },
356
+ },
357
+ },
358
+ {
359
+ $project: {
360
+ country: '$storeProfile.country',
361
+ state: '$storeProfile.state',
362
+ },
363
+ },
364
+ ],
365
+ as: 'store',
366
+ },
367
+ },
368
+ );
347
369
  let allQuestion = await CLassign.aggregate( getquestionQuery );
348
370
  if ( allQuestion.length && getCLconfig.checkListType == 'custom' ) {
349
371
  let assignList = [];
@@ -569,6 +591,8 @@ export async function PCLconfigCreation( req, res ) {
569
591
  element4.scheduleRepeatedType = getCLconfig.scheduleRepeatedType;
570
592
  element4.approvalEnable = getCLconfig.approver.length ? true : false;
571
593
  element4.remainder = getCLconfig?.remainder || [];
594
+ element4.country = element4?.country ?? element4?.store?.[0]?.country;
595
+ element4.state = element4?.state ?? element4?.store?.[0]?.state;
572
596
  // if ( getCLconfig?.isPlano ) {
573
597
  // let planoDetails = await planoService.findOne( { storeId: element4.store_id, clientId: getCLconfig.client_id }, { _id: 1 } );
574
598
  // element4.planoId = planoDetails?._id;