tango-app-api-store-builder 1.0.0-beta-110 → 1.0.0-beta-112

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.
@@ -206,5 +206,261 @@
206
206
  ]
207
207
  }
208
208
  ]
209
- }
209
+ },
210
+ {
211
+ "taskId" : "6841260651d4dcf69692e5ac",
212
+ "type" : "fixture",
213
+ "date_string" : "2025-06-06",
214
+ "planoId" : "682b18eb53b873e2bef85f48",
215
+ "fixtureId" : "684681d3a637439f61da0200",
216
+ "floorId" : "6819df849741a6b2e0d70904",
217
+ "answers" : [
218
+ {
219
+ "userId" : "6819df859741a6b2e0d7090e",
220
+ "userName" : "LKST98",
221
+ "role" : "admin",
222
+ "issues" : [
223
+ {
224
+ "userId" : "6819df859741a6b2e0d7090e",
225
+ "userName" : "LKST98",
226
+ "role" : "admin",
227
+ "qno" : 1,
228
+ "question" : "Fixture type is wrong",
229
+ "Details" : [
230
+ {
231
+ "comments" : [
232
+ {
233
+ "userId" : "681d967e72e969324794af2a",
234
+ "userName" : "hastinapuram.chennai",
235
+ "role" : "user",
236
+ "comment" : "the above one fixture is missing from the store",
237
+ "responsetype" : "comment"
238
+ }
239
+ ],
240
+ "fixtureId" : "6837eace2692f29eff7f8f69",
241
+ "templateId" : "6837eed55caa00ec973be4c8",
242
+ "fixtureName" : "Template04-Second Floor Fixture",
243
+ "fixturetype" : "Hybrid_4ft",
244
+ "fixturetemplate" : "Temp_hybd_5ft_Vincent Chase+Lenskart",
245
+ "associatedElementFixtureNumber" : 1,
246
+ "associatedElementNumber" : 1,
247
+ "associatedElementType" : "wall",
248
+ "shelfConfig" : [
249
+ {
250
+ "shelfNumber" : 1,
251
+ "shelfType" : "",
252
+ "productPerShelf" : 6,
253
+ "trayRows" : 5,
254
+ "fixtureBrandCategory" : [],
255
+ "fixtureBrandSubCategory" : []
256
+ },
257
+ {
258
+ "shelfNumber" : 2,
259
+ "shelfType" : "",
260
+ "productPerShelf" : 6,
261
+ "trayRows" : 5,
262
+ "fixtureBrandCategory" : [],
263
+ "fixtureBrandSubCategory" : []
264
+ }
265
+ ]
266
+ }
267
+ ]
268
+ },
269
+ {
270
+ "userId" : "6819df859741a6b2e0d7090e",
271
+ "userName" : "LKST98",
272
+ "role" : "admin",
273
+ "qno" : 2,
274
+ "question" : "Fixture size is wrong",
275
+ "video" : "",
276
+ "image" : "",
277
+ "Details" : [
278
+ {
279
+ "comments" : [
280
+ {
281
+ "userId" : "681d967e72e969324794af2a",
282
+ "userName" : "hastinapuram.chennai",
283
+ "role" : "user",
284
+ "comment" : "the above one fixture is missing from the plano",
285
+ "responsetype" : "comment"
286
+ }
287
+ ],
288
+ "fixturetype" : "Hybrid_4ft",
289
+ "shelfConfig" : [
290
+ {
291
+ "shelfNumber" : 1,
292
+ "shelfType" : "",
293
+ "productPerShelf" : 6,
294
+ "trayRows" : 5,
295
+ "fixtureBrandCategory" : [],
296
+ "fixtureBrandSubCategory" : []
297
+ },
298
+ {
299
+ "shelfNumber" : 2,
300
+ "shelfType" : "",
301
+ "productPerShelf" : 6,
302
+ "trayRows" : 5,
303
+ "fixtureBrandCategory" : [],
304
+ "fixtureBrandSubCategory" : []
305
+ }
306
+ ]
307
+ }
308
+ ]
309
+ },
310
+ {
311
+ "userId" : "6819df859741a6b2e0d7090e",
312
+ "userName" : "LKST98",
313
+ "role" : "admin",
314
+ "qno" : 2,
315
+ "question" : "Product category is wrong",
316
+ "video" : "",
317
+ "image" : "",
318
+ "Details" : [
319
+ {
320
+ "comments" : [
321
+ {
322
+ "userId" : "681d967e72e969324794af2a",
323
+ "userName" : "hastinapuram.chennai",
324
+ "role" : "user",
325
+ "comment" : "the above one fixture is missing from the plano",
326
+ "responsetype" : "comment"
327
+ }
328
+ ],
329
+ "fixturetype" : "Hybrid_4ft",
330
+ "shelfConfig" : [
331
+ {
332
+ "shelfNumber" : 1,
333
+ "shelfType" : "",
334
+ "productPerShelf" : 6,
335
+ "trayRows" : 5,
336
+ "zone":"middle",
337
+ "fixtureBrandCategory" : [],
338
+ "fixtureBrandSubCategory" : []
339
+ },
340
+ {
341
+ "shelfNumber" : 2,
342
+ "shelfType" : "",
343
+ "productPerShelf" : 6,
344
+ "trayRows" : 5,
345
+ "zone":"bottom",
346
+ "fixtureBrandCategory" : [],
347
+ "fixtureBrandSubCategory" : []
348
+ }
349
+ ]
350
+ }
351
+ ]
352
+ },
353
+ {
354
+ "userId" : "6819df859741a6b2e0d7090e",
355
+ "userName" : "LKST98",
356
+ "role" : "admin",
357
+ "qno" : 2,
358
+ "question" : "Product category is wrong",
359
+ "video" : "",
360
+ "image" : "",
361
+ "Details" : [
362
+ {
363
+ "comments" : [
364
+ {
365
+ "userId" : "681d967e72e969324794af2a",
366
+ "userName" : "hastinapuram.chennai",
367
+ "role" : "user",
368
+ "comment" : "the above one fixture is missing from the plano",
369
+ "responsetype" : "comment"
370
+ }
371
+ ],
372
+ "fixturetype" : "Hybrid_4ft",
373
+ "shelfConfig" : [
374
+ {
375
+ "shelfNumber" : 1,
376
+ "shelfType" : "",
377
+ "productPerShelf" : 6,
378
+ "trayRows" : 5,
379
+ "zone":"middle",
380
+ "fixtureBrandCategory" : [],
381
+ "fixtureBrandSubCategory" : []
382
+ },
383
+ {
384
+ "shelfNumber" : 2,
385
+ "shelfType" : "",
386
+ "productPerShelf" : 6,
387
+ "trayRows" : 5,
388
+ "zone":"middle",
389
+ "fixtureBrandCategory" : [],
390
+ "fixtureBrandSubCategory" : []
391
+ },
392
+ {
393
+ "shelfNumber" : 2,
394
+ "shelfType" : "",
395
+ "productPerShelf" : 6,
396
+ "trayRows" : 5,
397
+ "zone":"bottom",
398
+ "fixtureBrandCategory" : [],
399
+ "fixtureBrandSubCategory" : []
400
+ }
401
+ ]
402
+ }
403
+ ]
404
+ },
405
+ {
406
+ "userId" : "6819df859741a6b2e0d7090e",
407
+ "userName" : "LKST98",
408
+ "role" : "admin",
409
+ "qno" : 2,
410
+ "question" : "Brand is wrong",
411
+ "video" : "",
412
+ "image" : "",
413
+ "Details" : [
414
+ {
415
+ "comments" : [
416
+ {
417
+ "userId" : "681d967e72e969324794af2a",
418
+ "userName" : "hastinapuram.chennai",
419
+ "role" : "user",
420
+ "comment" : "the above one fixture is missing from the plano",
421
+ "responsetype" : "comment"
422
+ }
423
+ ],
424
+ "fixturetype" : "Hybrid_4ft",
425
+ "shelfConfig" : [
426
+ {
427
+ "shelfNumber" : 1,
428
+ "shelfType" : "",
429
+ "productPerShelf" : 6,
430
+ "trayRows" : 5,
431
+ "zone":"middle",
432
+ "fixtureBrandCategory" : [],
433
+ "fixtureBrandSubCategory" : []
434
+ },
435
+ {
436
+ "shelfNumber" : 2,
437
+ "shelfType" : "",
438
+ "productPerShelf" : 6,
439
+ "trayRows" : 5,
440
+ "zone":"middle",
441
+ "fixtureBrandCategory" : [],
442
+ "fixtureBrandSubCategory" : []
443
+ },
444
+ {
445
+ "shelfNumber" : 2,
446
+ "shelfType" : "",
447
+ "productPerShelf" : 6,
448
+ "trayRows" : 5,
449
+ "zone":"bottom",
450
+ "fixtureBrandCategory" : [],
451
+ "fixtureBrandSubCategory" : []
452
+ }
453
+ ]
454
+ }
455
+ ]
456
+ }
457
+ ]
458
+ }
459
+ ],
460
+
461
+ "date_iso" : "2025-06-06T00:00:00.000Z",
462
+ "storeId" : "11-4",
463
+ "storeName" : "LKST98",
464
+ "status":"incomplete"
465
+ }
210
466
  ]
