tango-app-api-task 1.0.0-alpha.0
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/.eslintrc.cjs +41 -0
- package/README.md +29 -0
- package/index.js +10 -0
- package/package.json +39 -0
- package/src/controllers/internalAPI.controller.js +304 -0
- package/src/controllers/task.controller.js +1059 -0
- package/src/controllers/taskActionCenter.controllers.js +383 -0
- package/src/controllers/taskDashboard.controllers.js +747 -0
- package/src/routes/internalAPI.routes.js +11 -0
- package/src/routes/task.routes.js +19 -0
- package/src/routes/taskActionCenter.routes.js +16 -0
- package/src/routes/taskDashboard.routes.js +18 -0
- package/src/service/approver.service.js +17 -0
- package/src/service/checklistLog.service.js +33 -0
- package/src/service/domain.service.js +23 -0
- package/src/service/processedChecklist.service.js +6 -0
- package/src/service/processedTaskConfig.service.js +32 -0
- package/src/service/processedTaskList.service.js +26 -0
- package/src/service/store.service.js +29 -0
- package/src/service/task.service.js +23 -0
- package/src/service/taskAssign.service.js +33 -0
- package/src/service/taskQuestion.service.js +31 -0
- package/src/service/user.service.js +26 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import * as internalController from '../controllers/internalAPI.controller.js';
|
|
3
|
+
import { isAllowedInternalAPIHandler } from 'tango-app-api-middleware';
|
|
4
|
+
import express from 'express';
|
|
5
|
+
export const internalAPIRouter = express.Router();
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
internalAPIRouter
|
|
9
|
+
|
|
10
|
+
.post( '/create', isAllowedInternalAPIHandler, internalController.PCLTaskCreationValidator, internalController.PCLTaskconfigCreation );
|
|
11
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import * as taskController from '../controllers/task.controller.js';
|
|
3
|
+
import { isAllowedSessionHandler, accessVerification, isAllowedClient } from 'tango-app-api-middleware';
|
|
4
|
+
import express from 'express';
|
|
5
|
+
|
|
6
|
+
export const taskRouter = express.Router();
|
|
7
|
+
|
|
8
|
+
taskRouter
|
|
9
|
+
.post( '/create', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [ 'isAdd' ] } ] } ), taskController.createUpdateTask )
|
|
10
|
+
.post( '/delete/:taskIds', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [ 'isEdit' ] } ] } ), taskController.deleteTask )
|
|
11
|
+
.get( '/details', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [] } ] } ), taskController.taskDetails )
|
|
12
|
+
.get( '/userDetails', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [] } ] } ), taskController.userDetails )
|
|
13
|
+
.post( '/upload', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [ 'isEdit' ] } ] } ), taskController.validateUser )
|
|
14
|
+
.post( '/uploadImage', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [ 'isEdit' ] } ] } ), taskController.uploadImage )
|
|
15
|
+
.post( '/config', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [ 'isEdit' ] } ] } ), taskController.taskConfig )
|
|
16
|
+
.post( '/reinitiate', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [ 'isEdit' ] } ] } ), taskController.reinitiateTask )
|
|
17
|
+
.post( '/checklistTask', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'Task', permissions: [ 'isEdit' ] } ] } ), taskController.createChecklistTask );
|
|
18
|
+
|
|
19
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
3
|
+
export const taskActionCenterRouter = express.Router();
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
overallCards, approvalTable, activityLog,
|
|
7
|
+
} from '../controllers/taskActionCenter.controllers.js';
|
|
8
|
+
|
|
9
|
+
taskActionCenterRouter
|
|
10
|
+
.post( '/overallcards', isAllowedSessionHandler, overallCards )
|
|
11
|
+
// .post( '/overallcardsV1', overallCardsV1 )
|
|
12
|
+
.post( '/approvalTable', isAllowedSessionHandler, approvalTable )
|
|
13
|
+
// .post( '/approvalTableV1', approvalTableV1 )
|
|
14
|
+
.post( '/activityLog', activityLog );
|
|
15
|
+
|
|
16
|
+
export default taskActionCenterRouter;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
export const taskDashboardRouter = express.Router();
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
overallCards, taskTable, taskInfoTable, taskDropdownList, taskTableV1, overallCardsV1, taskInfoTableV1, taskDropdownListV1,
|
|
6
|
+
} from '../controllers/taskDashboard.controllers.js';
|
|
7
|
+
|
|
8
|
+
taskDashboardRouter
|
|
9
|
+
.post( '/overallcards', overallCards )
|
|
10
|
+
.post( '/overallcardsV1', overallCardsV1 )
|
|
11
|
+
.post( '/taskTable', taskTable )
|
|
12
|
+
.post( '/taskTableV1', taskTableV1 )
|
|
13
|
+
.post( '/taskInfoTable', taskInfoTable )
|
|
14
|
+
.post( '/taskInfoTableV1', taskInfoTableV1 )
|
|
15
|
+
.post( '/taskDropdownList', taskDropdownList )
|
|
16
|
+
.post( '/taskDropdownListV1', taskDropdownListV1 );
|
|
17
|
+
|
|
18
|
+
export default taskDashboardRouter;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const create = async ( data ) => {
|
|
4
|
+
return model.traxApproverModel.create( data );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const updateMany = async ( query={}, record={} ) => {
|
|
8
|
+
return model.traxApproverModel.updateMany( query, { $set: record } );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const insertMany = async ( data = [] ) => {
|
|
12
|
+
return model.traxApproverModel.insertMany( data );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const find = async ( query ={}, field={} ) => {
|
|
16
|
+
return model.traxApproverModel.find( query, field );
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const findOne = async ( query={}, field={} ) => {
|
|
4
|
+
return model.checklistlogModel.findOne( query, field );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const find = async ( query={}, field={} ) => {
|
|
8
|
+
return model.checklistlogModel.find( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const create = async ( document = {} ) => {
|
|
12
|
+
return model.checklistlogModel.create( document );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const deleteOne = async ( query = {} ) => {
|
|
16
|
+
return model.checklistlogModel.deleteOne( query );
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const updateOne = async ( query = {}, record={} ) => {
|
|
20
|
+
return model.checklistlogModel.updateOne( query, { $set: record } );
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const updateMany = async ( query = {}, record={} ) => {
|
|
24
|
+
return model.checklistlogModel.updateMany( query, { $set: record } );
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const deleteMany = async ( query = {} ) => {
|
|
28
|
+
return model.checklistlogModel.deleteMany( query );
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const aggregate = async ( query = {} ) => {
|
|
32
|
+
return model.checklistlogModel.aggregate( query );
|
|
33
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const findOne = async ( query={}, field={} ) => {
|
|
4
|
+
return model.domainModel.findOne( query, field );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const find = async ( query={}, field={} ) => {
|
|
8
|
+
return model.domainModel.find( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const create = async ( document = {} ) => {
|
|
12
|
+
return model.domainModel.create( document );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const deleteOne = async ( query = {} ) => {
|
|
16
|
+
return model.domainModel.deleteOne( query );
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const aggregate = async ( query = {} ) => {
|
|
20
|
+
return model.domainModel.aggregate( query );
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const find = async ( query = {}, field={} ) => {
|
|
4
|
+
return model.taskProcessedConfigModel.find( query, field );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const findOne = async ( query = {}, field={} ) => {
|
|
8
|
+
return model.taskProcessedConfigModel.findOne( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const updateMany = async ( query = {}, record={} ) => {
|
|
12
|
+
return model.taskProcessedConfigModel.updateMany( query, { $set: record } );
|
|
13
|
+
};
|
|
14
|
+
export const updateOne = async ( query = {}, record={} ) => {
|
|
15
|
+
return model.taskProcessedConfigModel.updateOne( query, { $set: record } );
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const insertMany = async ( data = [] ) => {
|
|
19
|
+
return model.taskProcessedConfigModel.insertMany( data );
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const deleteMany = async ( query = [] ) => {
|
|
23
|
+
return model.taskProcessedConfigModel.deleteMany( query );
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const aggregate = async ( query = [] ) => {
|
|
27
|
+
return model.taskProcessedConfigModel.aggregate( query );
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const insert = async ( data = [] ) => {
|
|
31
|
+
return model.taskProcessedConfigModel.create( data );
|
|
32
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const find = async ( query = {}, field={} ) => {
|
|
4
|
+
return model.taskProcessedModel.find( query, field );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const findOne = async ( query = {}, field={} ) => {
|
|
8
|
+
return model.taskProcessedModel.findOne( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const updateMany = async ( query = {}, record={} ) => {
|
|
12
|
+
return model.taskProcessedModel.updateMany( query, { $set: record } );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const insertMany = async ( data = [] ) => {
|
|
16
|
+
return model.taskProcessedModel.insertMany( data );
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const deleteMany = async ( query = [] ) => {
|
|
20
|
+
return model.taskProcessedModel.deleteMany( query );
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const aggregate = async ( query = [] ) => {
|
|
24
|
+
return model.taskProcessedModel.aggregate( query );
|
|
25
|
+
};
|
|
26
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const findOne = async ( query={}, field={} ) => {
|
|
4
|
+
return model.storeModel.findOne( query, field );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const find = async ( query={}, field={} ) => {
|
|
8
|
+
return model.storeModel.find( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const create = async ( document = {} ) => {
|
|
12
|
+
return model.storeModel.create( document );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const deleteOne = async ( query = {} ) => {
|
|
16
|
+
return model.storeModel.deleteOne( query );
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const updateOne = async ( query = {}, record={} ) => {
|
|
20
|
+
return model.storeModel.updateOne( query, { $set: record } );
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const aggregate = async ( query = {} ) => {
|
|
24
|
+
return model.storeModel.aggregate( query );
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const count = async ( query = {} ) => {
|
|
28
|
+
return model.storeModel.countDocuments( query );
|
|
29
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const find = async ( query = {}, field={} ) => {
|
|
4
|
+
return model.taskConfigModel.find( query, field );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const findOne = async ( query = {}, field={} ) => {
|
|
8
|
+
return model.taskConfigModel.findOne( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const updateOne = async ( query = {}, record={} ) => {
|
|
12
|
+
return model.taskConfigModel.updateOne( query, { $set: record }, { upsert: true } );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const aggregate = async ( query = [] ) => {
|
|
16
|
+
return model.taskConfigModel.aggregate( query );
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const create = async ( data = {} ) => {
|
|
20
|
+
return model.taskConfigModel.create( data );
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const find = async ( query = {}, field={} ) => {
|
|
4
|
+
return model.taskAssignModel.find( query, field );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const findOne = async ( query = {}, field={} ) => {
|
|
8
|
+
return model.taskAssignModel.findOne( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const updateMany = async ( query = {}, record={} ) => {
|
|
12
|
+
return model.taskAssignModel.updateMany( query, { $set: record } );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const updateOne = async ( query = {}, record={} ) => {
|
|
16
|
+
return model.taskAssignModel.updateOne( query, { $set: record } );
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const insertMany = async ( data = [] ) => {
|
|
20
|
+
return model.taskAssignModel.insertMany( data );
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const aggregate = async ( query = [] ) => {
|
|
24
|
+
return model.taskAssignModel.aggregate( query );
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const create = async ( data = [] ) => {
|
|
28
|
+
return model.taskAssignModel.create( data );
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const deleteMany = async ( query = [] ) => {
|
|
32
|
+
return model.taskAssignModel.deleteMany( query );
|
|
33
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const find = async ( query = {}, field={} ) => {
|
|
4
|
+
return model.taskQuestionModel.find( query, field );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const findOne = async ( query = {}, field={} ) => {
|
|
8
|
+
return model.taskQuestionModel.findOne( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const updateMany = async ( query = {}, record={} ) => {
|
|
12
|
+
return model.taskQuestionModel.updateMany( query, { $set: record } );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const deleteMany = async ( query = {} ) => {
|
|
16
|
+
return model.taskQuestionModel.deleteMany( query );
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const insertMany = async ( data = [] ) => {
|
|
20
|
+
return model.taskQuestionModel.insertMany( data );
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const aggregate = async ( query = [] ) => {
|
|
24
|
+
return model.taskQuestionModel.aggregate( query );
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const create = async ( data = [] ) => {
|
|
28
|
+
return model.taskQuestionModel.create( data );
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import model from 'tango-api-schema';
|
|
2
|
+
|
|
3
|
+
export const findOne = async ( query={}, field={} ) => {
|
|
4
|
+
return model.userModel.findOne( query, field );
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const find = async ( query={}, field={} ) => {
|
|
8
|
+
return model.userModel.find( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const create = async ( document = {} ) => {
|
|
12
|
+
return model.userModel.create( document );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const deleteOne = async ( query = {} ) => {
|
|
16
|
+
return model.userModel.deleteOne( query );
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const updateOne = async ( query = {}, record={} ) => {
|
|
20
|
+
return model.userModel.updateOne( query, { $set: record } );
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const aggregate = async ( query = {} ) => {
|
|
24
|
+
return model.userModel.aggregate( query );
|
|
25
|
+
};
|
|
26
|
+
|