tango-app-api-store-builder 1.0.0-beta-146 → 1.0.0-beta-147
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-store-builder",
|
|
3
|
-
"version": "1.0.0-beta-
|
|
3
|
+
"version": "1.0.0-beta-147",
|
|
4
4
|
"description": "storeBuilder",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"path": "^0.12.7",
|
|
33
33
|
"selenium-webdriver": "^4.31.0",
|
|
34
34
|
"sharp": "^0.34.1",
|
|
35
|
-
"tango-api-schema": "^2.2.
|
|
35
|
+
"tango-api-schema": "^2.2.191",
|
|
36
36
|
"tango-app-api-middleware": "3.1.48",
|
|
37
37
|
"url": "^0.11.4",
|
|
38
38
|
"winston": "^3.17.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as floorService from '../service/storeBuilder.service.js';
|
|
2
|
-
import { logger } from 'tango-app-api-middleware';
|
|
2
|
+
import { logger, insertOpenSearchData } from 'tango-app-api-middleware';
|
|
3
3
|
// import * as storeService from '../service/store.service.js';
|
|
4
4
|
import * as planoService from '../service/planogram.service.js';
|
|
5
5
|
import * as storeFixtureService from '../service/storeFixture.service.js';
|
|
@@ -302,8 +302,6 @@ function buildPipelineByType( type, planoId, floorId, filterByStatus, filterByAp
|
|
|
302
302
|
},
|
|
303
303
|
},
|
|
304
304
|
},
|
|
305
|
-
|
|
306
|
-
|
|
307
305
|
);
|
|
308
306
|
} else {
|
|
309
307
|
pipeline.push(
|
|
@@ -814,7 +812,7 @@ export async function updateredostatus( req, res ) {
|
|
|
814
812
|
|
|
815
813
|
export async function updateGlobalComment( req, res ) {
|
|
816
814
|
try {
|
|
817
|
-
|
|
815
|
+
let payload ={
|
|
818
816
|
userId: req.user._id,
|
|
819
817
|
userName: req.user.userName,
|
|
820
818
|
comment: req.body.comment,
|
|
@@ -823,7 +821,9 @@ export async function updateGlobalComment( req, res ) {
|
|
|
823
821
|
floorId: new mongoose.Types.ObjectId( req.body.floorId ),
|
|
824
822
|
taskType: req.body.taskType,
|
|
825
823
|
clientId: req.body.clientId,
|
|
826
|
-
}
|
|
824
|
+
};
|
|
825
|
+
await planoGlobalCommentService.create( payload );
|
|
826
|
+
await insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).planoglobalcomments, payload );
|
|
827
827
|
|
|
828
828
|
res.sendSuccess( 'updated successfully' );
|
|
829
829
|
} catch ( e ) {
|
|
@@ -838,6 +838,8 @@ export async function getGlobalComment( req, res ) {
|
|
|
838
838
|
floorId: new mongoose.Types.ObjectId( req.body.floorId ),
|
|
839
839
|
taskType: req.body.taskType,
|
|
840
840
|
} );
|
|
841
|
+
|
|
842
|
+
|
|
841
843
|
res.sendSuccess( layoutComment );
|
|
842
844
|
} catch ( e ) {
|
|
843
845
|
logger.error( { functionName: 'getGlobalComment', error: e } );
|
|
@@ -2645,7 +2645,7 @@ export async function storeFixturesv2( req, res ) {
|
|
|
2645
2645
|
{ storeId: { $in: req.body.id } },
|
|
2646
2646
|
],
|
|
2647
2647
|
},
|
|
2648
|
-
{ storeId: 1, storeName: 1, planoId: '$_id', productResolutionLevel: 1, scanType: 1, clientId: 1, validateShelfSections: 1
|
|
2648
|
+
{ storeId: 1, storeName: 1, planoId: '$_id', productResolutionLevel: 1, scanType: 1, clientId: 1, validateShelfSections: 1 },
|
|
2649
2649
|
);
|
|
2650
2650
|
|
|
2651
2651
|
if ( !planograms?.length ) return res.sendError( 'No data found', 204 );
|
|
@@ -3267,12 +3267,12 @@ export async function planoList( req, res ) {
|
|
|
3267
3267
|
{
|
|
3268
3268
|
$lookup: {
|
|
3269
3269
|
from: 'storefixtures',
|
|
3270
|
-
let: {
|
|
3270
|
+
let: { floor: '$layout.id' },
|
|
3271
3271
|
pipeline: [
|
|
3272
3272
|
{
|
|
3273
3273
|
$match: {
|
|
3274
3274
|
$expr: {
|
|
3275
|
-
$eq: [ '$
|
|
3275
|
+
$eq: [ '$floorId', '$$floor' ],
|
|
3276
3276
|
},
|
|
3277
3277
|
},
|
|
3278
3278
|
},
|
|
@@ -3367,19 +3367,6 @@ export async function planoList( req, res ) {
|
|
|
3367
3367
|
},
|
|
3368
3368
|
},
|
|
3369
3369
|
{ $sort: { _id: -1 } },
|
|
3370
|
-
{
|
|
3371
|
-
$group: {
|
|
3372
|
-
_id: { floorId: '$floorId', type: '$type' },
|
|
3373
|
-
doc: { $first: '$$ROOT' },
|
|
3374
|
-
},
|
|
3375
|
-
},
|
|
3376
|
-
{
|
|
3377
|
-
$project: {
|
|
3378
|
-
type: '$_id.type',
|
|
3379
|
-
floorId: '$_id.floorId',
|
|
3380
|
-
answers: '$doc.answers',
|
|
3381
|
-
},
|
|
3382
|
-
},
|
|
3383
3370
|
{
|
|
3384
3371
|
$set: {
|
|
3385
3372
|
hasPendingIssues: {
|
|
@@ -3952,7 +3939,6 @@ export async function planoList( req, res ) {
|
|
|
3952
3939
|
];
|
|
3953
3940
|
|
|
3954
3941
|
let pendingDetails = await planotaskService.aggregate( taskQuery );
|
|
3955
|
-
|
|
3956
3942
|
taskQuery = [
|
|
3957
3943
|
{
|
|
3958
3944
|
$match: {
|
|
@@ -4074,6 +4060,7 @@ export async function planoList( req, res ) {
|
|
|
4074
4060
|
];
|
|
4075
4061
|
|
|
4076
4062
|
pendingDetails = await planoTaskComplianceService.aggregate( taskQuery );
|
|
4063
|
+
// console.log( JSON.stringify( pendingDetails ) );
|
|
4077
4064
|
let result = {
|
|
4078
4065
|
data: planoDetails[0].data,
|
|
4079
4066
|
count: planoDetails?.[0]?.count?.[0]?.total || 0,
|
|
@@ -4541,11 +4528,11 @@ export async function getTaskDetails( req, res ) {
|
|
|
4541
4528
|
|
|
4542
4529
|
let taskInfo = await planotaskService.aggregate( query );
|
|
4543
4530
|
let disabledInfo = [];
|
|
4544
|
-
let floorDetails = await layoutService.findOne( { _id: req.query.floorId }, { isEdited: 1 } );
|
|
4531
|
+
let floorDetails = await layoutService.findOne( { _id: req.query.floorId }, { isEdited: 1, planoProgress: 1 } );
|
|
4545
4532
|
if ( floorDetails && !floorDetails?.isEdited ) {
|
|
4546
4533
|
disabledInfo = taskInfo?.[0]?.taskStatus?.filter( ( ele ) => ( ( ele.feedbackStatus && ![ 'complete', 'disagree' ].includes( ele.feedbackStatus ) ) || ele.status != 'submit' ) && !ele?.breach );
|
|
4547
4534
|
}
|
|
4548
|
-
return res.sendSuccess( { taskDetails: taskInfo?.[0]?.taskStatus, disabled: disabledInfo?.length ? true : false } );
|
|
4535
|
+
return res.sendSuccess( { taskDetails: taskInfo?.[0]?.taskStatus, disabled: disabledInfo?.length ? true : false, planoProgress: floorDetails?.planoProgress ?? 25 } );
|
|
4549
4536
|
} catch ( e ) {
|
|
4550
4537
|
logger.error( { functionName: 'getTaskDetails', error: e } );
|
|
4551
4538
|
return res.sendError( e, 500 );
|
|
@@ -306,7 +306,7 @@ export async function createTask( req, res ) {
|
|
|
306
306
|
let type = req.body.checkListName == 'Fixture Verification' ? 'fixture' :'vm';
|
|
307
307
|
await planoTaskService.deleteMany( { planoId: planoDetails?._id, floorId: taskData?.floorId, type: type } );
|
|
308
308
|
}
|
|
309
|
-
await
|
|
309
|
+
await floorService.updateOne( { _id: taskData?.floorId }, { planoProgress } );
|
|
310
310
|
for ( let j=0; j<req.body.days; j++ ) {
|
|
311
311
|
let currDate = dayjs().add( j, 'day' );
|
|
312
312
|
let time = '12:00 AM';
|