package/package.json CHANGED
@@ -1,49 +1,50 @@
1
1
  {
2
- "name": "tango-app-api-store-builder",
3
- "version": "1.0.0-beta-110",
4
- "description": "storeBuilder",
5
- "main": "index.js",
6
- "type": "module",
7
- "scripts": {
8
- "start": "nodemon --exec \"eslint --fix . && node index.js\""
9
- },
10
- "engines": {
11
- "node": ">=18.10.0"
12
- },
13
- "author": "praveenraj",
14
- "license": "ISC",
15
- "dependencies": {
16
- "aws-sdk": "^2.1692.0",
17
- "chromedriver": "^135.0.1",
18
- "cors": "^2.8.5",
19
- "dayjs": "^1.11.13",
20
- "dotenv": "^16.4.7",
21
- "exceljs": "^4.4.0",
22
- "express": "^4.21.2",
23
- "express-fileupload": "^1.5.1",
24
- "fetch-cookie": "^3.1.0",
25
- "handlebars": "^4.7.8",
26
- "joi": "^17.13.3",
27
- "jszip": "^3.10.1",
28
- "node-fetch": "^2.7.0",
29
- "nodemon": "^3.1.9",
30
- "os": "^0.1.2",
31
- "path": "^0.12.7",
32
- "selenium-webdriver": "^4.31.0",
33
- "sharp": "^0.34.1",
34
- "tango-api-schema": "^3.0.3",
35
- "tango-app-api-middleware": "^3.1.82",
36
- "url": "^0.11.4",
37
- "winston": "^3.17.0",
38
- "winston-daily-rotate-file": "^5.0.0",
39
- "xlsx": "^0.18.5"
40
- },
41
- "devDependencies": {
42
- "eslint": "^8.57.1",
43
- "eslint-config-google": "^0.14.0",
44
- "eslint-config-semistandard": "^17.0.0",
45
- "eslint-config-standard": "^17.1.0",
46
- "eslint-plugin-import": "^2.31.0",
47
- "eslint-plugin-promise": "^6.6.0"
48
- }
2
+ "name": "tango-app-api-store-builder",
3
+ "version": "1.0.0-beta-112",
4
+ "description": "storeBuilder",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "start": "nodemon --exec \"eslint --fix . && node index.js\""
9
+ },
10
+ "engines": {
11
+ "node": ">=18.10.0"
12
+ },
13
+ "author": "praveenraj",
14
+ "license": "ISC",
15
+ "dependencies": {
16
+ "aws-sdk": "^2.1692.0",
17
+ "chromedriver": "^135.0.1",
18
+ "cors": "^2.8.5",
19
+ "dayjs": "^1.11.13",
20
+ "dotenv": "^16.4.7",
21
+ "exceljs": "^4.4.0",
22
+ "express": "^4.21.2",
23
+ "express-fileupload": "^1.5.1",
24
+ "fetch-cookie": "^3.1.0",
25
+ "handlebars": "^4.7.8",
26
+ "joi": "^17.13.3",
27
+ "jszip": "^3.10.1",
28
+ "mongodb": "^6.12.0",
29
+ "node-fetch": "^2.7.0",
30
+ "nodemon": "^3.1.9",
31
+ "os": "^0.1.2",
32
+ "path": "^0.12.7",
33
+ "selenium-webdriver": "^4.31.0",
34
+ "sharp": "^0.34.1",
35
+ "tango-api-schema": "2.2.151",
36
+ "tango-app-api-middleware": "^3.1.48",
37
+ "url": "^0.11.4",
38
+ "winston": "^3.17.0",
39
+ "winston-daily-rotate-file": "^5.0.0",
40
+ "xlsx": "^0.18.5"
41
+ },
42
+ "devDependencies": {
43
+ "eslint": "^8.57.1",
44
+ "eslint-config-google": "^0.14.0",
45
+ "eslint-config-semistandard": "^17.0.0",
46
+ "eslint-config-standard": "^17.1.0",
47
+ "eslint-plugin-import": "^2.31.0",
48
+ "eslint-plugin-promise": "^6.6.0"
49
+ }
49
50
  }
