tango-app-api-infra 3.9.5-vms.72 → 3.9.5-vms.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-infra",
|
|
3
|
-
"version": "3.9.5-vms.
|
|
3
|
+
"version": "3.9.5-vms.74",
|
|
4
4
|
"description": "infra",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"mongodb": "^6.4.0",
|
|
28
28
|
"nodemon": "^3.1.0",
|
|
29
29
|
"swagger-ui-express": "^5.0.0",
|
|
30
|
-
"tango-api-schema": "^2.
|
|
30
|
+
"tango-api-schema": "^2.5.1",
|
|
31
31
|
"tango-app-api-infra": "^3.9.5-vms.56",
|
|
32
32
|
"tango-app-api-middleware": "^3.1.93",
|
|
33
33
|
"winston": "^3.12.0",
|
|
@@ -9,6 +9,7 @@ import timezone from 'dayjs/plugin/timezone.js';
|
|
|
9
9
|
import { findOneClient } from '../services/client.service.js';
|
|
10
10
|
import { findUser, findOneUser } from '../services/user.service.js';
|
|
11
11
|
import { sendPushNotification } from 'tango-app-api-middleware';
|
|
12
|
+
import { findStoreAccuracIssues, upsertStoreAccuracIssues } from '../services/storeAccuracyIssues.service.js';
|
|
12
13
|
dayjs.extend( utc );
|
|
13
14
|
dayjs.extend( timezone );
|
|
14
15
|
|
|
@@ -773,7 +774,7 @@ export async function ticketSummary( req, res ) {
|
|
|
773
774
|
let result = '';
|
|
774
775
|
const userInfo = req.user;
|
|
775
776
|
const ticketsFeature = userInfo?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name == 'reviewer' && ( m.isAdd == true || m.isEdit == true ) ) ) );
|
|
776
|
-
|
|
777
|
+
// const ticketsApproveFeature = userInfo?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name == 'approver' && ( m.isAdd == true || m.isEdit == true ) ) ) );
|
|
777
778
|
if ( req.user.userType == 'tango' ) {
|
|
778
779
|
result = {
|
|
779
780
|
totalTickets: 0,
|
|
@@ -2700,15 +2701,28 @@ export async function openTicketList( req, res ) {
|
|
|
2700
2701
|
},
|
|
2701
2702
|
},
|
|
2702
2703
|
{
|
|
2703
|
-
|
|
2704
|
-
'mappingInfo
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2704
|
+
nested: {
|
|
2705
|
+
path: 'mappingInfo',
|
|
2706
|
+
query: {
|
|
2707
|
+
bool: {
|
|
2708
|
+
must: [
|
|
2709
|
+
{
|
|
2710
|
+
term: {
|
|
2711
|
+
'mappingInfo.type': inputData.type,
|
|
2712
|
+
},
|
|
2713
|
+
},
|
|
2714
|
+
{
|
|
2715
|
+
term: {
|
|
2716
|
+
'mappingInfo.status': 'Open',
|
|
2717
|
+
},
|
|
2718
|
+
},
|
|
2719
|
+
|
|
2720
|
+
],
|
|
2721
|
+
},
|
|
2722
|
+
},
|
|
2710
2723
|
},
|
|
2711
2724
|
},
|
|
2725
|
+
|
|
2712
2726
|
{
|
|
2713
2727
|
range: {
|
|
2714
2728
|
dateString: {
|
|
@@ -3222,3 +3236,36 @@ export async function checkTicketExists( req, res ) {
|
|
|
3222
3236
|
return res.sendError( err, 500 );
|
|
3223
3237
|
}
|
|
3224
3238
|
}
|
|
3239
|
+
|
|
3240
|
+
|
|
3241
|
+
export async function getAccuracyIssues( req, res ) {
|
|
3242
|
+
try {
|
|
3243
|
+
const inputData = req.query;
|
|
3244
|
+
|
|
3245
|
+
|
|
3246
|
+
const getIsues = await findStoreAccuracIssues( { clientId: inputData.clientId, isActive: true }, { issueName: 1 } );
|
|
3247
|
+
// const mode = inputData.mode || '';
|
|
3248
|
+
res.sendSuccess( { result: getIsues|| [] } );
|
|
3249
|
+
// Return batch summary
|
|
3250
|
+
} catch ( error ) {
|
|
3251
|
+
const err = error.message;
|
|
3252
|
+
logger.info( { error: err, function: 'getAccuracyIssues' } );
|
|
3253
|
+
return res.sendError( err, 500 );
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
|
|
3257
|
+
export async function updateAccuracyIssues( req, res ) {
|
|
3258
|
+
try {
|
|
3259
|
+
const inputData = req.query;
|
|
3260
|
+
|
|
3261
|
+
|
|
3262
|
+
const getIsues = await upsertStoreAccuracIssues( { clientId: inputData.clientId, issueName: inputData?.issueName }, { issueName: inputData?.issueName, isActive: true } );
|
|
3263
|
+
// const mode = inputData.mode || '';
|
|
3264
|
+
res.sendSuccess( { result: getIsues|| [] } );
|
|
3265
|
+
// Return batch summary
|
|
3266
|
+
} catch ( error ) {
|
|
3267
|
+
const err = error.message;
|
|
3268
|
+
logger.info( { error: err, function: 'putAccuracyIssues' } );
|
|
3269
|
+
return res.sendError( err, 500 );
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
@@ -589,3 +589,27 @@ export const multiCloseTicketSchema = Joi.object().keys( {
|
|
|
589
589
|
export const multiCloseTicketValid = {
|
|
590
590
|
body: multiCloseTicketSchema,
|
|
591
591
|
};
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
export const getAccuracyIssuesSchema = Joi.object().keys( {
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
clientId: Joi.string().required(),
|
|
598
|
+
|
|
599
|
+
} );
|
|
600
|
+
|
|
601
|
+
export const getAccuracyIssuesValid = {
|
|
602
|
+
query: getAccuracyIssuesSchema,
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
export const updateAccuracyIssuesSchema = Joi.object().keys( {
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
clientId: Joi.string().required(),
|
|
609
|
+
issueName: Joi.string().required(),
|
|
610
|
+
|
|
611
|
+
} );
|
|
612
|
+
|
|
613
|
+
export const updateAccuracyIssuesValid = {
|
|
614
|
+
query: updateAccuracyIssuesSchema,
|
|
615
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { getClusters, getConfig, isGrantedUsers, isTicketExists, ticketApprove, ticketCreation, ticketReview } from '../validations/footfallDirectory.validation.js';
|
|
3
|
-
import { assignTicket, createTicket, downloadTickets, getTaggedStores, getTickets, multiCloseTicket, openTicketList, reviewerList, tangoReviewTicket, ticketList, ticketSummary, updateStatus, updateTempStatus, updateUserTicketStatus, createinternalTicket, checkTicketExists, tangoReviewAccuracyClosedTicket } from '../controllers/footfallDirectory.controllers.js';
|
|
4
|
-
import { createTicketValid, downloadTicketsValid, getTaggedStoresValid, getTicketsValid, openTicketListValid, reviewerListValid, ticketListValid, ticketSummaryValid, updateStatusValid, assignTicketValid, updateTempStatusValid, updateTicketStatusValid, tangoReviewTicketValid, multiCloseTicketValid, tangoReviewAccuracyClosedTicketValid } from '../dtos/footfallDirectory.dtos.js';
|
|
3
|
+
import { assignTicket, createTicket, downloadTickets, getTaggedStores, getTickets, multiCloseTicket, openTicketList, reviewerList, tangoReviewTicket, ticketList, ticketSummary, updateStatus, updateTempStatus, updateUserTicketStatus, createinternalTicket, checkTicketExists, tangoReviewAccuracyClosedTicket, getAccuracyIssues, updateAccuracyIssues } from '../controllers/footfallDirectory.controllers.js';
|
|
4
|
+
import { createTicketValid, downloadTicketsValid, getTaggedStoresValid, getTicketsValid, openTicketListValid, reviewerListValid, ticketListValid, ticketSummaryValid, updateStatusValid, assignTicketValid, updateTempStatusValid, updateTicketStatusValid, tangoReviewTicketValid, multiCloseTicketValid, tangoReviewAccuracyClosedTicketValid, getAccuracyIssuesValid, updateAccuracyIssuesValid } from '../dtos/footfallDirectory.dtos.js';
|
|
5
5
|
import { bulkValidate, getAssinedStore, isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
6
6
|
|
|
7
7
|
export const footfallDirectoryRouter = express.Router();
|
|
@@ -28,4 +28,7 @@ footfallDirectoryRouter.post( '/update-temp-status', isAllowedSessionHandler, bu
|
|
|
28
28
|
footfallDirectoryRouter.post( '/update-ticket-status', isAllowedSessionHandler, bulkValidate( updateTicketStatusValid ), updateUserTicketStatus );
|
|
29
29
|
footfallDirectoryRouter.post( '/multi-close-tickets', isAllowedSessionHandler, bulkValidate( multiCloseTicketValid ), multiCloseTicket );
|
|
30
30
|
|
|
31
|
+
footfallDirectoryRouter.get( '/get-accuarcy-issues', isAllowedSessionHandler, bulkValidate( getAccuracyIssuesValid ), getAccuracyIssues );
|
|
32
|
+
footfallDirectoryRouter.put( '/update-accuarcy-issues', isAllowedSessionHandler, bulkValidate( updateAccuracyIssuesValid ), updateAccuracyIssues );
|
|
33
|
+
|
|
31
34
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import storeAccuracyIssuesModel from 'tango-api-schema/schema/storeAccuracyIssues.model.js';
|
|
2
|
+
|
|
3
|
+
export async function findStoreAccuracIssues( query, fiels ) {
|
|
4
|
+
return await storeAccuracyIssuesModel.find( query, fiels );
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export async function upsertStoreAccuracIssues( query, record ) {
|
|
8
|
+
return await storeAccuracyIssuesModel.updateOne( query, { $set: record }, { upsert: true } );
|
|
9
|
+
}
|