tango-app-api-store-builder 1.0.0-beta-221 → 1.0.0-beta-222
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/failure_cases.json +1 -1
- package/logs.json +2 -2
- package/missing_stores.json +2 -2
- package/package.json +1 -1
- package/src/controllers/fixtureTemplate.controller.js +2 -7
- package/src/controllers/managePlano.controller.js +0 -3
- package/src/controllers/planoLibrary.controller.js +39 -0
- package/src/controllers/script.controller.js +62 -60
- package/src/controllers/storeBuilder.controller.js +88 -13
- package/src/controllers/task.controller.js +0 -7
- package/src/dtos/validation.dtos.js +1 -0
- package/src/routes/fixtureTemplate.routes.js +19 -18
- package/src/routes/managePlano.routes.js +21 -21
- package/src/routes/planoLibrary.routes.js +28 -28
- package/src/routes/script.routes.js +37 -36
- package/src/routes/storeBuilder.routes.js +57 -56
- package/src/routes/task.routes.js +13 -13
- package/src/service/storeFixture.service.js +0 -1
- package/src/service/storeFixtureDuplicate.service.js +0 -2
package/failure_cases.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
[
|
|
1
|
+
[
|
|
2
2
|
]
|
package/logs.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
[
|
|
2
|
-
|
|
1
|
+
[
|
|
2
|
+
|
|
3
3
|
]
|
package/missing_stores.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
[
|
|
2
|
-
|
|
1
|
+
[
|
|
2
|
+
|
|
3
3
|
]
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ dayjs.extend( customParseFormat );
|
|
|
20
20
|
export async function createTemplate( req, res ) {
|
|
21
21
|
try {
|
|
22
22
|
let inputData = req.body;
|
|
23
|
+
const templateType = inputData?.templateType ?? 'sub';
|
|
23
24
|
let getLibDetails = await fixtureLibService.findOne( { _id: inputData.fixtureLibraryId, clientId: inputData.clientId } );
|
|
24
25
|
if ( !getLibDetails ) {
|
|
25
26
|
return res.sendError( 'Fixture library id is wrong', 400 );
|
|
@@ -47,6 +48,7 @@ export async function createTemplate( req, res ) {
|
|
|
47
48
|
value: 1220,
|
|
48
49
|
unit: 'mm',
|
|
49
50
|
},
|
|
51
|
+
templateType: templateType,
|
|
50
52
|
templateIndex: parseInt( templateId.split( '-' )[1] ),
|
|
51
53
|
};
|
|
52
54
|
let fixtureData = await fixtureConfigService.create( templateData );
|
|
@@ -578,7 +580,6 @@ export async function getFixtureTemplate( req, res ) {
|
|
|
578
580
|
if ( templateDoc?.vmConfig?.length ) {
|
|
579
581
|
templateDoc.vmConfig = await Promise.all( templateDoc.vmConfig.map( async ( vm ) => {
|
|
580
582
|
let vmDetails = await vmService.findOne( { _id: vm.vmId } );
|
|
581
|
-
console.log( vmDetails );
|
|
582
583
|
if ( vmDetails ) {
|
|
583
584
|
vm = { ...vm, ...vmDetails.toObject() };
|
|
584
585
|
return vm;
|
|
@@ -669,7 +670,6 @@ export async function TemplateStoresList( req, res ) {
|
|
|
669
670
|
let limit = inputData?.limit || 10;
|
|
670
671
|
let page = inputData?.offset || 1;
|
|
671
672
|
let skip = limit * ( page - 1 );
|
|
672
|
-
console.log( skip, limit );
|
|
673
673
|
|
|
674
674
|
query.push( {
|
|
675
675
|
$match: {
|
|
@@ -931,17 +931,12 @@ export async function replaceFixtureDetails( req, res ) {
|
|
|
931
931
|
storeId: store.storeId,
|
|
932
932
|
} );
|
|
933
933
|
|
|
934
|
-
// console.log( replaceFixture );
|
|
935
934
|
|
|
936
935
|
if ( !replaceFixture.length ) return;
|
|
937
936
|
|
|
938
|
-
// console.log( replaceFixture._id );
|
|
939
|
-
|
|
940
937
|
const deleteFixShelves = await fixtureShelfService.deleteMany( {
|
|
941
938
|
fixtureId: { $in: replaceFixture.map( ( ele ) => ele._id ) },
|
|
942
939
|
} );
|
|
943
|
-
console.log( deleteFixShelves );
|
|
944
|
-
|
|
945
940
|
await storeFixtureService.updateMany(
|
|
946
941
|
{ fixtureConfigId: inputData.findFixture, ...( store?.floorDetails?._id ) ? { floorId: store?.floorDetails?._id } : {}, storeId: store.storeId },
|
|
947
942
|
updateData,
|
|
@@ -187,7 +187,6 @@ export async function getplanoFeedbackv1( req, res ) {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
function buildPipelineByType( type, planoId, floorId, filterByStatus, filterByApprovalStatus, showtask, taskId = 0 ) {
|
|
190
|
-
console.log( type, planoId, floorId, filterByStatus );
|
|
191
190
|
const matchStage = {
|
|
192
191
|
$match: {
|
|
193
192
|
planoId: new mongoose.Types.ObjectId( planoId ),
|
|
@@ -430,7 +429,6 @@ function buildPipelineByType( type, planoId, floorId, filterByStatus, filterByAp
|
|
|
430
429
|
}
|
|
431
430
|
|
|
432
431
|
function buildPipelineByType1( type, planoId, floorId, filterByStatus, filterByApprovalStatus, showtask, taskId = 0 ) {
|
|
433
|
-
console.log( type, planoId, floorId, filterByStatus );
|
|
434
432
|
const matchStage = {
|
|
435
433
|
$match: {
|
|
436
434
|
planoId: new mongoose.Types.ObjectId( planoId ),
|
|
@@ -1984,6 +1982,5 @@ function pipelineStage( type, planoId, floorId, filterByStatus, filterByApproval
|
|
|
1984
1982
|
{ $sort: { _id: 1 } },
|
|
1985
1983
|
];
|
|
1986
1984
|
|
|
1987
|
-
console.log( JSON.stringify( pipeline, 'pipeline' ) );
|
|
1988
1985
|
return pipeline;
|
|
1989
1986
|
}
|
|
@@ -1437,6 +1437,45 @@ export async function fixtureNameList( req, res ) {
|
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
1439
|
|
|
1440
|
+
export async function fixtureLibNameList( req, res ) {
|
|
1441
|
+
try {
|
|
1442
|
+
let getFixtureDetails = await planoLibraryService.aggregate( [
|
|
1443
|
+
{
|
|
1444
|
+
$match: {
|
|
1445
|
+
clientId: req.query.clientId,
|
|
1446
|
+
status: 'complete',
|
|
1447
|
+
},
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
$group: {
|
|
1451
|
+
_id: '',
|
|
1452
|
+
fixtureDetails: {
|
|
1453
|
+
$push: { fixtureName: {
|
|
1454
|
+
$concat: [
|
|
1455
|
+
'$fixtureCategory',
|
|
1456
|
+
' - ',
|
|
1457
|
+
{ $toString: '$fixtureWidth.value' },
|
|
1458
|
+
'$fixtureWidth.unit',
|
|
1459
|
+
] }, id: '$_id',
|
|
1460
|
+
},
|
|
1461
|
+
},
|
|
1462
|
+
},
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
$project: {
|
|
1466
|
+
_id: 1,
|
|
1467
|
+
fixtureDetails: 1,
|
|
1468
|
+
},
|
|
1469
|
+
},
|
|
1470
|
+
] );
|
|
1471
|
+
|
|
1472
|
+
return res.sendSuccess( getFixtureDetails?.[0]?.fixtureDetails || [] );
|
|
1473
|
+
} catch ( e ) {
|
|
1474
|
+
logger.error( { functionName: 'fixtureNameList', error: e } );
|
|
1475
|
+
return res.sendError( e, 500 );
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1440
1479
|
export async function vmNameList( req, res ) {
|
|
1441
1480
|
try {
|
|
1442
1481
|
let getVmDetails = await vmService.find( { clientId: req.query.clientId, status: 'complete' }, { vmName: 1, vmWidth: 1, vmHeight: 1, vmImageUrl: 1, vmType: 1 } );
|
|
@@ -9704,97 +9704,96 @@ function transformProducts( products, shelvesByZone, fixtureData ) {
|
|
|
9704
9704
|
|
|
9705
9705
|
// ---------------------Plano Migrate-------------------------
|
|
9706
9706
|
|
|
9707
|
-
export async function getAllPlanoIds(req, res){
|
|
9707
|
+
export async function getAllPlanoIds( req, res ) {
|
|
9708
9708
|
try {
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
return res.sendError('Client id is required', 400);
|
|
9709
|
+
if ( !req.query?.clientId ) {
|
|
9710
|
+
return res.sendError( 'Client id is required', 400 );
|
|
9712
9711
|
}
|
|
9713
|
-
const floorsData = await storeBuilderService.aggregate([
|
|
9712
|
+
const floorsData = await storeBuilderService.aggregate( [
|
|
9714
9713
|
{
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9714
|
+
'$match': {
|
|
9715
|
+
'clientId': '11',
|
|
9716
|
+
},
|
|
9718
9717
|
}, {
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9718
|
+
'$group': {
|
|
9719
|
+
'_id': '$planoId',
|
|
9720
|
+
'storeName': {
|
|
9721
|
+
'$first': '$storeName',
|
|
9722
|
+
},
|
|
9723
|
+
'storeId': {
|
|
9724
|
+
'$first': '$storeId',
|
|
9725
|
+
},
|
|
9723
9726
|
},
|
|
9724
|
-
'storeId': {
|
|
9725
|
-
'$first': '$storeId'
|
|
9726
|
-
}
|
|
9727
|
-
}
|
|
9728
|
-
}, {
|
|
9729
|
-
'$project': {
|
|
9730
|
-
'planoId': '$_id',
|
|
9731
|
-
'storeName': 1,
|
|
9732
|
-
'storeId': 1
|
|
9733
|
-
}
|
|
9734
9727
|
}, {
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9728
|
+
'$project': {
|
|
9729
|
+
'planoId': '$_id',
|
|
9730
|
+
'storeName': 1,
|
|
9731
|
+
'storeId': 1,
|
|
9732
|
+
},
|
|
9733
|
+
}, {
|
|
9734
|
+
'$sort': { storeName: 1 },
|
|
9735
|
+
},
|
|
9736
|
+
] );
|
|
9738
9737
|
|
|
9739
|
-
if (floorsData) {
|
|
9740
|
-
return res.sendSuccess(floorsData);
|
|
9738
|
+
if ( floorsData ) {
|
|
9739
|
+
return res.sendSuccess( floorsData );
|
|
9741
9740
|
} else {
|
|
9742
|
-
return res.sendError("No floor data found", 204)
|
|
9741
|
+
return res.sendError( "No floor data found", 204 );
|
|
9743
9742
|
}
|
|
9744
|
-
} catch (error) {
|
|
9745
|
-
console.log("@@ ~ getAllPlanoIds [ERR]:", error);
|
|
9746
|
-
return res.sendError(e, 500);
|
|
9743
|
+
} catch ( error ) {
|
|
9744
|
+
console.log( "@@ ~ getAllPlanoIds [ERR]:", error );
|
|
9745
|
+
return res.sendError( e, 500 );
|
|
9747
9746
|
}
|
|
9748
9747
|
}
|
|
9749
9748
|
|
|
9750
|
-
export async function createComplianceFromMappins(req, res) {
|
|
9749
|
+
export async function createComplianceFromMappins( req, res ) {
|
|
9751
9750
|
try {
|
|
9752
9751
|
const { planoId, fixtureId } = req.body;
|
|
9753
9752
|
|
|
9754
|
-
if (!planoId) {
|
|
9755
|
-
res.sendError('PlanoId is required', 400);
|
|
9753
|
+
if ( !planoId ) {
|
|
9754
|
+
res.sendError( 'PlanoId is required', 400 );
|
|
9756
9755
|
}
|
|
9757
9756
|
|
|
9758
|
-
if (!fixtureId) {
|
|
9759
|
-
res.sendError('FixtureId is required', 400);
|
|
9757
|
+
if ( !fixtureId ) {
|
|
9758
|
+
res.sendError( 'FixtureId is required', 400 );
|
|
9760
9759
|
}
|
|
9761
9760
|
|
|
9762
|
-
const allMappings = await planoMappingService.find({ planoId: planoId, fixtureId: fixtureId, type: 'product' });
|
|
9761
|
+
const allMappings = await planoMappingService.find( { planoId: planoId, fixtureId: fixtureId, type: 'product' } );
|
|
9763
9762
|
|
|
9764
9763
|
const allCompliance = [];
|
|
9765
9764
|
|
|
9766
|
-
for (let i = 0; i < allMappings.length; i++) {
|
|
9765
|
+
for ( let i = 0; i < allMappings.length; i++ ) {
|
|
9767
9766
|
const mapping = allMappings[i];
|
|
9768
9767
|
const complianceDoc = {
|
|
9769
9768
|
"clientId": "11",
|
|
9770
9769
|
"storeName": "LKST2255",
|
|
9771
9770
|
"storeId": "11-1984",
|
|
9772
9771
|
"type": "product",
|
|
9773
|
-
"planoId": new mongoose.Types.ObjectId(mapping.planoId),
|
|
9774
|
-
"floorId": new mongoose.Types.ObjectId(mapping.floorId),
|
|
9775
|
-
"fixtureId": new mongoose.Types.ObjectId(mapping.fixtureId),
|
|
9776
|
-
"shelfId": new mongoose.Types.ObjectId(mapping.shelfId),
|
|
9777
|
-
"productId": new mongoose.Types.ObjectId(mapping.productId),
|
|
9772
|
+
"planoId": new mongoose.Types.ObjectId( mapping.planoId ),
|
|
9773
|
+
"floorId": new mongoose.Types.ObjectId( mapping.floorId ),
|
|
9774
|
+
"fixtureId": new mongoose.Types.ObjectId( mapping.fixtureId ),
|
|
9775
|
+
"shelfId": new mongoose.Types.ObjectId( mapping.shelfId ),
|
|
9776
|
+
"productId": new mongoose.Types.ObjectId( mapping.productId ),
|
|
9778
9777
|
"rfId": "CCC094850431",
|
|
9779
9778
|
"compliance": "proper",
|
|
9780
9779
|
"date": new Date(),
|
|
9781
|
-
"planoMappingId": new mongoose.Types.ObjectId(mapping._id)
|
|
9780
|
+
"planoMappingId": new mongoose.Types.ObjectId( mapping._id ),
|
|
9782
9781
|
};
|
|
9783
9782
|
|
|
9784
|
-
const res = await planoComplianceService.create(complianceDoc);
|
|
9785
|
-
if (res) {
|
|
9786
|
-
allCompliance.push(res);
|
|
9783
|
+
const res = await planoComplianceService.create( complianceDoc );
|
|
9784
|
+
if ( res ) {
|
|
9785
|
+
allCompliance.push( res );
|
|
9787
9786
|
}
|
|
9788
9787
|
}
|
|
9789
9788
|
|
|
9790
|
-
if (allCompliance) {
|
|
9791
|
-
return res.sendSuccess({ mappings: allCompliance, count: allCompliance.length });
|
|
9789
|
+
if ( allCompliance ) {
|
|
9790
|
+
return res.sendSuccess( { mappings: allCompliance, count: allCompliance.length } );
|
|
9792
9791
|
} else {
|
|
9793
|
-
return res.sendError("No mapping data found", 204)
|
|
9792
|
+
return res.sendError( "No mapping data found", 204 );
|
|
9794
9793
|
}
|
|
9795
|
-
} catch (error) {
|
|
9796
|
-
console.log("@@ ~ createComplianceFromMappins [ERR]: ", error);
|
|
9797
|
-
return res.sendError(e, 500);
|
|
9794
|
+
} catch ( error ) {
|
|
9795
|
+
console.log( "@@ ~ createComplianceFromMappins [ERR]: ", error );
|
|
9796
|
+
return res.sendError( e, 500 );
|
|
9798
9797
|
}
|
|
9799
9798
|
}
|
|
9800
9799
|
|
|
@@ -10796,7 +10795,7 @@ export async function migrateOvmToIvm( req, res ) {
|
|
|
10796
10795
|
|
|
10797
10796
|
|
|
10798
10797
|
const updateEuroCollections = ( fixtures, tentpoleCollectionsData, tentpoleEurocentreFixtureData ) => {
|
|
10799
|
-
fixtures
|
|
10798
|
+
fixtures = sortFunc( fixtures );
|
|
10800
10799
|
let tentpoleCount = 1;
|
|
10801
10800
|
for ( let i = 0; i < fixtures.length; i++ ) {
|
|
10802
10801
|
const fixture = fixtures[i];
|
|
@@ -10839,9 +10838,9 @@ export async function migrateOvmToIvm( req, res ) {
|
|
|
10839
10838
|
if ( !collection ) {
|
|
10840
10839
|
const tentpoleCol = tentpoleEurocentreFixtureData.find( ( data ) => data?.['Store Code'] === fixture.storeName );
|
|
10841
10840
|
|
|
10842
|
-
if(tentpoleCount === 1){
|
|
10841
|
+
if ( tentpoleCount === 1 ) {
|
|
10843
10842
|
collection = tentpoleCol?.Tentpole_1;
|
|
10844
|
-
}else if(tentpoleCount === 2){
|
|
10843
|
+
} else if ( tentpoleCount === 2 ) {
|
|
10845
10844
|
collection = tentpoleCol?.Tentpole_2;
|
|
10846
10845
|
}
|
|
10847
10846
|
}
|
|
@@ -10874,7 +10873,7 @@ export async function migrateOvmToIvm( req, res ) {
|
|
|
10874
10873
|
} );
|
|
10875
10874
|
}
|
|
10876
10875
|
|
|
10877
|
-
tentpoleCount += 1
|
|
10876
|
+
tentpoleCount += 1;
|
|
10878
10877
|
}
|
|
10879
10878
|
}
|
|
10880
10879
|
}
|
|
@@ -14389,6 +14388,7 @@ function findMissingStores() {
|
|
|
14389
14388
|
|
|
14390
14389
|
async function createStores() {
|
|
14391
14390
|
const storeList = [
|
|
14391
|
+
"Tamsui",
|
|
14392
14392
|
];
|
|
14393
14393
|
|
|
14394
14394
|
for ( let index = 0; index < storeList.length; index++ ) {
|
|
@@ -14399,7 +14399,7 @@ async function createStores() {
|
|
|
14399
14399
|
const planoData = {
|
|
14400
14400
|
"storeName": storeName,
|
|
14401
14401
|
"attachments": [],
|
|
14402
|
-
"clientId": "
|
|
14402
|
+
"clientId": "193",
|
|
14403
14403
|
"createdBy": new mongoose.Types.ObjectId( '66a78cd82734f4f857cd6db6' ),
|
|
14404
14404
|
"createdByEmail": "bejan@tangotech.co.in",
|
|
14405
14405
|
"createdByName": "Bejan",
|
|
@@ -14416,7 +14416,7 @@ async function createStores() {
|
|
|
14416
14416
|
const storeLayout = {
|
|
14417
14417
|
"floorNumber": 1,
|
|
14418
14418
|
"planoId": planogram.toObject()._id,
|
|
14419
|
-
"clientId": "
|
|
14419
|
+
"clientId": "193",
|
|
14420
14420
|
"createdBy": new mongoose.Types.ObjectId( '66a78cd82734f4f857cd6db6' ),
|
|
14421
14421
|
"createdByEmail": "bejan@tangotech.co.in",
|
|
14422
14422
|
"createdByName": "Bejan",
|
|
@@ -14493,7 +14493,7 @@ async function createStores() {
|
|
|
14493
14493
|
|
|
14494
14494
|
|
|
14495
14495
|
async function updateStoreFixtureShelves() {
|
|
14496
|
-
const stores = ["
|
|
14496
|
+
const stores = [ "LKST163" ];
|
|
14497
14497
|
|
|
14498
14498
|
for ( let i = 0; i < stores.length; i++ ) {
|
|
14499
14499
|
const store = stores[i];
|
|
@@ -14508,6 +14508,7 @@ async function updateStoreFixtureShelves() {
|
|
|
14508
14508
|
for ( let j = 0; j < storeFixtures.length; j++ ) {
|
|
14509
14509
|
const fixture = storeFixtures[j].toObject();
|
|
14510
14510
|
|
|
14511
|
+
// if ( storeFixtures[j].toString() === '68abeaa210e4af67a2b99ae5' ) {
|
|
14511
14512
|
let library = await fixtureConfigService.findOne( { "fixtureCategory": fixture.fixtureCategory, "fixtureWidth.value": fixture.fixtureWidth.value } );
|
|
14512
14513
|
|
|
14513
14514
|
await fixtureShelfService.deleteMany( { fixtureId: fixture._id } );
|
|
@@ -14534,6 +14535,7 @@ async function updateStoreFixtureShelves() {
|
|
|
14534
14535
|
|
|
14535
14536
|
await fixtureShelfService.create( shelf );
|
|
14536
14537
|
}
|
|
14538
|
+
// }
|
|
14537
14539
|
}
|
|
14538
14540
|
}
|
|
14539
14541
|
|
|
@@ -815,7 +815,6 @@ export async function storeFixturesv1( req, res ) {
|
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
|
|
818
|
-
|
|
819
818
|
export async function deleteStoreLayout( req, res ) {
|
|
820
819
|
try {
|
|
821
820
|
let getDetails = await planoService.findOne( { _id: req.params.id } );
|
|
@@ -888,7 +887,6 @@ export async function updateStatus( req, res ) {
|
|
|
888
887
|
}
|
|
889
888
|
}
|
|
890
889
|
|
|
891
|
-
|
|
892
890
|
export async function fixtureShelfProductv1( req, res ) {
|
|
893
891
|
try {
|
|
894
892
|
const { planoId, fixtureId } = req.body;
|
|
@@ -994,7 +992,6 @@ export async function fixtureShelfProductv1( req, res ) {
|
|
|
994
992
|
}
|
|
995
993
|
}
|
|
996
994
|
|
|
997
|
-
|
|
998
995
|
export async function scanv1( req, res ) {
|
|
999
996
|
try {
|
|
1000
997
|
if ( !req.body.floorId ) return res.sendError( 'Floor id is required', 400 );
|
|
@@ -1516,8 +1513,6 @@ export async function bulkFixtureUpload( req, res ) {
|
|
|
1516
1513
|
try {
|
|
1517
1514
|
const fixture = await storeFixtureService.findOne( { _id: new mongoose.Types.ObjectId( req.body.id ) } );
|
|
1518
1515
|
|
|
1519
|
-
console.log( fixture );
|
|
1520
|
-
|
|
1521
1516
|
const fixtureDoc = fixture.toObject();
|
|
1522
1517
|
|
|
1523
1518
|
for ( let i = 0; i < req.body.data.length; i++ ) {
|
|
@@ -1557,7 +1552,6 @@ export async function bulkFixtureUpload( req, res ) {
|
|
|
1557
1552
|
'category': 'middle',
|
|
1558
1553
|
};
|
|
1559
1554
|
await planoMappingService.create( productMapping );
|
|
1560
|
-
console.log( j );
|
|
1561
1555
|
}
|
|
1562
1556
|
}
|
|
1563
1557
|
|
|
@@ -1573,7 +1567,6 @@ export async function bulkFixtureUpload( req, res ) {
|
|
|
1573
1567
|
await planoMappingService.updateOne( { _id: mapping._id }, { productId: product.toObject()._id } );
|
|
1574
1568
|
}
|
|
1575
1569
|
|
|
1576
|
-
console.log( product );
|
|
1577
1570
|
}
|
|
1578
1571
|
|
|
1579
1572
|
res.sendSuccess( fixture );
|
|
@@ -2141,7 +2134,6 @@ export const fixtureQrUpdatev1 = async ( req, res ) => {
|
|
|
2141
2134
|
}
|
|
2142
2135
|
};
|
|
2143
2136
|
|
|
2144
|
-
|
|
2145
2137
|
export const updateDetailedDistance = async ( req, res ) => {
|
|
2146
2138
|
try {
|
|
2147
2139
|
const { floorId, elementNumber, elementType, detailedDistance } = req.body;
|
|
@@ -2381,7 +2373,6 @@ export const getFixtureLengths = async ( req, res ) => {
|
|
|
2381
2373
|
}
|
|
2382
2374
|
};
|
|
2383
2375
|
|
|
2384
|
-
|
|
2385
2376
|
export const getFixtureBrands = async ( req, res ) => {
|
|
2386
2377
|
try {
|
|
2387
2378
|
// const pipeline = [
|
|
@@ -4860,7 +4851,6 @@ export async function planoList( req, res ) {
|
|
|
4860
4851
|
];
|
|
4861
4852
|
|
|
4862
4853
|
pendingDetails = await planoTaskComplianceService.aggregate( taskQuery );
|
|
4863
|
-
// console.log( JSON.stringify( pendingDetails ) );
|
|
4864
4854
|
let result = {
|
|
4865
4855
|
data: planoDetails[0].data,
|
|
4866
4856
|
count: planoDetails?.[0]?.count?.[0]?.total || 0,
|
|
@@ -5341,7 +5331,7 @@ export async function getTaskDetails( req, res ) {
|
|
|
5341
5331
|
|
|
5342
5332
|
export async function getPlanoUser( req, res ) {
|
|
5343
5333
|
try {
|
|
5344
|
-
return res.sendSuccess( 'Authorized' );
|
|
5334
|
+
// return res.sendSuccess( 'Authorized' );
|
|
5345
5335
|
let userList = await planoStaticData.findOne( { type: 'user' }, { data: 1 } );
|
|
5346
5336
|
if ( !userList?.data?.includes( req.user.email ) ) {
|
|
5347
5337
|
return res.sendSuccess( 'Unauthorized' );
|
|
@@ -6266,7 +6256,6 @@ export async function getPlanoStoreList( req, res ) {
|
|
|
6266
6256
|
}
|
|
6267
6257
|
}
|
|
6268
6258
|
|
|
6269
|
-
|
|
6270
6259
|
export async function getScandid( req, res ) {
|
|
6271
6260
|
try {
|
|
6272
6261
|
let getScanId = await planoStaticData.findOne( { type: 'app' } );
|
|
@@ -6280,7 +6269,6 @@ export async function getScandid( req, res ) {
|
|
|
6280
6269
|
}
|
|
6281
6270
|
}
|
|
6282
6271
|
|
|
6283
|
-
|
|
6284
6272
|
export async function getFixtureAIDetails( req, res ) {
|
|
6285
6273
|
try {
|
|
6286
6274
|
if ( !req.query.fixtureId ) {
|
|
@@ -6349,3 +6337,90 @@ export async function searchProduct( req, res ) {
|
|
|
6349
6337
|
return res.sendError( e, 500 );
|
|
6350
6338
|
}
|
|
6351
6339
|
}
|
|
6340
|
+
|
|
6341
|
+
export async function getPlanogramList(req, res) {
|
|
6342
|
+
try {
|
|
6343
|
+
const {
|
|
6344
|
+
clientId,
|
|
6345
|
+
limit = 10,
|
|
6346
|
+
offset = 1,
|
|
6347
|
+
searchValue = '',
|
|
6348
|
+
sortColumnName = '',
|
|
6349
|
+
sortBy = ''
|
|
6350
|
+
} = req.body;
|
|
6351
|
+
|
|
6352
|
+
const page = Math.max(offset - 1, 0);
|
|
6353
|
+
const skip = page * limit;
|
|
6354
|
+
|
|
6355
|
+
const pipeline = [
|
|
6356
|
+
{ $match: { clientId } },
|
|
6357
|
+
|
|
6358
|
+
{
|
|
6359
|
+
$project: {
|
|
6360
|
+
_id: 1,
|
|
6361
|
+
planoId: 1,
|
|
6362
|
+
createdAt: 1,
|
|
6363
|
+
updatedAt: 1,
|
|
6364
|
+
floorName: 1,
|
|
6365
|
+
layoutName: 1,
|
|
6366
|
+
floorNumber: 1,
|
|
6367
|
+
planoProgress: 1,
|
|
6368
|
+
status: 1,
|
|
6369
|
+
storeId: 1,
|
|
6370
|
+
storeName: 1
|
|
6371
|
+
}
|
|
6372
|
+
}
|
|
6373
|
+
];
|
|
6374
|
+
|
|
6375
|
+
if (searchValue?.trim()) {
|
|
6376
|
+
const values = searchValue.split(',').map(s => s.trim().toLowerCase());
|
|
6377
|
+
|
|
6378
|
+
if (values.length > 1) {
|
|
6379
|
+
pipeline.push(
|
|
6380
|
+
{ $addFields: { store: { $toLower: '$storeName' } } },
|
|
6381
|
+
{ $match: { store: { $in: values } } }
|
|
6382
|
+
);
|
|
6383
|
+
} else {
|
|
6384
|
+
pipeline.push({
|
|
6385
|
+
$match: { storeName: { $regex: searchValue, $options: 'i' } }
|
|
6386
|
+
});
|
|
6387
|
+
}
|
|
6388
|
+
}
|
|
6389
|
+
|
|
6390
|
+
if (sortColumnName && sortBy) {
|
|
6391
|
+
pipeline.push({ $sort: { [sortColumnName]: Number(sortBy) } });
|
|
6392
|
+
} else {
|
|
6393
|
+
pipeline.push({ $sort: { createdAt: -1 } });
|
|
6394
|
+
}
|
|
6395
|
+
|
|
6396
|
+
pipeline.push({
|
|
6397
|
+
$facet: {
|
|
6398
|
+
data: [
|
|
6399
|
+
{ $skip: skip },
|
|
6400
|
+
{ $limit: limit }
|
|
6401
|
+
],
|
|
6402
|
+
count: [{ $count: 'total' }]
|
|
6403
|
+
}
|
|
6404
|
+
});
|
|
6405
|
+
|
|
6406
|
+
const result = await layoutService.aggregate(pipeline);
|
|
6407
|
+
|
|
6408
|
+
const data = result?.[0]?.data || [];
|
|
6409
|
+
const total = result?.[0]?.count?.[0]?.total || 0;
|
|
6410
|
+
|
|
6411
|
+
if (data.length === 0) {
|
|
6412
|
+
return res.sendError('No data found', 204);
|
|
6413
|
+
}
|
|
6414
|
+
|
|
6415
|
+
data.forEach(d => {
|
|
6416
|
+
d.createdAt = dayjs.utc(d.createdAt).format('DD MMM, YYYY');
|
|
6417
|
+
d.updatedAt = dayjs.utc(d.updatedAt).format('DD MMM, YYYY');
|
|
6418
|
+
});
|
|
6419
|
+
|
|
6420
|
+
return res.sendSuccess({ data, count: total });
|
|
6421
|
+
|
|
6422
|
+
} catch (err) {
|
|
6423
|
+
logger.error({ functionName: 'getLayoutList', error: err });
|
|
6424
|
+
return res.sendError(err, 500);
|
|
6425
|
+
}
|
|
6426
|
+
}
|
|
@@ -456,7 +456,6 @@ export async function createPlano( req, res ) {
|
|
|
456
456
|
},
|
|
457
457
|
];
|
|
458
458
|
userDetails = await userService.aggregate( query );
|
|
459
|
-
console.log( userDetails );
|
|
460
459
|
if ( !userDetails.length ) {
|
|
461
460
|
let userData = {
|
|
462
461
|
clientId: req.body.clientId,
|
|
@@ -480,7 +479,6 @@ export async function createPlano( req, res ) {
|
|
|
480
479
|
let currDate = dayjs().add( i, 'day' );
|
|
481
480
|
let insertData = { ...checklistData, date_string: currDate.format( 'YYYY-MM-DD' ), date_iso: new Date( currDate.format( 'YYYY-MM-DD' ) ), scheduleStartTime_iso: dayjs.utc( `${currDate.format( 'YYYY-MM-DD' )} 08:00 AM`, 'YYYY-MM-DD hh:mm A' ).format(), scheduleEndTime_iso: dayjs.utc( `${currDate.format( 'YYYY-MM-DD' )} 11:59 PM`, 'YYYY-MM-DD hh:mm A' ).format() };
|
|
482
481
|
let response = await processedChecklistService.updateOne( { date_string: currDate.format( 'YYYY-MM-DD' ), store_id: insertData.store_id, userEmail: insertData.userEmail, planoId: insertData.planoId, sourceCheckList_id: checklist._id }, insertData );
|
|
483
|
-
console.log( insertData.store_id, response );
|
|
484
482
|
}
|
|
485
483
|
} ) );
|
|
486
484
|
} ) );
|
|
@@ -517,8 +515,6 @@ export async function uploadImage( req, res ) {
|
|
|
517
515
|
if ( !req.files.file ) {
|
|
518
516
|
return res.sendError( 'Please upload a file', 400 );
|
|
519
517
|
}
|
|
520
|
-
console.log( req.files );
|
|
521
|
-
console.log( req.files.file );
|
|
522
518
|
let params = {
|
|
523
519
|
Bucket: JSON.parse( process.env.BUCKET ).storeBuilder,
|
|
524
520
|
Key: `${req.body.taskId}/${req.body.qno}/${Date.now()}/`,
|
|
@@ -946,13 +942,11 @@ export async function generatetaskDetails( req, res ) {
|
|
|
946
942
|
let taskDetails = await processedService.aggregate( query );
|
|
947
943
|
// ...( req.body.store.length ) ? { storeName: { $in: req.body.store } } : {}, taskId: { $in: taskDetails.flatMap( ( ele ) => ele.taskId ) } },
|
|
948
944
|
let processedTaskDetails = await planoTaskService.find( { date_string: { $gte: req.body.fromDate, $lte: req.body.toDate }, type: 'layout' }, { status: 1, planoId: 1, date_string: 1, _id: 0, taskId: 1 } );
|
|
949
|
-
console.log( processedTaskDetails.length );
|
|
950
945
|
|
|
951
946
|
processedTaskDetails = await Promise.all( processedTaskDetails.map( async ( ele ) => {
|
|
952
947
|
ele = { ...ele.toObject(), storeName: '' };
|
|
953
948
|
if ( ele.planoId ) {
|
|
954
949
|
let planoDetails = await planoService.findOne( { _id: ele.planoId }, { storeName: 1 } );
|
|
955
|
-
console.log( planoDetails );
|
|
956
950
|
if ( planoDetails ) {
|
|
957
951
|
ele.storeName = planoDetails.storeName;
|
|
958
952
|
}
|
|
@@ -988,7 +982,6 @@ export async function generatetaskDetails( req, res ) {
|
|
|
988
982
|
completeStore = Object.values( completeStore );
|
|
989
983
|
|
|
990
984
|
let completeStoreList = completeStore.map( ( item ) => item.storeName );
|
|
991
|
-
console.log( taskDetails );
|
|
992
985
|
|
|
993
986
|
let incompleteStore = taskDetails.filter( ( ele ) => ele.checklistStatus != 'submit' );
|
|
994
987
|
|
|
@@ -315,6 +315,7 @@ export const vmBulkUpload = {
|
|
|
315
315
|
export const createTemplateSchema = joi.object( {
|
|
316
316
|
clientId: joi.string().required(),
|
|
317
317
|
fixtureLibraryId: joi.string().required(),
|
|
318
|
+
templateType: joi.string().optional(),
|
|
318
319
|
} );
|
|
319
320
|
|
|
320
321
|
export const createTemplate = {
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import {
|
|
2
|
+
import { validate } from 'tango-app-api-middleware';
|
|
3
3
|
import * as fixtureTemplateController from '../controllers/fixtureTemplate.controller.js';
|
|
4
4
|
import * as validateDtos from '../dtos/validation.dtos.js';
|
|
5
5
|
|
|
6
|
+
import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
6
7
|
|
|
7
8
|
export const fixtureTemplateRouter = express.Router();
|
|
8
9
|
|
|
9
10
|
fixtureTemplateRouter
|
|
10
|
-
.post(
|
|
11
|
-
.post(
|
|
12
|
-
.post(
|
|
13
|
-
.post(
|
|
14
|
-
.post(
|
|
15
|
-
.get(
|
|
16
|
-
.post(
|
|
17
|
-
.post(
|
|
18
|
-
.post(
|
|
19
|
-
.post(
|
|
20
|
-
.post(
|
|
21
|
-
.get(
|
|
11
|
+
.post('/createTemplate', isAllowedSessionHandler, validate(validateDtos.createTemplate), fixtureTemplateController.createTemplate)
|
|
12
|
+
.post('/updateTemplate/:templateId', isAllowedSessionHandler, fixtureTemplateController.updateTemplate)
|
|
13
|
+
.post('/deleteTemplate', isAllowedSessionHandler, validate(validateDtos.templateId), fixtureTemplateController.deleteTemplate)
|
|
14
|
+
.post('/duplicateTemplate', isAllowedSessionHandler, validate(validateDtos.templateId), fixtureTemplateController.duplicateTemplate)
|
|
15
|
+
.post('/getTemplateList', isAllowedSessionHandler, validate(validateDtos.fixtureVMListSchema), fixtureTemplateController.getTemplateList)
|
|
16
|
+
.get('/getTemplateDetails', isAllowedSessionHandler, validate(validateDtos.queryTemplateId), fixtureTemplateController.getTemplateDetails)
|
|
17
|
+
.post('/updateFixtureTask', isAllowedSessionHandler, validate(validateDtos.updateFixtureTask), fixtureTemplateController.updateFixtureTask)
|
|
18
|
+
.post('/getAllTemplates', isAllowedSessionHandler, fixtureTemplateController.getAllTemplates)
|
|
19
|
+
.post('/assigedTemplate', isAllowedSessionHandler, fixtureTemplateController.assigedTemplate)
|
|
20
|
+
.post('/TemplateStoresList', isAllowedSessionHandler, fixtureTemplateController.TemplateStoresList)
|
|
21
|
+
.post('/replaceFixtureDetails', isAllowedSessionHandler, fixtureTemplateController.replaceFixtureDetails)
|
|
22
|
+
.get('/getTemplate', isAllowedSessionHandler, validate(validateDtos.queryTemplateId), fixtureTemplateController.getFixtureTemplate);
|
|
22
23
|
|
|
23
24
|
fixtureTemplateRouter
|
|
24
|
-
.post(
|
|
25
|
-
.post(
|
|
26
|
-
.get(
|
|
27
|
-
.get(
|
|
28
|
-
.post(
|
|
25
|
+
.post('/masterTemplateList', isAllowedSessionHandler, validate(validateDtos.fixtureVMListSchema), fixtureTemplateController.getMasterList)
|
|
26
|
+
.post('/templateChildList', isAllowedSessionHandler, validate(validateDtos.fixtureChildListSchema), fixtureTemplateController.getChildList)
|
|
27
|
+
.get('/templateTreeList', isAllowedSessionHandler, validate(validateDtos.templateTreeListSchema), fixtureTemplateController.getTreeList)
|
|
28
|
+
.get('/templateVersionList', isAllowedSessionHandler, fixtureTemplateController.templateVersionList)
|
|
29
|
+
.post('/templateAssignList', isAllowedSessionHandler, fixtureTemplateController.getTemplateStoreList);
|
|
29
30
|
|
|
@@ -6,24 +6,24 @@ import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
|
6
6
|
export const managePlanoRouter = express.Router();
|
|
7
7
|
|
|
8
8
|
managePlanoRouter
|
|
9
|
-
.post(
|
|
10
|
-
.post(
|
|
11
|
-
.post(
|
|
12
|
-
.post(
|
|
13
|
-
.get(
|
|
14
|
-
.get(
|
|
15
|
-
.get(
|
|
16
|
-
.get(
|
|
17
|
-
.get(
|
|
18
|
-
.post(
|
|
19
|
-
.post(
|
|
20
|
-
.post(
|
|
21
|
-
.post(
|
|
22
|
-
.post(
|
|
23
|
-
.post(
|
|
24
|
-
.post(
|
|
25
|
-
.post(
|
|
26
|
-
.post(
|
|
27
|
-
.post(
|
|
28
|
-
.post(
|
|
29
|
-
.post(
|
|
9
|
+
.post('/updateStorePlano', isAllowedSessionHandler, managePlanoController.updateStorePlano)
|
|
10
|
+
.post('/getplanoFeedback', isAllowedSessionHandler, managePlanoController.getplanoFeedback)
|
|
11
|
+
.post('/getplanoFeedbackv1', isAllowedSessionHandler, managePlanoController.getplanoFeedbackv1)
|
|
12
|
+
.post('/getStoreFixturesfeedback', isAllowedSessionHandler, managePlanoController.getStoreFixturesfeedback)
|
|
13
|
+
.get('/fixtureList', isAllowedSessionHandler, managePlanoController.fixtureList)
|
|
14
|
+
.get('/templateList', isAllowedSessionHandler, managePlanoController.templateList)
|
|
15
|
+
.get('/fixtureBrandsList', isAllowedSessionHandler, managePlanoController.fixtureBrandsList)
|
|
16
|
+
.get('/fixtureVMList', isAllowedSessionHandler, managePlanoController.fixtureVMList)
|
|
17
|
+
.get('/fixtureVMListv1', isAllowedSessionHandler, managePlanoController.fixtureVMListv1)
|
|
18
|
+
.post('/updateFixtureStatus', isAllowedSessionHandler, managePlanoController.updateFixtureStatus)
|
|
19
|
+
.post('/updateApprovalStatus', isAllowedSessionHandler, managePlanoController.updateApprovalStatus)
|
|
20
|
+
.post('/updateStoreFixture', isAllowedSessionHandler, managePlanoController.updateStoreFixture)
|
|
21
|
+
.post('/updateredostatus', isAllowedSessionHandler, managePlanoController.updateredostatus)
|
|
22
|
+
.post('/updateGlobalComment', isAllowedSessionHandler, managePlanoController.updateGlobalComment)
|
|
23
|
+
.post('/getGlobalComment', isAllowedSessionHandler, managePlanoController.getGlobalComment)
|
|
24
|
+
.post('/createRevision', isAllowedSessionHandler, managePlanoController.createPlanoRevision)
|
|
25
|
+
.post('/getRevisions', isAllowedSessionHandler, managePlanoController.getAllPlanoRevisions)
|
|
26
|
+
.post('/getRevisionData', isAllowedSessionHandler, managePlanoController.getPlanoRevisionById)
|
|
27
|
+
.post('/getRolloutFeedback', isAllowedSessionHandler, managePlanoController.getRolloutFeedback)
|
|
28
|
+
.post('/getRolloutFeedbackv2', isAllowedSessionHandler, managePlanoController.getRolloutFeedbackv2)
|
|
29
|
+
.post('/updateRolloutStatus', isAllowedSessionHandler, managePlanoController.updateRolloutStatus);
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import {
|
|
2
|
+
import { validate, isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
3
3
|
import * as planoLibraryController from '../controllers/planoLibrary.controller.js';
|
|
4
4
|
import * as validateDtos from '../dtos/validation.dtos.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
export const planoLibraryRouter = express.Router();
|
|
8
7
|
|
|
9
8
|
planoLibraryRouter
|
|
10
|
-
.post(
|
|
11
|
-
.post(
|
|
12
|
-
.post(
|
|
13
|
-
.get(
|
|
14
|
-
.post(
|
|
15
|
-
.post(
|
|
16
|
-
.post(
|
|
17
|
-
.get(
|
|
18
|
-
.get(
|
|
9
|
+
.post('/fixtureBulkUpload', isAllowedSessionHandler, validate(validateDtos.fixtureBulkUpload), planoLibraryController.fixtureBulkUpload)
|
|
10
|
+
.post('/createFixture', isAllowedSessionHandler, validate(validateDtos.createFixture), planoLibraryController.createFixture)
|
|
11
|
+
.post('/updateFixture/:fixtureId', isAllowedSessionHandler, validate(validateDtos.updateFixture), planoLibraryController.updateFixture)
|
|
12
|
+
.get('/fixtureDetails', isAllowedSessionHandler, validate(validateDtos.fixtureId), planoLibraryController.getFixture)
|
|
13
|
+
.post('/fixtureList', isAllowedSessionHandler, validate(validateDtos.fixtureVMListSchema), planoLibraryController.FixtureLibraryList)
|
|
14
|
+
.post('/duplicateFixture', isAllowedSessionHandler, validate(validateDtos.bodyFixtureId), planoLibraryController.duplicateFixture)
|
|
15
|
+
.post('/deleteFixture', isAllowedSessionHandler, validate(validateDtos.bodyFixtureId), planoLibraryController.deleteFixture)
|
|
16
|
+
.get('/fixtureSizeList', isAllowedSessionHandler, validate(validateDtos.getClient), planoLibraryController.getFixLibWidth)
|
|
17
|
+
.get('/fixtureNameList', isAllowedSessionHandler, validate(validateDtos.getClient), planoLibraryController.fixtureNameList)
|
|
18
|
+
.get('/fixtureLibNameList', isAllowedSessionHandler, validate(validateDtos.getClient), planoLibraryController.fixtureLibNameList);
|
|
19
19
|
|
|
20
20
|
planoLibraryRouter
|
|
21
|
-
.post(
|
|
22
|
-
.post(
|
|
23
|
-
.post(
|
|
24
|
-
.get(
|
|
25
|
-
.post(
|
|
21
|
+
.post('/addVmType', isAllowedSessionHandler, validate(validateDtos.addVmType), planoLibraryController.addVmType)
|
|
22
|
+
.post('/uploadVmtypeImage/:vmId', isAllowedSessionHandler, planoLibraryController.uploadVmImage)
|
|
23
|
+
.post('/deleteVmType', isAllowedSessionHandler, planoLibraryController.deleteVmType)
|
|
24
|
+
.get('/getVmTypeList', isAllowedSessionHandler, validate(validateDtos.getClient), planoLibraryController.getVmTypeList)
|
|
25
|
+
.post('/deleteVmTypeImage', isAllowedSessionHandler, validate(validateDtos.deleteVMTypeImage), planoLibraryController.deletevmTypeImage);
|
|
26
26
|
|
|
27
27
|
planoLibraryRouter
|
|
28
|
-
.post(
|
|
29
|
-
.post(
|
|
30
|
-
.post(
|
|
31
|
-
.post(
|
|
32
|
-
.get(
|
|
28
|
+
.post('/getBrandList', isAllowedSessionHandler, validate(validateDtos.brandDetails), planoLibraryController.getBrandList)
|
|
29
|
+
.post('/addUpdateBrand', isAllowedSessionHandler, validate(validateDtos.addUpdateBrand), planoLibraryController.addUpdateBrandList)
|
|
30
|
+
.post('/uploadBrandList', isAllowedSessionHandler, validate(validateDtos.uploadBrandList), planoLibraryController.uploadBrandList)
|
|
31
|
+
.post('/updateTaskconfig', isAllowedSessionHandler, validate(validateDtos.updateTaskConfig), planoLibraryController.updateTaskConfig)
|
|
32
|
+
.get('/getTaskConfig', isAllowedSessionHandler, validate(validateDtos.getClient), planoLibraryController.getTaskConfig);
|
|
33
33
|
|
|
34
34
|
planoLibraryRouter
|
|
35
|
-
.post(
|
|
36
|
-
.post(
|
|
37
|
-
.post(
|
|
38
|
-
.post(
|
|
39
|
-
.get(
|
|
40
|
-
.post(
|
|
41
|
-
.get(
|
|
35
|
+
.post('/addUpdateVm', isAllowedSessionHandler, validate(validateDtos.addUpdateVm), planoLibraryController.addUpdateVm)
|
|
36
|
+
.post('/getVmLibList', isAllowedSessionHandler, validate(validateDtos.fixtureVMListSchema), planoLibraryController.getVmLibList)
|
|
37
|
+
.post('/duplicateVmLib', isAllowedSessionHandler, validate(validateDtos.deleteVmLib), planoLibraryController.duplicateVmLib)
|
|
38
|
+
.post('/deleteVmLib', isAllowedSessionHandler, validate(validateDtos.deleteVmLib), planoLibraryController.deleteVmLibrary)
|
|
39
|
+
.get('/getVmDetails', isAllowedSessionHandler, validate(validateDtos.getVmDetails), planoLibraryController.getVmDetails)
|
|
40
|
+
.post('/vmBulkUpload', isAllowedSessionHandler, validate(validateDtos.vmBulkUpload), planoLibraryController.vmBulkUpload)
|
|
41
|
+
.get('/vmNameList', isAllowedSessionHandler, validate(validateDtos.getClient), planoLibraryController.vmNameList);
|
|
42
42
|
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
|
|
3
|
-
export const scriptRouter = express.Router();
|
|
4
3
|
import * as scriptController from '../controllers/script.controller.js';
|
|
4
|
+
import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
5
5
|
|
|
6
|
+
export const scriptRouter = express.Router();
|
|
6
7
|
|
|
7
8
|
scriptRouter
|
|
8
|
-
.post(
|
|
9
|
-
.post(
|
|
10
|
-
.post(
|
|
11
|
-
.post(
|
|
12
|
-
.post(
|
|
13
|
-
.post(
|
|
14
|
-
.post(
|
|
15
|
-
.post(
|
|
16
|
-
.post(
|
|
17
|
-
.post(
|
|
18
|
-
.post(
|
|
19
|
-
.post(
|
|
20
|
-
.post(
|
|
21
|
-
.post(
|
|
22
|
-
.post(
|
|
23
|
-
.post(
|
|
24
|
-
.post(
|
|
25
|
-
.post(
|
|
26
|
-
.post(
|
|
27
|
-
.post(
|
|
28
|
-
.post(
|
|
29
|
-
.post(
|
|
30
|
-
.post(
|
|
31
|
-
.post(
|
|
32
|
-
.post(
|
|
33
|
-
.post(
|
|
34
|
-
.post(
|
|
35
|
-
.post(
|
|
36
|
-
.post(
|
|
9
|
+
.post('/getUniqueStoresFromExcel', scriptController.getStoreNames)
|
|
10
|
+
.post('/bilkInsertFixtureConfig', scriptController.createFixtureConfig)
|
|
11
|
+
.post('/bulkInsertPlanoData', scriptController.createPlano)
|
|
12
|
+
.post('/bulkIinsertFloorData', scriptController.createFloors)
|
|
13
|
+
.post('/bulkIinsertVmTemplateData', scriptController.createVmData)
|
|
14
|
+
.post('/bulkIinsertFixturesShelvesVmsData', scriptController.createFixturesShelves)
|
|
15
|
+
.post('/updateFixturesShelvesVms', scriptController.updateFixturesShelves)
|
|
16
|
+
.post('/lk98lK1993Update', scriptController.lk98lK1993Update)
|
|
17
|
+
.post('/updateinventory', scriptController.updateInventory)
|
|
18
|
+
.post('/updateRfidProduct', scriptController.updateRfidProduct)
|
|
19
|
+
.post('/updateRfidProduct2', scriptController.updateRfidProduct2)
|
|
20
|
+
.post('/getProdTaskData', scriptController.getProdTaskData)
|
|
21
|
+
.post('/updateLayoutFeedback', scriptController.updatelayoutFeedback)
|
|
22
|
+
.post('/updateFixtureFeedback', scriptController.updateFixtureFeedback)
|
|
23
|
+
.post('/getFileNames', scriptController.extractZipFileNames)
|
|
24
|
+
.post('/getVmTaskData', scriptController.getVmTaskData)
|
|
25
|
+
.post('/updateVmData', scriptController.updateVmData)
|
|
26
|
+
.post('/createCrestPlanogram', scriptController.createCrestPlanogram)
|
|
27
|
+
.post('/updateCrestPlanogram', scriptController.updateCrestPlanogram)
|
|
28
|
+
.post('/updatelayout', scriptController.updatelayout)
|
|
29
|
+
.post('/updateCrestVms', scriptController.updateCrestVms)
|
|
30
|
+
.post('/downloadPlanoImages', scriptController.downloadPlanoImage)
|
|
31
|
+
.post('/getVideoUrls', scriptController.getVideoLinks)
|
|
32
|
+
.post('/updateExcelPlanogram', scriptController.updateExcelPlanogram)
|
|
33
|
+
.post('/recorrectTaskData', scriptController.recorrectTaskData)
|
|
34
|
+
.post('/migrateCrest', scriptController.migrateCrestv1)
|
|
35
|
+
.post('/updatePlanoMappings', scriptController.updatePlanoMappings)
|
|
36
|
+
.post('/readExcel', scriptController.readExcel)
|
|
37
|
+
.post('/migrateOvmToIvm', scriptController.migrateOvmToIvm)
|
|
37
38
|
// .post( '/migrateOvmToOvm', scriptController.migrateOvmToOvm )
|
|
38
|
-
.post(
|
|
39
|
-
.post(
|
|
40
|
-
.post(
|
|
41
|
-
.post(
|
|
42
|
-
.get(
|
|
43
|
-
;
|
|
39
|
+
.post('/groupFixture', scriptController.groupFixture)
|
|
40
|
+
.post('/productMappings', scriptController.productMappings)
|
|
41
|
+
.post('/productMappings', scriptController.productMappings)
|
|
42
|
+
.post('/complianceFromMappings', scriptController.createComplianceFromMappins)
|
|
43
|
+
.get('/getAllPlanoIdsM', scriptController.getAllPlanoIds)
|
|
44
|
+
;
|
|
@@ -1,67 +1,68 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { validate, isAllowedSessionHandler, getAssinedStore } from 'tango-app-api-middleware';
|
|
3
|
+
import * as validateDtos from '../dtos/validation.dtos.js';
|
|
3
4
|
import * as storeBuilderController from '../controllers/storeBuilder.controller.js';
|
|
4
5
|
// import * as scriptController from '../controllers/script.controller.js';
|
|
5
|
-
import * as validateDtos from '../dtos/validation.dtos.js';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export const storeBuilderRouter = express.Router();
|
|
9
9
|
|
|
10
10
|
storeBuilderRouter
|
|
11
|
-
.post(
|
|
12
|
-
.post(
|
|
13
|
-
.post(
|
|
14
|
-
.post(
|
|
15
|
-
.post(
|
|
16
|
-
.post(
|
|
17
|
-
// .post( '/storeLayout', validate( validateDtos.storeList ), storeBuilderController.storeFixtures )
|
|
18
|
-
.post(
|
|
19
|
-
.delete(
|
|
20
|
-
.post(
|
|
21
|
-
.post(
|
|
22
|
-
.post(
|
|
23
|
-
// .post( '/FixtureShelfDetails', storeBuilderController.fixtureShelfProduct )
|
|
24
|
-
// .post( '/scan', storeBuilderController.scan )
|
|
25
|
-
.post(
|
|
26
|
-
.post(
|
|
27
|
-
.post(
|
|
28
|
-
.post(
|
|
29
|
-
.post(
|
|
30
|
-
.post(
|
|
31
|
-
.post(
|
|
32
|
-
.post(
|
|
33
|
-
.post(
|
|
34
|
-
.post(
|
|
35
|
-
.post(
|
|
36
|
-
.post(
|
|
37
|
-
.post(
|
|
38
|
-
.post(
|
|
39
|
-
.post(
|
|
40
|
-
.post(
|
|
41
|
-
.post(
|
|
42
|
-
.post(
|
|
43
|
-
.post(
|
|
44
|
-
.post(
|
|
45
|
-
.post(
|
|
46
|
-
.post(
|
|
47
|
-
.post(
|
|
48
|
-
.post(
|
|
49
|
-
.post(
|
|
50
|
-
.post(
|
|
51
|
-
.post(
|
|
52
|
-
.post(
|
|
53
|
-
.post(
|
|
54
|
-
.post(
|
|
55
|
-
.post(
|
|
56
|
-
.post(
|
|
57
|
-
.post(
|
|
11
|
+
.post('/createStoreLayout', isAllowedSessionHandler, validate(validateDtos.createBuilder), storeBuilderController.createStoreBuilder)
|
|
12
|
+
.post('/updateStoreLayout', isAllowedSessionHandler, validate(validateDtos.updateStoreLayout), storeBuilderController.updateStoreLayout)
|
|
13
|
+
.post('/storeLayoutList', isAllowedSessionHandler, validate(validateDtos.storeLayoutList), storeBuilderController.getLayoutList)
|
|
14
|
+
.post('/updateFloor', isAllowedSessionHandler, validate(validateDtos.updateFloor), storeBuilderController.updateFloor)
|
|
15
|
+
.post('/uploadBulkStore', isAllowedSessionHandler, storeBuilderController.uploadBulkStore)
|
|
16
|
+
.post('/uploadFile', isAllowedSessionHandler, storeBuilderController.uploadFile)
|
|
17
|
+
// .post( '/storeLayout',isAllowedSessionHandler, validate( validateDtos.storeList ), storeBuilderController.storeFixtures )
|
|
18
|
+
.post('/storeDetails', isAllowedSessionHandler, validate(validateDtos.storeDetails), storeBuilderController.getStoreDetails)
|
|
19
|
+
.delete('/deleteStoreLayout/:id', isAllowedSessionHandler, validate(validateDtos.deleteStoreLayout), storeBuilderController.deleteStoreLayout)
|
|
20
|
+
.post('/removeFile', isAllowedSessionHandler, storeBuilderController.deleteFile)
|
|
21
|
+
.post('/deleteFloor', isAllowedSessionHandler, storeBuilderController.deleteFloor)
|
|
22
|
+
.post('/updateStatus', isAllowedSessionHandler, validate(validateDtos.updateStatus), storeBuilderController.updateStatus)
|
|
23
|
+
// .post( '/FixtureShelfDetails',isAllowedSessionHandler, storeBuilderController.fixtureShelfProduct )
|
|
24
|
+
// .post( '/scan',isAllowedSessionHandler, storeBuilderController.scan )
|
|
25
|
+
.post('/storeLayout', isAllowedSessionHandler, validate(validateDtos.storeList), storeBuilderController.storeLayout)
|
|
26
|
+
.post('/storeFixtures', isAllowedSessionHandler, validate(validateDtos.storeList), storeBuilderController.storeFixturesv1)
|
|
27
|
+
.post('/FixtureShelfDetails', isAllowedSessionHandler, validate(validateDtos.fixtureShelfProduct), storeBuilderController.fixtureShelfProductv1)
|
|
28
|
+
.post('/scan', isAllowedSessionHandler, storeBuilderController.scanv1)
|
|
29
|
+
.post('/updateMissing', isAllowedSessionHandler, storeBuilderController.updateMissing)
|
|
30
|
+
.post('/bulkFixtureUpload', isAllowedSessionHandler, storeBuilderController.bulkFixtureUpload)
|
|
31
|
+
.post('/uploadImage', isAllowedSessionHandler, storeBuilderController.uploadImage)
|
|
32
|
+
.post('/storeFixturesTask', isAllowedSessionHandler, storeBuilderController.storeFixturesTask)
|
|
33
|
+
.post('/qrFileUpload', isAllowedSessionHandler, storeBuilderController.qrFileUpload)
|
|
34
|
+
.post('/updateQrCvProcessRequest', isAllowedSessionHandler, storeBuilderController.updateQrCvProcessRequest)
|
|
35
|
+
.post('/getQrCvProcessRequest', isAllowedSessionHandler, storeBuilderController.getQrCvProcessRequest)
|
|
36
|
+
.post('/fixtureQrUpdate', isAllowedSessionHandler, storeBuilderController.fixtureQrUpdate)
|
|
37
|
+
.post('/fixtureQrUpdatev1', isAllowedSessionHandler, storeBuilderController.fixtureQrUpdatev1)
|
|
38
|
+
.post('/updateDeatailedDistance', isAllowedSessionHandler, storeBuilderController.updateDetailedDistance)
|
|
39
|
+
.post('/upsertFixture', isAllowedSessionHandler, storeBuilderController.upsertFixtures)
|
|
40
|
+
.post('/getshelfSections', isAllowedSessionHandler, storeBuilderController.getShelfSections)
|
|
41
|
+
.post('/getFixtureTypes', isAllowedSessionHandler, storeBuilderController.getFixtureTypes)
|
|
42
|
+
.post('/getFixtureLengths', isAllowedSessionHandler, storeBuilderController.getFixtureLengths)
|
|
43
|
+
.post('/getFixtureBrands', isAllowedSessionHandler, storeBuilderController.getFixtureBrands)
|
|
44
|
+
.post('/checkPlanoExist', isAllowedSessionHandler, storeBuilderController.checkPlanoExist)
|
|
45
|
+
.post('/storeLayoutElements', isAllowedSessionHandler, storeBuilderController.storeLayoutElements)
|
|
46
|
+
.post('/qrScan', isAllowedSessionHandler, storeBuilderController.qrScan)
|
|
47
|
+
.post('/storeFixturesV2', isAllowedSessionHandler, validate(validateDtos.storeList), storeBuilderController.storeFixturesv2)
|
|
48
|
+
.post('/fixtureShelfDetailsv2', isAllowedSessionHandler, validate(validateDtos.fixtureShelfProduct), storeBuilderController.fixtureShelfProductv2)
|
|
49
|
+
.post('/storeFixturesTaskv2', isAllowedSessionHandler, storeBuilderController.storeFixturesTaskv2)
|
|
50
|
+
.post('/qrScan1', isAllowedSessionHandler, storeBuilderController.qrScan1)
|
|
51
|
+
.post('/storeFixturesV2', isAllowedSessionHandler, validate(validateDtos.storeList), storeBuilderController.storeFixturesv2)
|
|
52
|
+
.post('/storeFixturesV3', isAllowedSessionHandler, validate(validateDtos.storeList), storeBuilderController.storeFixturesv3)
|
|
53
|
+
.post('/fixtureShelfDetailsv2', isAllowedSessionHandler, validate(validateDtos.fixtureShelfProduct), storeBuilderController.fixtureShelfProductv2)
|
|
54
|
+
.post('/fixtureShelfDetailsv3', isAllowedSessionHandler, validate(validateDtos.fixtureShelfProduct), storeBuilderController.fixtureShelfProductv3)
|
|
55
|
+
.post('/storeFixturesTaskv2', isAllowedSessionHandler, storeBuilderController.storeFixturesTaskv2)
|
|
56
|
+
.post('/storeFixturesTaskv3', isAllowedSessionHandler, storeBuilderController.storeFixturesTaskv3)
|
|
57
|
+
.post('/searchProduct', isAllowedSessionHandler, storeBuilderController.searchProduct);
|
|
58
58
|
|
|
59
59
|
storeBuilderRouter
|
|
60
|
-
.post(
|
|
61
|
-
.get(
|
|
62
|
-
.get(
|
|
63
|
-
.post(
|
|
64
|
-
.get(
|
|
65
|
-
.get(
|
|
66
|
-
.get(
|
|
67
|
-
.get(
|
|
60
|
+
.post('/planoList', isAllowedSessionHandler, getAssinedStore, storeBuilderController.planoList)
|
|
61
|
+
.get('/taskDetails', isAllowedSessionHandler, storeBuilderController.getTaskDetails)
|
|
62
|
+
.get('/getPlanoUser', isAllowedSessionHandler, storeBuilderController.getPlanoUser)
|
|
63
|
+
.post('/planoRolloutList', isAllowedSessionHandler, storeBuilderController.getRolloutDetails)
|
|
64
|
+
.get('/getRolloutTaskDetails', isAllowedSessionHandler, storeBuilderController.getRolloutTaskDetails)
|
|
65
|
+
.get('/getScandid', isAllowedSessionHandler, storeBuilderController.getScandid)
|
|
66
|
+
.get('/getPlanoStoreList', isAllowedSessionHandler, storeBuilderController.getPlanoStoreList)
|
|
67
|
+
.get('/getFixtureAIDetails', isAllowedSessionHandler, storeBuilderController.getFixtureAIDetails)
|
|
68
|
+
.post('/getPlanogramList', isAllowedSessionHandler, storeBuilderController.getPlanogramList);
|
|
@@ -5,16 +5,16 @@ import * as taskController from '../controllers/task.controller.js';
|
|
|
5
5
|
export const storeBuilderTaskRouter = express.Router();
|
|
6
6
|
|
|
7
7
|
storeBuilderTaskRouter
|
|
8
|
-
.post(
|
|
9
|
-
.post(
|
|
10
|
-
.get(
|
|
11
|
-
.post(
|
|
12
|
-
.post(
|
|
13
|
-
.post(
|
|
14
|
-
.post(
|
|
15
|
-
.get(
|
|
16
|
-
.get(
|
|
17
|
-
.post(
|
|
18
|
-
.post(
|
|
19
|
-
.post(
|
|
20
|
-
.post(
|
|
8
|
+
.post('/createTask', isAllowedSessionHandler, taskController.createTask)
|
|
9
|
+
.post('/createPlano', isAllowedSessionHandler, taskController.createPlano)
|
|
10
|
+
.get('/taskDetails', isAllowedSessionHandler, taskController.getTaskDetails)
|
|
11
|
+
.post('/uploadImage', isAllowedSessionHandler, taskController.uploadImage)
|
|
12
|
+
.post('/updateStatus', isAllowedSessionHandler, taskController.updateStatus)
|
|
13
|
+
.post('/updateAnswers', isAllowedSessionHandler, taskController.updateAnswers)
|
|
14
|
+
.post('/updateAnswersv2', isAllowedSessionHandler, taskController.updateAnswersv2)
|
|
15
|
+
.get('/getFixtureDetails', isAllowedSessionHandler, taskController.getFixtureDetails)
|
|
16
|
+
.get('/getVmDetails', isAllowedSessionHandler, taskController.getVmDetails)
|
|
17
|
+
.post('/generateTaskExcel', isAllowedSessionHandler, taskController.generatetaskDetails)
|
|
18
|
+
.post('/getSubmitDetails', isAllowedSessionHandler, taskController.taskSubmitDetails)
|
|
19
|
+
.post('/redoTask', isAllowedSessionHandler, taskController.redoTask)
|
|
20
|
+
.post('/revokeTask', isAllowedSessionHandler, taskController.revokeTask);
|