tango-app-api-client 3.6.5-vms.12 → 3.6.5-vms.14
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/index.js +2 -1
- package/package.json +2 -2
- package/src/controllers/client.controllers.js +31 -34
- package/src/dtos/client.dtos.js +3 -0
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { clientRouter } from './src/routes/client.routes.js';
|
|
4
4
|
import { clientDocs } from './src/docs/client.docs.js';
|
|
5
|
+
import { vmsauditRouter } from './src/routes/vmsAudit.routes.js';
|
|
5
6
|
|
|
6
|
-
export { clientRouter, clientDocs };
|
|
7
|
+
export { clientRouter, clientDocs, vmsauditRouter };
|
|
7
8
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-client",
|
|
3
|
-
"version": "3.6.5-vms.
|
|
3
|
+
"version": "3.6.5-vms.14",
|
|
4
4
|
"description": "client",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "nodemon --exec \"eslint --fix . && node
|
|
8
|
+
"start": "nodemon --exec \"eslint --fix . && node index.js\"",
|
|
9
9
|
"build:patch": "node build.js patch && npm publish",
|
|
10
10
|
"build:minor": "node build.js minor && npm publish",
|
|
11
11
|
"build:major": "node build.js major && npm publish"
|
|
@@ -3062,41 +3062,38 @@ export async function getFDConfig( req, res ) {
|
|
|
3062
3062
|
export async function updateTaggingType( req, res ) {
|
|
3063
3063
|
try {
|
|
3064
3064
|
const inputData = req.body;
|
|
3065
|
-
|
|
3066
|
-
const
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
await clientModel.updateOne(
|
|
3070
|
-
{ clientId: inputQuery.clientId },
|
|
3065
|
+
const newValues = inputData.taggingLimitation;
|
|
3066
|
+
const today = new Date().toISOString().split( 'T' )[0];
|
|
3067
|
+
logger.info( { today, newValues } );
|
|
3068
|
+
const result = await clientModel.updateOne(
|
|
3071
3069
|
{
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3070
|
+
'clientId': inputData?.clientId,
|
|
3071
|
+
'footfallDirectoryConfigs.taggingLimitation.effectiveFrom': today,
|
|
3072
|
+
},
|
|
3073
|
+
{
|
|
3074
|
+
$set: {
|
|
3075
|
+
'footfallDirectoryConfigs.taggingLimitation.$.values': newValues,
|
|
3076
3076
|
},
|
|
3077
3077
|
},
|
|
3078
3078
|
);
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
'footfallDirectoryConfigs.taggingLimitation': {
|
|
3089
|
-
$addToSet: {
|
|
3090
|
-
effectiveFrom: new Date().toISOString().split( 'T' )[0],
|
|
3091
|
-
values: uniqueData,
|
|
3079
|
+
logger.info( { result } );
|
|
3080
|
+
if ( result?.matchedCount === 0 ) {
|
|
3081
|
+
await clientModel.updateOne(
|
|
3082
|
+
{ clientId: inputData.clientId },
|
|
3083
|
+
{
|
|
3084
|
+
$push: {
|
|
3085
|
+
'footfallDirectoryConfigs.taggingLimitation': {
|
|
3086
|
+
effectiveFrom: today,
|
|
3087
|
+
values: newValues,
|
|
3092
3088
|
},
|
|
3093
3089
|
},
|
|
3094
3090
|
},
|
|
3095
|
-
|
|
3096
|
-
|
|
3091
|
+
);
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3097
3094
|
|
|
3098
3095
|
if ( result?.acknowledged === true ) {
|
|
3099
|
-
return res.sendSuccess(
|
|
3096
|
+
return res.sendSuccess( 'Tagging limitation has been updated' );
|
|
3100
3097
|
} else {
|
|
3101
3098
|
return res.sendError( 'no data', 204 );
|
|
3102
3099
|
}
|
|
@@ -3107,14 +3104,14 @@ export async function updateTaggingType( req, res ) {
|
|
|
3107
3104
|
}
|
|
3108
3105
|
}
|
|
3109
3106
|
|
|
3110
|
-
function uniqueByType( arr ) {
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
}
|
|
3107
|
+
// function uniqueByType( arr ) {
|
|
3108
|
+
// const seen = new Set();
|
|
3109
|
+
// return arr.filter( ( item ) => {
|
|
3110
|
+
// if ( seen.has( item.type ) ) return false;
|
|
3111
|
+
// seen.add( item.type );
|
|
3112
|
+
// return true;
|
|
3113
|
+
// } );
|
|
3114
|
+
// }
|
|
3118
3115
|
|
|
3119
3116
|
export async function createStoreRequest( req, res ) {
|
|
3120
3117
|
try {
|
package/src/dtos/client.dtos.js
CHANGED
|
@@ -399,6 +399,9 @@ export const updateTaggingTypeSchema = joi.object( {
|
|
|
399
399
|
type: joi.string().required(),
|
|
400
400
|
value: joi.number().required(),
|
|
401
401
|
unit: joi.string().required(),
|
|
402
|
+
name: joi.string().required(),
|
|
403
|
+
iconName: joi.string().required(),
|
|
404
|
+
key: joi.string().required(),
|
|
402
405
|
} ) ).required(),
|
|
403
406
|
|
|
404
407
|
} );
|