@@ -1,10 +1,11 @@
1
- // import * as storeBuilderService from '../service/storeBuilder.service.js';
1
+ import * as floorService from '../service/storeBuilder.service.js';
2
+ import { logger } from 'tango-app-api-middleware';
2
3
  // import * as storeService from '../service/store.service.js';
3
4
  // import * as planoService from '../service/planogram.service.js';
4
- // import * as storeFixtureService from '../service/storeFixture.service.js';
5
- // import * as fixtureShelfService from '../service/fixtureShelf.service.js';
5
+ import * as storeFixtureService from '../service/storeFixture.service.js';
6
+ import * as fixtureShelfService from '../service/fixtureShelf.service.js';
6
7
  // import * as planoProductService from '../service/planoProduct.service.js';
7
- // import * as planoVmService from '../service/planoVm.service.js';
8
+ import * as planoVmService from '../service/planoVm.service.js';
8
9
  // import * as planoMappingService from '../service/planoMapping.service.js';
9
10
  // import * as planoTaskService from '../service/planoTask.service.js';
10
11
  // import * as processedTaskService from '../service/processedTaskservice.js';
@@ -12,7 +13,6 @@ import * as planoproductCategoryService from '../service/planoproductCategory.se
12
13
  import * as fixtureConfigService from '../service/fixtureConfig.service.js';
13
14
  import * as fixtureLibraryService from '../service/planoLibrary.service.js';
14
15
  import * as planoTaskService from '../service/planoTask.service.js';
15
- import { logger } from 'tango-app-api-middleware';
16
16
  import mongoose from 'mongoose';
