tango-app-api-store-builder 1.0.0-beta-104 → 1.0.0-beta-105
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
|
@@ -23,6 +23,57 @@ export async function getplanoFeedback( req, res ) {
|
|
|
23
23
|
$match: {
|
|
24
24
|
planoId: new mongoose.Types.ObjectId( req.body.planoId ),
|
|
25
25
|
floorId: new mongoose.Types.ObjectId( req.body.floorId ),
|
|
26
|
+
type: 'layout',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
$lookup: {
|
|
31
|
+
from: 'processedtasks',
|
|
32
|
+
let: { 'taskId': '$taskId' },
|
|
33
|
+
pipeline: [
|
|
34
|
+
{
|
|
35
|
+
$match: {
|
|
36
|
+
$expr: {
|
|
37
|
+
$and: [
|
|
38
|
+
{ $eq: [ '$_id', '$$taskId' ] },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
$project: {
|
|
45
|
+
'userName': 1,
|
|
46
|
+
'createdAt': 1,
|
|
47
|
+
'createdByName': 1,
|
|
48
|
+
'submitTime_string': 1,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
as: 'taskData',
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
}, { $unwind: { path: '$taskData', preserveNullAndEmptyArrays: true } },
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
let findPlanoCompliance = await planoTaskService.aggregate( query );
|
|
60
|
+
|
|
61
|
+
res.sendSuccess( findPlanoCompliance );
|
|
62
|
+
} catch ( e ) {
|
|
63
|
+
logger.error( { functionName: 'getplanoFeedback', error: e, message: req.body } );
|
|
64
|
+
return res.sendError( e, 500 );
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export async function getStoreFixturesfeedback( req, res ) {
|
|
68
|
+
try {
|
|
69
|
+
let query = [];
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
query.push( {
|
|
73
|
+
$match: {
|
|
74
|
+
planoId: new mongoose.Types.ObjectId( req.body.planoId ),
|
|
75
|
+
floorId: new mongoose.Types.ObjectId( req.body.floorId ),
|
|
76
|
+
type: { $ne: 'layout' },
|
|
26
77
|
},
|
|
27
78
|
},
|
|
28
79
|
{
|
|
@@ -77,10 +128,10 @@ export async function getplanoFeedback( req, res ) {
|
|
|
77
128
|
|
|
78
129
|
|
|
79
130
|
let findPlanoCompliance = await planoTaskService.aggregate( query );
|
|
80
|
-
console.log( findPlanoCompliance );
|
|
81
|
-
res.sendSuccess( findPlanoCompliance );
|
|
131
|
+
console.log( findPlanoCompliance.length );
|
|
132
|
+
res.sendSuccess( { count: findPlanoCompliance.length, data: findPlanoCompliance } );
|
|
82
133
|
} catch ( e ) {
|
|
83
|
-
logger.error( { functionName: '
|
|
134
|
+
logger.error( { functionName: 'getplanoFeedbackFixture', error: e, message: req.body } );
|
|
84
135
|
return res.sendError( e, 500 );
|
|
85
136
|
}
|
|
86
137
|
}
|
|
@@ -250,6 +250,7 @@ export async function createTask( req, res ) {
|
|
|
250
250
|
taskData.userName = userDetails.userName;
|
|
251
251
|
taskData.userEmail = userDetails.email;
|
|
252
252
|
taskData.planoId = planoDetails?._id;
|
|
253
|
+
console.log( taskData );
|
|
253
254
|
for ( let i=0; i<req.body.days; i++ ) {
|
|
254
255
|
let currDate = dayjs().add( i, 'day' );
|
|
255
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() };
|
|
@@ -8,6 +8,7 @@ export const managePlanoRouter = express.Router();
|
|
|
8
8
|
managePlanoRouter
|
|
9
9
|
.post( '/updateStorePlano', managePlanoController.updateStorePlano )
|
|
10
10
|
.post( '/getplanoFeedback', managePlanoController.getplanoFeedback )
|
|
11
|
+
.post( '/getStoreFixturesfeedback', managePlanoController.getStoreFixturesfeedback )
|
|
11
12
|
.get( '/fixtureList', managePlanoController.fixtureList )
|
|
12
13
|
.get( '/templateList', managePlanoController.templateList )
|
|
13
14
|
.get( '/fixtureBrandsList', managePlanoController.fixtureBrandsList )
|
|
@@ -5,7 +5,7 @@ export async function find( query={}, field={} ) {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export async function findOne( query={}, field={} ) {
|
|
8
|
-
return model.
|
|
8
|
+
return model.fixtureCpaconfigModel.findOne( query, field );
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export async function insertMany( data = [] ) {
|