tango-api-schema 1.0.53 → 1.0.55
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 +4 -2
- package/package.json +1 -1
- package/schema/ticket.model.js +114 -0
package/index.js
CHANGED
|
@@ -31,7 +31,8 @@ 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'
|
|
34
|
+
import eyeTestModel from './schema/eyeTest.model.js';
|
|
35
|
+
import ticketModel from "./schema/ticket.model.js";
|
|
35
36
|
export default {
|
|
36
37
|
clientModel,
|
|
37
38
|
cameraModel,
|
|
@@ -66,5 +67,6 @@ export default {
|
|
|
66
67
|
liveProcessedDataModel,
|
|
67
68
|
reportParameterModel,
|
|
68
69
|
dlZoneModel,
|
|
69
|
-
eyeTestModel
|
|
70
|
+
eyeTestModel,
|
|
71
|
+
ticketModel
|
|
70
72
|
};
|
package/package.json
CHANGED
|
@@ -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 );
|