tango-app-api-task 3.5.0-alpha-2 → 3.5.0-alpha-4

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.
@@ -50,6 +50,9 @@ const questionSchema = Joi.object( {
50
50
  answerType: Joi.string().required(),
51
51
  options: Joi.array().items().optional(),
52
52
  } );
53
+ const gettaskSchema = Joi.object( {
54
+ sourceCheckList_id: Joi.string().required(),
55
+ } );
53
56
  export const taskcreationSchema = Joi.object().keys( {
54
57
  storeName: Joi.string().required(),
55
58
  taskName: Joi.string().required(),
@@ -67,6 +70,9 @@ export const commonAiTaskvalidation = {
67
70
  export const taskcreationvalidation = {
68
71
  body: taskcreationSchema,
69
72
  };
73
+ export const gettaskvalidation = {
74
+ query: gettaskSchema,
75
+ };
70
76
  export const aitaskvalidation = {
71
77
  body: aitaskvalidationSchema,
72
78
  };
@@ -2,7 +2,7 @@
2
2
  import * as taskController from '../controllers/task.controller.js';
3
3
  import { isAllowedSessionHandler, validate, accessVerification, isAllowedClient, isAllowedInternalAPIHandler } from 'tango-app-api-middleware';
4
4
  import express from 'express';
5
- import { aitaskvalidation, StoreHygienetaskvalidation, eyeTesttaskvalidation, commonAiTaskvalidation, taskcreationvalidation } from '../dtos/task.dto.js';
5
+ import { aitaskvalidation, StoreHygienetaskvalidation, eyeTesttaskvalidation, commonAiTaskvalidation, taskcreationvalidation, gettaskvalidation } from '../dtos/task.dto.js';
6
6
  export const taskRouter = express.Router();
7
7
 
8
8
  taskRouter
@@ -29,6 +29,7 @@ taskRouter
29
29
  .get( '/duplicateTask/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [ 'isEdit' ] } ] } ), taskController.duplicateChecklist )
30
30
  .get( '/teamMigrations', taskController.teamMigrations )
31
31
  .get( '/clusterMigrations', taskController.clusterMigrations )
32
+ .get( '/userMigrations', taskController.userMigrations )
32
33
  .post( '/createaiChecklist', isAllowedInternalAPIHandler, taskController.createAiChecklist )
33
34
  .post( '/createaiTask', isAllowedInternalAPIHandler, taskController.createAiTask )
34
35
  .post( '/assign', isAllowedSessionHandler, taskController.taskAssign )
@@ -38,6 +39,7 @@ taskRouter
38
39
  .post( '/commonAiTask', isAllowedInternalAPIHandler, validate( commonAiTaskvalidation ), taskController.commonAiTask )
39
40
  .post( '/updateAssign', isAllowedSessionHandler, taskController.updateAssign )
40
41
  .post( '/taskcreation', isAllowedInternalAPIHandler, validate( taskcreationvalidation ), taskController.taskcreation )
42
+ .get( '/getTask', isAllowedInternalAPIHandler, validate( gettaskvalidation ), taskController.getTask )
41
43
  .post( '/breached-tasks', isAllowedInternalAPIHandler, validate( taskcreationvalidation ), taskController.breachedTasks )
42
44
  .get( '/getcoustemer', taskController.customertrial );
43
45
 
@@ -19,6 +19,9 @@ export const deleteOne = async ( query = {} ) => {
19
19
  export const updateOne = async ( query = {}, record={} ) => {
20
20
  return model.userModel.updateOne( query, { $set: record } );
21
21
  };
22
+ export const update= async ( query = {}, record={} ) => {
23
+ return model.userModel.updateOne( query, record );
24
+ };
22
25
 
23
26
  export const upsert = async ( query = {}, record={} ) => {
24
27
  return model.userModel.updateOne( query, { $set: record }, { upsert: true } );