tango-app-api-infra 3.1.25 → 3.1.27
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
|
@@ -76,6 +76,7 @@ export async function clientList( req, res ) {
|
|
|
76
76
|
try {
|
|
77
77
|
let clientList = await findClient( { status: { $in: [ 'active', 'hold' ] } },
|
|
78
78
|
{ 'clientName': 1, 'clientId': 1, 'ticketConfigs': 1 } );
|
|
79
|
+
logger.info({clientList:clientList,"message":"clientList"})
|
|
79
80
|
res.sendSuccess( clientList );
|
|
80
81
|
} catch ( error ) {
|
|
81
82
|
logger.error( { error: error, function: 'basicList' } );
|
|
@@ -92,6 +93,8 @@ export async function basicList( req, res ) {
|
|
|
92
93
|
}
|
|
93
94
|
let storeList = await findStore( { 'clientId': { $in: clients }, 'status': 'active', 'edge.firstFile': true },
|
|
94
95
|
{ 'storeName': 1, 'storeId': 1, 'ticketConfigs': 1, 'clientId': 1, 'storeProfile.open': 1, 'storeProfile.close': 1, 'storeProfile.timeZone': 1 } );
|
|
96
|
+
logger.info({storeList:storeList,"message":"storeList"})
|
|
97
|
+
|
|
95
98
|
res.sendSuccess( storeList );
|
|
96
99
|
} catch ( error ) {
|
|
97
100
|
logger.error( { error: error, function: 'basicList' } );
|
|
@@ -103,6 +106,7 @@ export async function basicList( req, res ) {
|
|
|
103
106
|
export async function setTicketTime( req, res ) {
|
|
104
107
|
try {
|
|
105
108
|
let input = req.body;
|
|
109
|
+
logger.info( { input: input ,"message":"setTicketTime"} );
|
|
106
110
|
for ( let i = 0; i < input.stores.length; i++ ) {
|
|
107
111
|
await updateOneStore( { storeId: input.stores[i].storeId }, { 'ticketConfigs.nextTicektGenerationTime': new Date( input.stores[i].nextTicektGenerationTime ) } );
|
|
108
112
|
};
|
|
@@ -116,6 +120,7 @@ export async function setTicketTime( req, res ) {
|
|
|
116
120
|
export async function downStoresList( req, res ) {
|
|
117
121
|
try {
|
|
118
122
|
let storesList = await findStore( { 'ticketConfigs.hibernation': { $lt: new Date() }, 'ticketConfigs.nextTicektGenerationTime': new Date( req.body.getTime ) }, { storeId: 1, storeName: 1, storeProfile: 1, ticketConfigs: 1 } );
|
|
123
|
+
logger.info( { storesList: storesList,"message":"downStoresList" } );
|
|
119
124
|
if ( storesList.length > 0 ) {
|
|
120
125
|
res.sendSuccess( storesList );
|
|
121
126
|
} else {
|
|
@@ -1047,11 +1052,15 @@ export async function updateIssue( data ) {
|
|
|
1047
1052
|
statusCheckAlertTime: statusCheckAlertTime,
|
|
1048
1053
|
} );
|
|
1049
1054
|
}
|
|
1055
|
+
let client = await findOneClient( { clientId: data.basicDetails.clientId } );
|
|
1056
|
+
let refreshdate = dayjs().add( client.ticketConfigs.refreshAlert, 'days' );
|
|
1057
|
+
|
|
1050
1058
|
let query = {
|
|
1051
1059
|
'ticketActivity': data.ticketActivity,
|
|
1052
1060
|
'ticketDetails.issueIdentifiedDate': new Date(),
|
|
1053
1061
|
'ticketDetails.issueStatus': 'identified',
|
|
1054
1062
|
'status': 'inprogress',
|
|
1063
|
+
'ticketDetails.ticketRefreshTime': new Date( dayjs( refreshdate ).format( 'YYYY-MM-DD' ) ),
|
|
1055
1064
|
};
|
|
1056
1065
|
await updateOneTangoTicket( { ticketId: data.ticketId }, query );
|
|
1057
1066
|
} catch ( error ) {
|
|
@@ -14,22 +14,22 @@ storeInfraRouter.post( '/storeTicketcard', isAllowedSessionHandler, authorize( {
|
|
|
14
14
|
} ), storeTicketcard );
|
|
15
15
|
storeInfraRouter.post( '/edgeAppLogTable', isAllowedSessionHandler, authorize( {
|
|
16
16
|
userType: [ 'client', 'tango' ], access: [
|
|
17
|
-
{ featureName: 'manage', name: '
|
|
17
|
+
{ featureName: 'manage', name: 'stores', permissions: [ 'isView' ] } ],
|
|
18
18
|
} ), edgeAppLogTable );
|
|
19
19
|
storeInfraRouter.post( '/viewedgeAppLog', isAllowedSessionHandler, authorize( {
|
|
20
20
|
userType: [ 'client', 'tango' ], access: [
|
|
21
|
-
{ featureName: 'manage', name: '
|
|
21
|
+
{ featureName: 'manage', name: 'stores', permissions: [ 'isView' ] } ],
|
|
22
22
|
} ), viewedgeAppLog );
|
|
23
23
|
storeInfraRouter.post( '/cameraAngleChange', isAllowedSessionHandler, authorize( {
|
|
24
24
|
userType: [ 'client', 'tango' ], access: [
|
|
25
|
-
{ featureName: 'manage', name: '
|
|
25
|
+
{ featureName: 'manage', name: 'stores', permissions: [ 'isView' ] } ],
|
|
26
26
|
} ), cameraAngleChange );
|
|
27
27
|
|
|
28
28
|
storeInfraRouter.post( '/datewiseDowntime', isAllowedSessionHandler, authorize( {
|
|
29
29
|
userType: [ 'client', 'tango' ], access: [
|
|
30
|
-
{ featureName: 'manage', name: '
|
|
30
|
+
{ featureName: 'manage', name: 'stores', permissions: [ 'isView' ] } ],
|
|
31
31
|
} ), datewiseDowntime );
|
|
32
32
|
storeInfraRouter.post( '/streamwiseDowntime', isAllowedSessionHandler, authorize( {
|
|
33
33
|
userType: [ 'client', 'tango' ], access: [
|
|
34
|
-
{ featureName: 'manage', name: '
|
|
34
|
+
{ featureName: 'manage', name: 'stores', permissions: [ 'isView' ] } ],
|
|
35
35
|
} ), streamwiseDowntime );
|