17
17
  export async function getplanoFeedback( req, res ) {
18
18
  try {
@@ -57,8 +57,70 @@ export async function getplanoFeedback( req, res ) {
57
57
 
58
58
 
59
59
  let findPlanoCompliance = await planoTaskService.aggregate( query );
60
+ let queryfixture = [];
60
61
 
61
- res.sendSuccess( findPlanoCompliance );
62
+
63
+ queryfixture.push( {
64
+ $match: {
65
+ planoId: new mongoose.Types.ObjectId( req.body.planoId ),
66
+ floorId: new mongoose.Types.ObjectId( req.body.floorId ),
67
+ type: { $ne: 'layout' },
68
+ },
69
+ },
70
+ {
71
+ $lookup: {
72
+ from: 'processedtasks',
73
+ let: { 'taskId': '$taskId' },
74
+ pipeline: [
75
+ {
76
+ $match: {
77
+ $expr: {
78
+ $and: [
79
+ { $eq: [ '$_id', '$$taskId' ] },
80
+ ],
81
+ },
82
+ },
83
+ },
84
+ {
85
+ $project: {
86
+ 'userName': 1,
87
+ 'createdAt': 1,
88
+ 'createdByName': 1,
89
+ 'submitTime_string': 1,
90
+ },
91
+ },
92
+ ],
93
+ as: 'taskData',
94
+ },
95
+
96
+ }, { $unwind: { path: '$taskData', preserveNullAndEmptyArrays: true } },
97
+ {
98
+ $lookup: {
99
+ from: 'fixtureconfigs',
100
+ let: { 'fixtureId': '$fixtureId' },
101
+ pipeline: [
102
+ {
103
+ $match: {
104
+ $expr: {
105
+ $and: [
106
+ { $eq: [ '$_id', '$$fixtureId' ] },
107
+ ],
108
+ },
109
+ },
110
+ },
111
+ ],
112
+ as: 'FixtureData',
113
+ },
114
+ },
115
+ {
116
+ $unwind: { path: '$FixtureData', preserveNullAndEmptyArrays: true },
117
+ },
118
+ );
119
+
120
+
121
+ let findfixtureCompliance = await planoTaskService.aggregate( queryfixture );
122
+ console.log( findfixtureCompliance );
123
+ res.sendSuccess( { count: findfixtureCompliance.length, layoutData: findPlanoCompliance, fixtureData: findfixtureCompliance } );
62
124
  } catch ( e ) {
63
125
  logger.error( { functionName: 'getplanoFeedback', error: e, message: req.body } );
64
126
  return res.sendError( e, 500 );
@@ -137,7 +199,95 @@ export async function getStoreFixturesfeedback( req, res ) {
137
199
  }
138
200
  export async function updateStorePlano( req, res ) {
139
201
  try {
140
- console.log( 'reached' );
202
+ const { floorId, data } = req.body;
203
+
204
+ const floorData = await floorService.findOne( { _id: new mongoose.Types.ObjectId( floorId ) } );
205
+
206
+ const additionalMeta = {
207
+ clientId: '11',
208
+ storeId: floorData.toObject().storeId,
209
+ storeName: floorData.toObject().storeName,
210
+ planoId: floorData.toObject().planoId,
211
+ floorId: floorData.toObject()._id,
212
+ };
213
+
214
+ const layoutPolygon = JSON.parse( JSON.stringify( data.layoutPolygon ) );
215
+
216
+ layoutPolygon.forEach( ( element ) => {
217
+ delete element.fixtures;
218
+ } );
219
+
220
+ await floorService.updateOne( { _id: new mongoose.Types.ObjectId( floorId ) },
221
+ { layoutPolygon: layoutPolygon } );
222
+
223
+ const currentWallFixtures = data.layoutPolygon.flatMap( ( element ) =>
224
+ ( element.fixtures || [] ).map( ( fixture ) => fixture ),
225
+ );
226
+
227
+ const currentFloorFixtures = ( data.centerFixture || [] );
228
+
229
+ const currentFixtures = [ ...currentWallFixtures, ...currentFloorFixtures ];
230
+
231
+ const existingFixtures = await storeFixtureService.find( { floorId: new mongoose.Types.ObjectId( floorId ) } );
232
+
233
+ const currentIds = new Set( currentFixtures.map( ( f ) => f._id ) );
234
+ const removedFixtures = existingFixtures.filter(
235
+ ( f ) => f._id && !currentIds.has( f._id.toString() ),
236
+ );
237
+
238
+ if ( removedFixtures.length ) {
239
+ const fixtureIds = removedFixtures.map( ( fixture ) => fixture.toObject()._id );
240
+ await storeFixtureService.deleteMany( { _id: { $in: fixtureIds } } );
241
+ await fixtureShelfService.deleteMany( { fixtureId: { $in: fixtureIds } } );
242
+ }
243
+
244
+
245
+ const newWallFixtures = currentWallFixtures.filter( ( fixture ) => fixture?._id?.startsWith( 'new' ) );
246
+
247
+ const newFloorFixtures = currentFloorFixtures.filter( ( fixture ) => fixture?._id?.startsWith( 'new' ) );
248
+
249
+ const newFixtures = [ ...newWallFixtures, ...newFloorFixtures ];
250
+
251
+ if ( newFixtures.length ) {
252
+ newFixtures.forEach( async ( fixture ) => {
253
+ delete fixture._id;
254
+ const fixturePayload = {
255
+ ...additionalMeta,
256
+ ...fixture,
257
+ };
258
+ const createdFixture = await storeFixtureService.create( fixturePayload );
259
+ fixture.shelfConfig.forEach( async ( shelf ) => {
260
+ delete shelf._id;
261
+ const shelfPayload = {
262
+ ...additionalMeta,
263
+ ...shelf,
264
+ fixtureId: createdFixture.toObject()._id,
265
+
266
+ };
267
+ await fixtureShelfService.create( shelfPayload );
268
+ } );
269
+ } );
270
+ }
271
+
272
+ currentFixtures.forEach( async ( fixture ) => {
273
+ if ( mongoose.Types.ObjectId.isValid( fixture._id ) ) {
274
+ const updatedFixture = await storeFixtureService.upsertOne( { _id: new mongoose.Types.ObjectId( fixture._id ) }, fixture );
275
+
276
+ await fixtureShelfService.deleteMany( { fixtureId: new mongoose.Types.ObjectId( fixture._id ) } );
277
+
278
+ fixture.shelfConfig.forEach( async ( shelf ) => {
279
+ delete shelf._id;
280
+ const shelfPayload = {
281
+ ...additionalMeta,
282
+ ...shelf,
283
+ fixtureId: updatedFixture.toObject()._id,
284
+ };
285
+ await fixtureShelfService.create( shelfPayload );
286
+ } );
287
+ }
288
+ } );
289
+
290
+ res.sendSuccess( 'Updated Successfully' );
141
291
  } catch ( e ) {
142
292
  logger.error( { functionName: 'updateStorePlano', error: e } );
143
293
  return res.sendError( e, 500 );
@@ -175,7 +325,20 @@ export async function fixtureBrandsList( req, res ) {
175
325
  }
176
326
  res.sendSuccess( findData );
177
327
  } catch ( e ) {
178
- logger.error( { functionName: 'templateList', error: e } );
328
+ logger.error( { functionName: 'fixtureBrandsList', error: e } );
329
+ return res.sendError( e, 500 );
330
+ }
331
+ }
332
+
333
+ export async function fixtureVMList( req, res ) {
334
+ try {
335
+ let findData = await planoVmService.find( { clientId: req.query.clientId } );
336
+ if ( findData.length === 0 ) {
337
+ return res.sendError( 'nodata found', 204 );
338
+ }
339
+ res.sendSuccess( findData );
340
+ } catch ( e ) {
341
+ logger.error( { functionName: 'fixtureVMList', error: e } );
179
342
  return res.sendError( e, 500 );
180
343
  }
181
344
  }
@@ -183,7 +346,7 @@ export async function updateFixtureStatus( req, res ) {
183
346
  try {
184
347
  console.log( req.body );
185
348
 
186
- let comments={
349
+ let comments = {
187
350
  userId: req.user._id,
188
351
  userName: req.user.userName,
189
352
  role: req.user.role,
@@ -20,7 +20,6 @@ import mongoose from 'mongoose';
20
20
  import JSZip from 'jszip';
21
21
  import { signedUrl } from 'tango-app-api-middleware';
22
22
  import fs from 'fs';
23
- // import https from 'https';
24
23
  import os from 'os';
25
24
  import { fileURLToPath } from 'url';
26
25
  import path from 'path';
@@ -2321,11 +2320,11 @@ export async function updateVmData( req, res ) {
2321
2320
  }
2322
2321
  }
2323
2322
 
2324
-
2323
+ // import https from 'https';
2325
2324
  // async function scrapeCrest() {
2326
- // const storeIds = [ 'LKST682' ];
2325
+ // const storeIds = [ 'LKST2567' ];
2327
2326
  // const apiUrl = 'https://api.getcrest.ai/api/ms_shelfsensei/layout/';
2328
- // const bearerToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzQ4ODUwMzMyLCJpYXQiOjE3NDg4NDY3MzIsImp0aSI6ImNkNmRmNWZhYTg4ZDRmMjQ4YmZkYzFkMzkzZWYzMTg5IiwidXNlcl9pZCI6MTA4NSwiaWQiOjEwODUsImlzX21lZXNlZWtfYWNjb3VudCI6ZmFsc2UsImN1c3RvbWVyX2dyb3VwIjozOTgsImxpY2VuY2Vfc2NvcGVzIjpbeyJyZXNvdXJjZV9zZXQiOiJwcF9zZXQiLCJzY29wZV9yb2xlIjoiY29udHJpYnV0b3IifSx7InJlc291cmNlX3NldCI6ImRwX3NldCIsInNjb3BlX3JvbGUiOiJjb250cmlidXRvciJ9LHsicmVzb3VyY2Vfc2V0IjoiZGZfc2V0Iiwic2NvcGVfcm9sZSI6ImNvbnRyaWJ1dG9yIn0seyJyZXNvdXJjZV9zZXQiOiJkZWZhdWx0X3NldCIsInNjb3BlX3JvbGUiOiJjb250cmlidXRvciJ9XX0.8fclGcH6koHsKVmtGAQLscS80yNaVqPRkcpLhI3cnsk';
2327
+ // const bearerToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzQ5MTEyNDYxLCJpYXQiOjE3NDkxMDg4NjEsImp0aSI6ImYzMDhmN2M3YzBlYjQ4NWU5YjVmNTJjZjRjNTkxNTM2IiwidXNlcl9pZCI6MTA4NSwiaWQiOjEwODUsImlzX21lZXNlZWtfYWNjb3VudCI6ZmFsc2UsImN1c3RvbWVyX2dyb3VwIjozOTgsImxpY2VuY2Vfc2NvcGVzIjpbeyJyZXNvdXJjZV9zZXQiOiJwcF9zZXQiLCJzY29wZV9yb2xlIjoiY29udHJpYnV0b3IifSx7InJlc291cmNlX3NldCI6ImRwX3NldCIsInNjb3BlX3JvbGUiOiJjb250cmlidXRvciJ9LHsicmVzb3VyY2Vfc2V0IjoiZGZfc2V0Iiwic2NvcGVfcm9sZSI6ImNvbnRyaWJ1dG9yIn0seyJyZXNvdXJjZV9zZXQiOiJkZWZhdWx0X3NldCIsInNjb3BlX3JvbGUiOiJjb250cmlidXRvciJ9XX0.zXRf9dgtrIhjnUJSKyLqbB8FRnTT0a-hOBos0gvKsJY';
2329
2328
  // const filePath = 'response.json';
2330
2329
  // let allResults = [];
2331
2330
 
@@ -2390,7 +2389,7 @@ export async function updateVmData( req, res ) {
2390
2389
  // }
2391
2390
  // }
2392
2391
 
2393
- // scrapeCrest()
2392
+ // scrapeCrest();
2394
2393
 
2395
2394
  export async function createCrestPlanogram( req, res ) {
2396
2395
  try {
@@ -7265,10 +7264,10 @@ export async function migrateCrestv1( req, res ) {
7265
7264
 
7266
7265
  let storeList = await storeService.find( storeQuery );
7267
7266
 
7268
- const constantFixtureLength = 1220;
7267
+ // const constantFixtureLength = 1220;
7269
7268
  const constantDetailedFixtureLength = 1220;
7270
7269
 
7271
- const constantFixtureWidth = 610;
7270
+ // const constantFixtureWidth = 610;
7272
7271
  const constantDetailedFixtureWidth = 1524;
7273
7272
 
7274
7273
  const mmToFeet = 305;
@@ -7373,43 +7372,43 @@ export async function migrateCrestv1( req, res ) {
7373
7372
  floorFixtures = floorFixtures.filter( ( fixture ) => fixture.floor === floorArray[floorIndex] );
7374
7373
  }
7375
7374
 
7376
- const leftXDistanceFeet = leftFixtures.length ? roundToTwo( ( leftFixtures.length * ( constantFixtureLength / mmToFeet ) ) ) : 0;
7375
+ // const leftXDistanceFeet = leftFixtures.length ? roundToTwo( ( leftFixtures.length * ( constantFixtureLength / mmToFeet ) ) ) : 0;
7377
7376
  const leftXDetailedDistanceFeet = leftFixtures.length ? roundToTwo( ( leftFixtures.length * ( constantDetailedFixtureLength / mmToFeet ) ) ) : 0;
7378
7377
 
7379
- const leftYDistanceFeet = leftFixtures.length ? roundToTwo( ( ( constantFixtureWidth / mmToFeet ) ) ) : 0;
7378
+ // const leftYDistanceFeet = leftFixtures.length ? roundToTwo( ( ( constantFixtureWidth / mmToFeet ) ) ) : 0;
7380
7379
  const leftYDetailedDistanceFeet = leftFixtures.length ? roundToTwo( ( ( constantDetailedFixtureWidth / mmToFeet ) ) ) : 0;
7381
7380
 
7382
- const rightXDistanceFeet = rightFixtures.length ? roundToTwo( ( rightFixtures.length * ( constantFixtureLength / mmToFeet ) ) ) : 0;
7381
+ // const rightXDistanceFeet = rightFixtures.length ? roundToTwo( ( rightFixtures.length * ( constantFixtureLength / mmToFeet ) ) ) : 0;
7383
7382
  const rightXDetailedDistanceFeet = rightFixtures.length ? roundToTwo( ( rightFixtures.length * ( constantDetailedFixtureLength / mmToFeet ) ) ) : 0;
7384
7383
 
7385
- const rightYDistanceFeet = rightFixtures.length ? roundToTwo( ( constantFixtureWidth / mmToFeet ) ) : 0;
7384
+ // const rightYDistanceFeet = rightFixtures.length ? roundToTwo( ( constantFixtureWidth / mmToFeet ) ) : 0;
7386
7385
  const rightYDetailedDistanceFeet = rightFixtures.length ? roundToTwo( ( constantDetailedFixtureWidth / mmToFeet ) ): 0;
7387
7386
 
7388
7387
  const maxFixturesPerRow = floorFixtures.length/2;
7389
7388
  const totalRows = 2;
7390
7389
 
7391
- const floorXDistanceFeet = floorFixtures.length ? roundToTwo( ( ( floorFixtures.length/2 ) * ( constantFixtureLength / mmToFeet ) ) ) : 0;
7390
+ // const floorXDistanceFeet = floorFixtures.length ? roundToTwo( ( ( floorFixtures.length/2 ) * ( constantFixtureLength / mmToFeet ) ) ) : 0;
7392
7391
  const floorXDetailedDistanceFeet = floorFixtures.length ? roundToTwo( ( ( floorFixtures.length/2 ) * ( constantDetailedFixtureLength / mmToFeet ) ) ): 0;
7393
7392
 
7394
- const floorYDistanceFeet = floorFixtures.length ? roundToTwo( ( 2 * ( constantFixtureWidth/ mmToFeet ) ) ): 0;
7393
+ // const floorYDistanceFeet = floorFixtures.length ? roundToTwo( ( 2 * ( constantFixtureWidth/ mmToFeet ) ) ): 0;
7395
7394
  const floorYDetailedDistanceFeet = floorFixtures.length ? roundToTwo( 2 * ( constantDetailedFixtureWidth/mmToFeet ) ): 0;
7396
7395
 
7397
- const backXDistanceFeet = backFixtures.length ? roundToTwo( ( constantFixtureWidth / mmToFeet ) ) : 0;
7396
+ // const backXDistanceFeet = backFixtures.length ? roundToTwo( ( constantFixtureWidth / mmToFeet ) ) : 0;
7398
7397
  const backXDetailedDistanceFeet = backFixtures.length ? roundToTwo( ( constantDetailedFixtureLength / mmToFeet ) ) : 0;
7399
7398
 
7400
- const backYDistanceFeet = backFixtures.length ? roundToTwo( ( ( backFixtures.length * ( constantFixtureLength / mmToFeet ) ) + ( ( ( leftFixtures.length ? 1 : 0 ) + ( rightFixtures.length ? 1 : 0 ) * constantFixtureWidth )/mmToFeet ) ) ) : 0;
7399
+ // const backYDistanceFeet = backFixtures.length ? roundToTwo( ( ( backFixtures.length * ( constantFixtureLength / mmToFeet ) ) + ( ( ( leftFixtures.length ? 1 : 0 ) + ( rightFixtures.length ? 1 : 0 ) * constantFixtureWidth )/mmToFeet ) ) ) : 0;
7401
7400
  const backYDetailedDistanceFeet = backFixtures.length ? roundToTwo( ( ( backFixtures.length * ( constantDetailedFixtureWidth / mmToFeet ) ) + ( ( ( leftFixtures.length ? 1 : 0 ) + ( rightFixtures.length ? 1 : 0 ) * constantDetailedFixtureWidth )/mmToFeet ) ) ): 0;
7402
7401
 
7403
- const maxXDistance = Math.max( leftXDistanceFeet, rightXDistanceFeet, floorXDistanceFeet );
7402
+ // const maxXDistance = Math.max( leftXDistanceFeet, rightXDistanceFeet, floorXDistanceFeet );
7404
7403
  const maxXDetailedDistance = Math.max( leftXDetailedDistanceFeet, rightXDetailedDistanceFeet, floorXDetailedDistanceFeet );
7405
7404
 
7406
- const maxYDistance = Math.max( floorYDistanceFeet, backYDistanceFeet );
7405
+ // const maxYDistance = Math.max( floorYDistanceFeet, backYDistanceFeet );
7407
7406
  const maxYDetailedDistance = Math.max( floorYDetailedDistanceFeet, backYDetailedDistanceFeet );
7408
7407
 
7409
- const finalXDistance = roundToTwo( ( maxXDistance < ( backXDistanceFeet + floorXDistanceFeet )? ( ( backXDistanceFeet + floorXDistanceFeet ) + ( ( 2 * constantFixtureLength )/mmToFeet ) ) : ( floorFixtures.length && backFixtures.length ) ? ( maxXDistance + ( ( 2 * constantFixtureLength )/mmToFeet ) ) : maxXDistance ) );
7408
+ // const finalXDistance = roundToTwo( ( maxXDistance < ( backXDistanceFeet + floorXDistanceFeet )? ( ( backXDistanceFeet + floorXDistanceFeet ) + ( ( 2 * constantFixtureLength )/mmToFeet ) ) : ( floorFixtures.length && backFixtures.length ) ? ( maxXDistance + ( ( 2 * constantFixtureLength )/mmToFeet ) ) : maxXDistance ) );
7410
7409
  const finalXDetailedDistance = roundToTwo( ( maxXDetailedDistance < ( backXDetailedDistanceFeet + floorXDetailedDistanceFeet )? ( ( backXDetailedDistanceFeet + floorXDetailedDistanceFeet ) + ( ( 2 * constantDetailedFixtureLength )/mmToFeet ) ) : ( floorFixtures.length && backFixtures.length ) ? ( maxXDetailedDistance + ( ( 2 * constantDetailedFixtureLength )/mmToFeet ) ) : maxXDetailedDistance ) );
7411
7410
 
7412
- const finalYDistance = roundToTwo( ( maxYDistance < ( leftYDistanceFeet + rightYDistanceFeet + floorYDistanceFeet ) ? ( ( leftYDistanceFeet + rightYDistanceFeet + floorYDistanceFeet ) + ( ( 2 * constantFixtureWidth )/mmToFeet ) ) : ( maxYDistance + ( ( constantFixtureWidth )/mmToFeet ) ) ) );
7411
+ // const finalYDistance = roundToTwo( ( maxYDistance < ( leftYDistanceFeet + rightYDistanceFeet + floorYDistanceFeet ) ? ( ( leftYDistanceFeet + rightYDistanceFeet + floorYDistanceFeet ) + ( ( 2 * constantFixtureWidth )/mmToFeet ) ) : ( maxYDistance + ( ( constantFixtureWidth )/mmToFeet ) ) ) );
7413
7412
  const finalYDetailedDistance = roundToTwo( ( maxYDetailedDistance < ( leftYDetailedDistanceFeet + rightYDetailedDistanceFeet + floorYDetailedDistanceFeet ) ? ( ( leftYDetailedDistanceFeet + rightYDetailedDistanceFeet + floorYDetailedDistanceFeet ) + ( ( 2 * constantDetailedFixtureWidth )/mmToFeet ) ) : ( maxYDetailedDistance + ( ( constantDetailedFixtureWidth )/mmToFeet ) ) ) );
7414
7413
 
7415
7414
 
@@ -7424,57 +7423,57 @@ export async function migrateCrestv1( req, res ) {
7424
7423
  layoutPolygon: [
7425
7424
  {
7426
7425
  elementType: 'wall',
7427
- distance: finalXDistance,
7426
+ distance: finalXDetailedDistance,
7428
7427
  unit: 'ft',
7429
7428
  direction: 'right',
7430
7429
  angle: 90,
7431
7430
  elementNumber: 1,
7432
- detailedDistance: finalXDetailedDistance,
7431
+ // detailedDistance: finalXDetailedDistance,
7433
7432
  },
7434
7433
  {
7435
7434
  elementType: 'wall',
7436
- distance: finalYDistance,
7435
+ distance: finalYDetailedDistance,
7437
7436
  unit: 'ft',
7438
7437
  direction: 'down',
7439
7438
  angle: 90,
7440
7439
  elementNumber: 2,
7441
- detailedDistance: finalYDetailedDistance,
7440
+ // detailedDistance: finalYDetailedDistance,
7442
7441
  },
7443
7442
  {
7444
7443
  elementType: 'wall',
7445
- distance: finalXDistance,
7444
+ distance: finalXDetailedDistance,
7446
7445
  unit: 'ft',
7447
7446
  direction: 'left',
7448
7447
  angle: 90,
7449
7448
  elementNumber: 3,
7450
- detailedDistance: finalXDetailedDistance,
7449
+ // detailedDistance: finalXDetailedDistance,
7451
7450
  },
7452
7451
  {
7453
7452
  elementType: 'wall',
7454
- distance: roundToTwo( ( ( finalYDistance * 40 ) / 100 ) ),
7453
+ distance: roundToTwo( ( ( finalYDetailedDistance * 35 ) / 100 ) ),
7455
7454
  unit: 'ft',
7456
7455
  direction: 'up',
7457
7456
  angle: 90,
7458
7457
  elementNumber: 4,
7459
- detailedDistance: roundToTwo( ( ( finalYDetailedDistance * 35 ) / 100 ) ),
7458
+ // detailedDistance: roundToTwo( ( ( finalYDetailedDistance * 35 ) / 100 ) ),
7460
7459
  },
7461
7460
  {
7462
7461
  elementType: 'entrance',
7463
- distance: roundToTwo( ( ( finalYDistance * 20 ) / 100 ) ),
7462
+ distance: roundToTwo( ( ( finalYDetailedDistance * 30 ) / 100 ) ),
7464
7463
  unit: 'ft',
7465
7464
  direction: 'up',
7466
7465
  angle: 90,
7467
7466
  elementNumber: 1,
7468
- detailedDistance: roundToTwo( ( ( finalYDetailedDistance * 30 ) / 100 ) ),
7467
+ // detailedDistance: roundToTwo( ( ( finalYDetailedDistance * 30 ) / 100 ) ),
7469
7468
  },
7470
7469
  {
7471
7470
  elementType: 'wall',
7472
- distance: roundToTwo( ( ( finalYDistance * 40 ) / 100 ) ),
7471
+ distance: roundToTwo( ( ( finalYDetailedDistance * 35 ) / 100 ) ),
7473
7472
  unit: 'ft',
7474
7473
  direction: 'up',
7475
7474
  angle: 90,
7476
7475
  elementNumber: 5,
7477
- detailedDistance: roundToTwo( ( ( finalYDetailedDistance * 35 ) / 100 ) ),
7476
+ // detailedDistance: roundToTwo( ( ( finalYDetailedDistance * 35 ) / 100 ) ),
7478
7477
  },
7479
7478
  ],
7480
7479
  createdBy: new mongoose.Types.ObjectId( '66a78cd82734f4f857cd6db6' ),
@@ -7665,16 +7664,16 @@ export async function migrateCrestv1( req, res ) {
7665
7664
  'associatedElementType': 'wall',
7666
7665
  'associatedElementNumber': 1,
7667
7666
  'relativePosition': {
7668
- 'x': roundToTwo( ( index * ( constantFixtureLength / mmToFeet ) ) ),
7669
- 'y': 0,
7670
- 'unit': 'ft',
7671
- },
7672
- 'fixtureNumber': fixtureCounter,
7673
- 'relativeDetailedPosition': {
7674
7667
  'x': roundToTwo( ( index * ( constantDetailedFixtureLength / mmToFeet ) ) ),
7675
7668
  'y': 0,
7676
7669
  'unit': 'ft',
7677
7670
  },
7671
+ 'fixtureNumber': fixtureCounter,
7672
+ // 'relativeDetailedPosition': {
7673
+ // 'x': roundToTwo( ( index * ( constantDetailedFixtureLength / mmToFeet ) ) ),
7674
+ // 'y': 0,
7675
+ // 'unit': 'ft',
7676
+ // },
7678
7677
  'associatedElementFixtureNumber': index+1,
7679
7678
  'fixtureConfigId': fixtureTemplate.toObject()._id,
7680
7679
  };
@@ -7898,16 +7897,16 @@ export async function migrateCrestv1( req, res ) {
7898
7897
  'associatedElementType': 'wall',
7899
7898
  'associatedElementNumber': 2,
7900
7899
  'relativePosition': {
7901
- 'x': roundToTwo( ( finalXDistance - ( constantFixtureWidth/mmToFeet ) ) ),
7902
- 'y': roundToTwo( ( ( index * ( ( constantFixtureLength/mmToFeet ) ) ) + ( ( leftFixtures.length ? 1 : 0 ) * constantFixtureWidth/mmToFeet ) ) ),
7903
- 'unit': 'ft',
7904
- },
7905
- 'fixtureNumber': fixtureCounter,
7906
- 'relativeDetailedPosition': {
7907
7900
  'x': roundToTwo( ( finalXDetailedDistance - ( constantDetailedFixtureLength/mmToFeet ) ) ),
7908
7901
  'y': roundToTwo( ( ( index * ( ( constantDetailedFixtureWidth/mmToFeet ) ) ) + ( ( leftFixtures.length ? 1 : 0 ) * constantDetailedFixtureWidth/mmToFeet ) ) ),
7909
7902
  'unit': 'ft',
7910
7903
  },
7904
+ 'fixtureNumber': fixtureCounter,
7905
+ // 'relativeDetailedPosition': {
7906
+ // 'x': roundToTwo( ( finalXDetailedDistance - ( constantDetailedFixtureLength/mmToFeet ) ) ),
7907
+ // 'y': roundToTwo( ( ( index * ( ( constantDetailedFixtureWidth/mmToFeet ) ) ) + ( ( leftFixtures.length ? 1 : 0 ) * constantDetailedFixtureWidth/mmToFeet ) ) ),
7908
+ // 'unit': 'ft',
7909
+ // },
7911
7910
  'associatedElementFixtureNumber': index+1,
7912
7911
  'fixtureConfigId': fixtureTemplate.toObject()._id,
7913
7912
  };
@@ -8130,16 +8129,16 @@ export async function migrateCrestv1( req, res ) {
8130
8129
  'associatedElementType': 'wall',
8131
8130
  'associatedElementNumber': 3,
8132
8131
  'relativePosition': {
8133
- 'x': roundToTwo( ( index * ( constantFixtureLength / mmToFeet ) ) ),
8134
- 'y': roundToTwo( ( finalYDistance - ( constantFixtureWidth / mmToFeet ) ) ),
8135
- 'unit': 'ft',
8136
- },
8137
- 'fixtureNumber': fixtureCounter,
8138
- 'relativeDetailedPosition': {
8139
8132
  'x': roundToTwo( ( index * ( constantDetailedFixtureLength / mmToFeet ) ) ),
8140
8133
  'y': roundToTwo( ( finalYDetailedDistance - ( constantDetailedFixtureWidth / mmToFeet ) ) ),
8141
8134
  'unit': 'ft',
8142
8135
  },
8136
+ 'fixtureNumber': fixtureCounter,
8137
+ // 'relativeDetailedPosition': {
8138
+ // 'x': roundToTwo( ( index * ( constantDetailedFixtureLength / mmToFeet ) ) ),
8139
+ // 'y': roundToTwo( ( finalYDetailedDistance - ( constantDetailedFixtureWidth / mmToFeet ) ) ),
8140
+ // 'unit': 'ft',
8141
+ // },
8143
8142
  'associatedElementFixtureNumber': index+1,
8144
8143
  'fixtureConfigId': fixtureTemplate.toObject()._id,
8145
8144
  };
@@ -8191,17 +8190,17 @@ export async function migrateCrestv1( req, res ) {
8191
8190
 
8192
8191
  const centerRow = Math.floor( totalRows / 2 );
8193
8192
 
8194
- const startingX = roundToTwo( ( finalXDistance / 2 - ( maxFixturesPerRow / 2 ) * ( constantFixtureLength / mmToFeet ) ) );
8193
+ // const startingX = roundToTwo( ( finalXDistance / 2 - ( maxFixturesPerRow / 2 ) * ( constantFixtureLength / mmToFeet ) ) );
8195
8194
  const detailedStartingX = roundToTwo( ( finalXDetailedDistance / 2 - ( maxFixturesPerRow / 2 ) * ( constantDetailedFixtureLength / mmToFeet ) ) );
8196
8195
 
8197
- const startingY = finalYDistance / 2 - centerRow * ( constantFixtureWidth / mmToFeet );
8196
+ // const startingY = finalYDistance / 2 - centerRow * ( constantFixtureWidth / mmToFeet );
8198
8197
  const detailedStartingY = finalYDetailedDistance / 2 - centerRow * ( constantDetailedFixtureWidth / mmToFeet );
8199
8198
 
8200
8199
  const colIndex = Math.floor( index / 2 );
8201
8200
  const rowIndex = index % 2 === 0 ? 1 : 0;
8202
8201
 
8203
- const xPos = roundToTwo( startingX + colIndex * ( constantFixtureLength / mmToFeet ) );
8204
- const yPos = roundToTwo( startingY + rowIndex * ( constantFixtureWidth / mmToFeet ) );
8202
+ // const xPos = roundToTwo( startingX + colIndex * ( constantFixtureLength / mmToFeet ) );
8203
+ // const yPos = roundToTwo( startingY + rowIndex * ( constantFixtureWidth / mmToFeet ) );
8205
8204
 
8206
8205
  const detailedXPos = roundToTwo( ( detailedStartingX + colIndex * ( constantDetailedFixtureLength / mmToFeet ) ) );
8207
8206
  const detailedYPos = roundToTwo( ( detailedStartingY + rowIndex * ( constantDetailedFixtureWidth / mmToFeet ) ) );
@@ -8341,16 +8340,16 @@ export async function migrateCrestv1( req, res ) {
8341
8340
  'planoId': layoutDoc.planoId,
8342
8341
  'floorId': layoutDoc._id,
8343
8342
  'relativePosition': {
8344
- 'x': xPos,
8345
- 'y': yPos,
8346
- 'unit': 'ft',
8347
- },
8348
- 'fixtureNumber': fixtureCounter,
8349
- 'relativeDetailedPosition': {
8350
8343
  'x': detailedXPos,
8351
8344
  'y': detailedYPos,
8352
8345
  'unit': 'ft',
8353
8346
  },
8347
+ 'fixtureNumber': fixtureCounter,
8348
+ // 'relativeDetailedPosition': {
8349
+ // 'x': detailedXPos,
8350
+ // 'y': detailedYPos,
8351
+ // 'unit': 'ft',
8352
+ // },
8354
8353
  'associatedElementFixtureNumber': index+1,
8355
8354
  'fixtureConfigId': fixtureTemplate.toObject()._id,
8356
8355
  };
@@ -11,7 +11,7 @@ import * as checklistService from '../service/checklist.service.js';
11
11
  import timeZone from 'dayjs/plugin/timezone.js';
12
12
  import * as planoProductService from '../service/planoProduct.service.js';
13
13
  import mongoose from 'mongoose';
14
- // const ObjectId = mongoose.Types.ObjectId;
14
+ const ObjectId = mongoose.Types.ObjectId;
15
15
  import * as floorService from '../service/storeBuilder.service.js';
16
16
  import * as planoStaticService from '../service/planoStaticData.service.js';
17
17
 
@@ -110,7 +110,6 @@ async function createUser( data ) {
110
110
 
111
111
  export async function createTask( req, res ) {
112
112
  try {
113
- console.log( 1 );
114
113
  let taskDetails = await taskService.find( { isPlano: true, client_id: req.body.clientId, ...( req.body.checkListName )? { checkListName: req.body.checkListName } : {} } );
115
114
  let storeList = req.body.stores.map( ( ele ) => ele.store.toLowerCase() );
116
115
  let userDetails;
@@ -219,7 +218,6 @@ export async function createTask( req, res ) {
219
218
  let storeDetails = await storeService.aggregate( query );
220
219
  await Promise.all( storeDetails.map( async ( store ) => {
221
220
  let getUserEmail = req.body.stores.find( ( ele ) => ele.store.toLowerCase() == store.storeName.toLowerCase() );
222
- console.log( getUserEmail, 'email' );
223
221
  let planoDetails = await planoService.findOne( { storeName: store.storeName } );
224
222
  if ( planoDetails ) {
225
223
  let floorDetails = await floorService.find( { planoId: planoDetails._id }, { _id: 1, floorName: 1 } );
@@ -246,13 +244,13 @@ export async function createTask( req, res ) {
246
244
  taskData.checkListName = taskData.checkListName +' - '+ floorDetails[i].floorName;
247
245
  taskData.floorId = floorDetails[i]._id;
248
246
  }
249
- console.log( userDetails );
250
247
  taskData.store_id = store.storeId;
251
248
  taskData.storeName = store.storeName;
252
249
  taskData.userId = userDetails._id;
253
250
  taskData.userName = userDetails.userName;
254
251
  taskData.userEmail = userDetails.email;
255
252
  taskData.planoId = planoDetails?._id;
253
+ console.log( taskData );
256
254
  for ( let i=0; i<req.body.days; i++ ) {
257
255
  let currDate = dayjs().add( i, 'day' );
258
256
  let insertData = { ...taskData, 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' )} 12:00 AM`, 'YYYY-MM-DD hh:mm A' ).format() };
@@ -12,4 +12,5 @@ managePlanoRouter
12
12
  .get( '/fixtureList', managePlanoController.fixtureList )
13
13
  .get( '/templateList', managePlanoController.templateList )
14
14
  .get( '/fixtureBrandsList', managePlanoController.fixtureBrandsList )
15
+ .get( '/fixtureVMList', managePlanoController.fixtureVMList )
15
16
  .post( '/updateFixtureStatus', isAllowedSessionHandler, managePlanoController.updateFixtureStatus );