tango-api-schema 2.0.22 → 2.0.24
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 +1 -1
- package/package.json +1 -1
- package/schema/authentication.model.js +28 -0
- package/schema/client.model.js +3 -0
- package/schema/group.model.js +27 -0
- package/{infraReason.model.js → schema/infraReason.model.js} +3 -0
- package/schema/tangoTicket.model.js +74 -33
- package/schema/user.model.js +6 -0
- package/schema/userAssignedStore.model.js +37 -0
package/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import cameraModel from "./schema/camera.model.js";
|
|
|
13
13
|
import reportModel from "./schema/report.model.js";
|
|
14
14
|
import standaredRoleModel from "./schema/standaredRole.model.js";
|
|
15
15
|
import userPermissionModel from "./schema/userPermission.model.js";
|
|
16
|
-
import infraReasonModel from "./infraReason.model.js";
|
|
16
|
+
import infraReasonModel from "./schema/infraReason.model.js";
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
export default {
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import mongooseUniqueValidator from 'mongoose-unique-validator';
|
|
3
|
+
|
|
4
|
+
const group = new mongoose.Schema(
|
|
5
|
+
{
|
|
6
|
+
user: {
|
|
7
|
+
type: mongoose.Types.ObjectId,
|
|
8
|
+
},
|
|
9
|
+
token: {
|
|
10
|
+
type:Array
|
|
11
|
+
},
|
|
12
|
+
refreshToken:{
|
|
13
|
+
type: String
|
|
14
|
+
},
|
|
15
|
+
type: {
|
|
16
|
+
type: String,
|
|
17
|
+
enum: ['retail']
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
strict: true,
|
|
22
|
+
versionKey: false,
|
|
23
|
+
timestamps: true,
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
group.plugin( mongooseUniqueValidator );
|
|
28
|
+
export default mongoose.model( 'group', group);
|
package/schema/client.model.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import mongooseUniqueValidator from 'mongoose-unique-validator';
|
|
3
|
+
|
|
4
|
+
const group = new mongoose.Schema(
|
|
5
|
+
{
|
|
6
|
+
groupName: {
|
|
7
|
+
type: String,
|
|
8
|
+
},
|
|
9
|
+
storeList: {
|
|
10
|
+
type:Array
|
|
11
|
+
},
|
|
12
|
+
clientId:{
|
|
13
|
+
type: String
|
|
14
|
+
},
|
|
15
|
+
description: {
|
|
16
|
+
type: String
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
strict: true,
|
|
21
|
+
versionKey: false,
|
|
22
|
+
timestamps: true,
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
group.plugin( mongooseUniqueValidator );
|
|
27
|
+
export default mongoose.model( 'group', group);
|
|
@@ -1,42 +1,83 @@
|
|
|
1
1
|
import mongoose from 'mongoose';
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
const tangoTickets = new mongoose.Schema(
|
|
4
4
|
{
|
|
5
|
-
ticketId:{
|
|
6
|
-
type:String,
|
|
5
|
+
ticketId: {
|
|
6
|
+
type: String,
|
|
7
7
|
},
|
|
8
|
-
issueDate:{
|
|
9
|
-
type:Date
|
|
8
|
+
issueDate: {
|
|
9
|
+
type: Date
|
|
10
10
|
},
|
|
11
|
-
issueClosedDate:{
|
|
12
|
-
type:Date
|
|
13
|
-
},
|
|
14
|
-
issueType:{
|
|
15
|
-
type:String,
|
|
16
|
-
enum:['infra','highcount','lowcount','installation']
|
|
11
|
+
issueClosedDate: {
|
|
12
|
+
type: Date
|
|
17
13
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
issueType: {
|
|
15
|
+
type: String,
|
|
16
|
+
enum: ['infra', 'highcount', 'lowcount', 'installation']
|
|
17
|
+
},
|
|
18
|
+
infraTicketDetails: {
|
|
19
|
+
addressingClient: {
|
|
20
|
+
type: mongoose.Types.ObjectId
|
|
21
|
+
},
|
|
22
|
+
addressingUser: {
|
|
23
|
+
type: mongoose.Types.ObjectId
|
|
24
|
+
},
|
|
25
|
+
assigntoUser: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
22
28
|
},
|
|
23
|
-
|
|
24
|
-
type:
|
|
29
|
+
filesCount: {
|
|
30
|
+
type: Number
|
|
25
31
|
},
|
|
26
|
-
|
|
27
|
-
type:
|
|
32
|
+
issueStatus: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'notidentified',
|
|
35
|
+
enum: ['identified', 'notidentified']
|
|
28
36
|
},
|
|
29
|
-
|
|
30
|
-
type:
|
|
31
|
-
default:'notidentified',
|
|
32
|
-
enum:['identified','notidentified']
|
|
37
|
+
ticketRefreshTime: {
|
|
38
|
+
type: Date
|
|
33
39
|
},
|
|
34
|
-
ticketType:{
|
|
35
|
-
type:String,
|
|
36
|
-
enum:['firsttimeticket','refreshticket'],
|
|
37
|
-
default:'firsttimeticket'
|
|
40
|
+
ticketType: {
|
|
41
|
+
type: String,
|
|
42
|
+
enum: ['firsttimeticket', 'refreshticket'],
|
|
43
|
+
default: 'firsttimeticket'
|
|
38
44
|
}
|
|
39
45
|
},
|
|
46
|
+
infraActivity: [
|
|
47
|
+
{
|
|
48
|
+
actionType: {
|
|
49
|
+
type: String
|
|
50
|
+
},
|
|
51
|
+
timeStamp: {
|
|
52
|
+
type: Date,
|
|
53
|
+
default: new Date()
|
|
54
|
+
},
|
|
55
|
+
actionBy: {
|
|
56
|
+
type: String
|
|
57
|
+
},
|
|
58
|
+
actionId: {
|
|
59
|
+
type: mongoose.Types.ObjectId
|
|
60
|
+
},
|
|
61
|
+
comment: {
|
|
62
|
+
type: {
|
|
63
|
+
String
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
reasons:[
|
|
67
|
+
{
|
|
68
|
+
primaryIssue: {
|
|
69
|
+
type: String
|
|
70
|
+
},
|
|
71
|
+
secondaryIssue: [
|
|
72
|
+
{
|
|
73
|
+
name: {
|
|
74
|
+
type: String
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}]
|
|
79
|
+
}
|
|
80
|
+
],
|
|
40
81
|
basicDetails: {
|
|
41
82
|
storeId: {
|
|
42
83
|
type: String
|
|
@@ -53,10 +94,10 @@ const tangoTickets = new mongoose.Schema(
|
|
|
53
94
|
trim: true,
|
|
54
95
|
},
|
|
55
96
|
},
|
|
56
|
-
status:{
|
|
57
|
-
type:String,
|
|
58
|
-
enum:['open','inprogress','close'],
|
|
59
|
-
default:'open',
|
|
97
|
+
status: {
|
|
98
|
+
type: String,
|
|
99
|
+
enum: ['open', 'inprogress', 'close'],
|
|
100
|
+
default: 'open',
|
|
60
101
|
},
|
|
61
102
|
},
|
|
62
103
|
{
|
|
@@ -65,6 +106,6 @@ const tangoTickets = new mongoose.Schema(
|
|
|
65
106
|
timestamps: true,
|
|
66
107
|
},
|
|
67
108
|
);
|
|
68
|
-
|
|
69
|
-
|
|
109
|
+
|
|
110
|
+
|
|
70
111
|
export default mongoose.model('tangoTicket', tangoTickets, 'tangoTicket');
|
package/schema/user.model.js
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import mongooseUniqueValidator from 'mongoose-unique-validator';
|
|
3
|
+
|
|
4
|
+
const userAssigned = new mongoose.Schema(
|
|
5
|
+
{
|
|
6
|
+
userEmail: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
unique: true,
|
|
10
|
+
},
|
|
11
|
+
clientId:{
|
|
12
|
+
type: String
|
|
13
|
+
},
|
|
14
|
+
Assigned: {
|
|
15
|
+
type: {
|
|
16
|
+
type: String,
|
|
17
|
+
enum: [ 'store', 'group' , 'client'],
|
|
18
|
+
},
|
|
19
|
+
list: {
|
|
20
|
+
type: Array,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
userType:{
|
|
24
|
+
type: String,
|
|
25
|
+
enum:['tango','client']
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
strict: true,
|
|
31
|
+
versionKey: false,
|
|
32
|
+
timestamps: true,
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
userAssigned.plugin( mongooseUniqueValidator );
|
|
37
|
+
export default mongoose.model( 'userAssignedStore', userAssigned ,'userAssignedStore');
|