tango-api-schema 1.0.54 → 1.0.56
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 +6 -2
- package/package.json +1 -1
- package/schema/activitylog.model.js +42 -0
- package/schema/ticket.model.js +114 -0
package/index.js
CHANGED
|
@@ -31,7 +31,9 @@ import liveDetectionDataModel from "./schema/liveDetectionData.model.js";
|
|
|
31
31
|
import liveProcessedDataModel from "./schema/liveProcessedData.model.js";
|
|
32
32
|
import reportParameterModel from "./schema/reportParameter.model.js";
|
|
33
33
|
import dlZoneModel from "./schema/dlZone.model.js";
|
|
34
|
-
import eyeTestModel from './schema/eyeTest.model.js'
|
|
34
|
+
import eyeTestModel from './schema/eyeTest.model.js';
|
|
35
|
+
import ticketModel from "./schema/ticket.model.js";
|
|
36
|
+
import activitylogModel from "./schema/activitylog.model.js";
|
|
35
37
|
export default {
|
|
36
38
|
clientModel,
|
|
37
39
|
cameraModel,
|
|
@@ -66,5 +68,7 @@ export default {
|
|
|
66
68
|
liveProcessedDataModel,
|
|
67
69
|
reportParameterModel,
|
|
68
70
|
dlZoneModel,
|
|
69
|
-
eyeTestModel
|
|
71
|
+
eyeTestModel,
|
|
72
|
+
ticketModel,
|
|
73
|
+
activitylogModel
|
|
70
74
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name api_activity_logs
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// NPM Modules
|
|
6
|
+
import { Schema, model } from 'mongoose';
|
|
7
|
+
|
|
8
|
+
// Schema
|
|
9
|
+
const activityLogs = new Schema(
|
|
10
|
+
{
|
|
11
|
+
userId: {
|
|
12
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
userName: {
|
|
16
|
+
type: String,
|
|
17
|
+
},
|
|
18
|
+
Date: {
|
|
19
|
+
type: Date,
|
|
20
|
+
},
|
|
21
|
+
logType: {
|
|
22
|
+
type: String,
|
|
23
|
+
enum: [ 'audit', 'infra', 'queries', 'admin', 'installation', 'report', 'live' ],
|
|
24
|
+
},
|
|
25
|
+
logSubType: {
|
|
26
|
+
type: String,
|
|
27
|
+
enum: [ 'auditStart', 'auditDone', 'auditDraft', 'reAuditPush', 'reTrigger', 'infraInit', 'infraClose', 'installInit', 'installClose', 'roleUpdation',
|
|
28
|
+
'roleCreation', 'uploadReport', 'generateReport', 'sendReport', 'pendingFromClient', 'pendingFromTango' ],
|
|
29
|
+
},
|
|
30
|
+
logData: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: {},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
timestamps: true,
|
|
37
|
+
strict: true,
|
|
38
|
+
versionKey: false,
|
|
39
|
+
},
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export default model( 'activity_logs', activityLogs );
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name api_tickets_models
|
|
3
|
+
* @description Tickets Schema
|
|
4
|
+
*/
|
|
5
|
+
import { Schema, model } from 'mongoose';
|
|
6
|
+
import uniqueValidator from 'mongoose-unique-validator';
|
|
7
|
+
|
|
8
|
+
// Schema
|
|
9
|
+
const collection = new Schema( {
|
|
10
|
+
TicketId: {
|
|
11
|
+
type: String,
|
|
12
|
+
trim: true,
|
|
13
|
+
required: true,
|
|
14
|
+
unique: true,
|
|
15
|
+
},
|
|
16
|
+
IssueType: {
|
|
17
|
+
type: String,
|
|
18
|
+
enum: [ 'Infra', 'Installation', 'Live' ],
|
|
19
|
+
trim: true,
|
|
20
|
+
},
|
|
21
|
+
Date: {
|
|
22
|
+
type: Date,
|
|
23
|
+
},
|
|
24
|
+
brandId: {
|
|
25
|
+
type: String,
|
|
26
|
+
},
|
|
27
|
+
brand: {
|
|
28
|
+
type: Schema.Types.ObjectId,
|
|
29
|
+
ref: 'Brand',
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
storeId: {
|
|
33
|
+
type: String,
|
|
34
|
+
},
|
|
35
|
+
store: {
|
|
36
|
+
type: Schema.Types.ObjectId,
|
|
37
|
+
ref: 'store',
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
storeName: {
|
|
41
|
+
type: String,
|
|
42
|
+
},
|
|
43
|
+
createdby: {
|
|
44
|
+
type: Schema.Types.ObjectId,
|
|
45
|
+
ref: 'User',
|
|
46
|
+
},
|
|
47
|
+
downtime: {
|
|
48
|
+
type: Number,
|
|
49
|
+
trim: true,
|
|
50
|
+
},
|
|
51
|
+
config_down_time: {
|
|
52
|
+
type: Number,
|
|
53
|
+
trim: true,
|
|
54
|
+
},
|
|
55
|
+
status: {
|
|
56
|
+
type: String,
|
|
57
|
+
enum: [ 'NotIdentified', 'PendingFromClient', 'PendingFromTango', 'Addressed', 'Installed', 'Onboarded', 'Paired' ],
|
|
58
|
+
default: 'NotIdentified',
|
|
59
|
+
},
|
|
60
|
+
Reason: [
|
|
61
|
+
{
|
|
62
|
+
comment: {
|
|
63
|
+
type: String,
|
|
64
|
+
},
|
|
65
|
+
AddressedBy: {
|
|
66
|
+
type: Schema.Types.ObjectId,
|
|
67
|
+
ref: 'users',
|
|
68
|
+
},
|
|
69
|
+
attachments: {
|
|
70
|
+
type: String,
|
|
71
|
+
},
|
|
72
|
+
callBackDays: {
|
|
73
|
+
type: Number,
|
|
74
|
+
},
|
|
75
|
+
updatedAt: {
|
|
76
|
+
type: Date,
|
|
77
|
+
default: Date.now(),
|
|
78
|
+
},
|
|
79
|
+
status: {
|
|
80
|
+
type: String,
|
|
81
|
+
enum: [ 'PendingFromClient', 'PendingFromTango' ],
|
|
82
|
+
},
|
|
83
|
+
issue: [
|
|
84
|
+
{
|
|
85
|
+
parent: {
|
|
86
|
+
type: Schema.Types.ObjectId,
|
|
87
|
+
ref: 'categories',
|
|
88
|
+
},
|
|
89
|
+
primary: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false,
|
|
92
|
+
},
|
|
93
|
+
subIssue: {
|
|
94
|
+
type: Schema.Types.ObjectId,
|
|
95
|
+
ref: 'categories',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
assigned: {
|
|
102
|
+
type: Schema.Types.ObjectId,
|
|
103
|
+
ref: 'User',
|
|
104
|
+
},
|
|
105
|
+
}, {
|
|
106
|
+
strict: true,
|
|
107
|
+
versionKey: false,
|
|
108
|
+
timestamps: true,
|
|
109
|
+
} );
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
collection.plugin( uniqueValidator );
|
|
113
|
+
|
|
114
|
+
export default model( 'TangoTicket', collection );
|