tango-api-schema 1.0.16 → 1.0.17
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/package.json +1 -1
- package/schema/client.model.js +195 -177
- package/schema/stores.model.js +3 -12
package/package.json
CHANGED
package/schema/client.model.js
CHANGED
|
@@ -1,207 +1,225 @@
|
|
|
1
|
-
import mongoose from
|
|
2
|
-
import uniqueValidator from
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import uniqueValidator from "mongoose-unique-validator";
|
|
3
3
|
|
|
4
|
-
const clientSchema=new mongoose.Schema(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
trim: true,
|
|
8
|
-
required: true,
|
|
9
|
-
unique: true,
|
|
10
|
-
},
|
|
11
|
-
brandIndex: {
|
|
12
|
-
type: Number,
|
|
13
|
-
},
|
|
14
|
-
clientId: { // client_Id changed to clientId
|
|
15
|
-
type: String,
|
|
16
|
-
trim: true,
|
|
17
|
-
},
|
|
18
|
-
userDetail: {
|
|
19
|
-
userId: {
|
|
20
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
21
|
-
ref: 'User',
|
|
22
|
-
},
|
|
23
|
-
firstName: {
|
|
24
|
-
type: String,
|
|
25
|
-
trim: true,
|
|
26
|
-
},
|
|
27
|
-
lastName: {
|
|
28
|
-
type: String,
|
|
29
|
-
trim: true,
|
|
30
|
-
},
|
|
31
|
-
phone: {
|
|
4
|
+
const clientSchema = new mongoose.Schema(
|
|
5
|
+
{
|
|
6
|
+
brandName: {
|
|
32
7
|
type: String,
|
|
33
8
|
trim: true,
|
|
34
9
|
required: true,
|
|
35
10
|
unique: true,
|
|
36
11
|
},
|
|
37
|
-
|
|
38
|
-
type:
|
|
39
|
-
trim: true,
|
|
40
|
-
required: true,
|
|
41
|
-
unique: true,
|
|
12
|
+
brandIndex: {
|
|
13
|
+
type: Number,
|
|
42
14
|
},
|
|
43
|
-
|
|
15
|
+
clientId: {
|
|
16
|
+
// client_Id changed to clientId
|
|
44
17
|
type: String,
|
|
45
18
|
trim: true,
|
|
46
19
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
20
|
+
userDetail: {
|
|
21
|
+
userId: {
|
|
22
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
23
|
+
ref: "User",
|
|
24
|
+
},
|
|
25
|
+
firstName: {
|
|
26
|
+
type: String,
|
|
27
|
+
trim: true,
|
|
28
|
+
},
|
|
29
|
+
lastName: {
|
|
30
|
+
type: String,
|
|
31
|
+
trim: true,
|
|
32
|
+
},
|
|
33
|
+
phone: {
|
|
34
|
+
type: String,
|
|
35
|
+
trim: true,
|
|
36
|
+
required: true,
|
|
37
|
+
unique: true,
|
|
38
|
+
},
|
|
39
|
+
email: {
|
|
40
|
+
type: String,
|
|
41
|
+
trim: true,
|
|
42
|
+
required: true,
|
|
43
|
+
unique: true,
|
|
44
|
+
},
|
|
45
|
+
dialCode: {
|
|
46
|
+
type: String,
|
|
47
|
+
trim: true,
|
|
48
|
+
},
|
|
56
49
|
},
|
|
57
|
-
|
|
58
|
-
type:
|
|
59
|
-
|
|
50
|
+
active: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: true,
|
|
60
53
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
profileDetail: {
|
|
55
|
+
registeredCompanyName: {
|
|
56
|
+
type: String,
|
|
57
|
+
trim: true,
|
|
58
|
+
},
|
|
59
|
+
industry: {
|
|
60
|
+
type: String,
|
|
61
|
+
trim: true,
|
|
62
|
+
},
|
|
63
|
+
subIndustry: {
|
|
64
|
+
type: String,
|
|
65
|
+
trim: true,
|
|
66
|
+
},
|
|
67
|
+
headQuarters: {
|
|
68
|
+
type: String,
|
|
69
|
+
trim: true,
|
|
70
|
+
},
|
|
71
|
+
CINNumber: {
|
|
72
|
+
type: String,
|
|
73
|
+
trim: true,
|
|
74
|
+
},
|
|
75
|
+
registeredAddress: {
|
|
76
|
+
type: String,
|
|
77
|
+
trim: true,
|
|
78
|
+
},
|
|
79
|
+
website: {
|
|
80
|
+
type: String,
|
|
81
|
+
},
|
|
82
|
+
open: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: "10:00:00",
|
|
85
|
+
},
|
|
86
|
+
close: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: "22:00:00",
|
|
89
|
+
},
|
|
64
90
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
91
|
+
clientApi: {
|
|
92
|
+
apiKey: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: null,
|
|
95
|
+
},
|
|
96
|
+
status: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: false,
|
|
99
|
+
},
|
|
100
|
+
allowedIps: {
|
|
101
|
+
type: Array,
|
|
102
|
+
default: ["*"],
|
|
103
|
+
},
|
|
104
|
+
reverseAPI: {
|
|
105
|
+
status: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
},
|
|
108
|
+
api: {
|
|
109
|
+
type: String,
|
|
110
|
+
},
|
|
111
|
+
apiType: {
|
|
112
|
+
enum: ["receiving", "collection"],
|
|
113
|
+
type: String,
|
|
114
|
+
},
|
|
115
|
+
apiKey: {
|
|
116
|
+
type: String,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
68
119
|
},
|
|
69
|
-
|
|
120
|
+
clientStatus: {
|
|
70
121
|
type: String,
|
|
122
|
+
enum: ["pending", "live", "hold", "suspended", "deactivated", "rejected"],
|
|
123
|
+
default: "pending",
|
|
71
124
|
trim: true,
|
|
72
125
|
},
|
|
73
|
-
|
|
126
|
+
accountType: {
|
|
127
|
+
// client_type changed to accountType
|
|
74
128
|
type: String,
|
|
129
|
+
enum: ["free", "trial", "paid"],
|
|
75
130
|
trim: true,
|
|
131
|
+
default: "trial",
|
|
76
132
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
default: '22:00:00',
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
clientApi: {
|
|
90
|
-
apiKey: {
|
|
91
|
-
type: String,
|
|
92
|
-
default: null,
|
|
93
|
-
},
|
|
94
|
-
status: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
default: false,
|
|
97
|
-
},
|
|
98
|
-
allowedIps: {
|
|
99
|
-
type: Array,
|
|
100
|
-
default: [ '*' ],
|
|
133
|
+
reportConfigs: {
|
|
134
|
+
report: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: true,
|
|
137
|
+
},
|
|
138
|
+
reportName: {
|
|
139
|
+
type: String,
|
|
140
|
+
required: true,
|
|
141
|
+
},
|
|
101
142
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
type:
|
|
143
|
+
auditConfigs: {
|
|
144
|
+
count: {
|
|
145
|
+
type: Number,
|
|
146
|
+
default: 200,
|
|
105
147
|
},
|
|
106
|
-
|
|
107
|
-
type:
|
|
148
|
+
audit: {
|
|
149
|
+
type: Boolean,
|
|
150
|
+
default: true,
|
|
108
151
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
152
|
+
default: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
default: true,
|
|
112
155
|
},
|
|
113
|
-
|
|
156
|
+
queueName: {
|
|
114
157
|
type: String,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
default: 'pending',
|
|
122
|
-
trim: true,
|
|
123
|
-
},
|
|
124
|
-
accountType: { // client_type changed to accountType
|
|
125
|
-
type: String,
|
|
126
|
-
enum: [ 'free', 'trial', 'paid' ],
|
|
127
|
-
trim: true,
|
|
128
|
-
default: 'trial',
|
|
129
|
-
},
|
|
130
|
-
reportConfigs: {
|
|
131
|
-
report: {
|
|
132
|
-
type: Boolean,
|
|
133
|
-
default: true,
|
|
134
|
-
},
|
|
135
|
-
reportName: {
|
|
136
|
-
type: String,
|
|
137
|
-
required: true,
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
auditConfigs: {
|
|
141
|
-
count: {
|
|
142
|
-
type: Number,
|
|
143
|
-
default: 200,
|
|
144
|
-
},
|
|
145
|
-
audit: {
|
|
146
|
-
type: Boolean,
|
|
147
|
-
default: true,
|
|
148
|
-
},
|
|
149
|
-
default: {
|
|
150
|
-
type: Boolean,
|
|
151
|
-
default: true,
|
|
152
|
-
},
|
|
153
|
-
queueName: {
|
|
154
|
-
type: String,
|
|
155
|
-
default: '',
|
|
156
|
-
},
|
|
157
|
-
ratio: {
|
|
158
|
-
type: mongoose.Types.Decimal128,
|
|
159
|
-
default: 0.75,
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
ticketConfig: {
|
|
163
|
-
liveTickets: { // live needs to create for a day
|
|
164
|
-
type: Boolean,
|
|
165
|
-
default: false,
|
|
166
|
-
},
|
|
167
|
-
infraTickets: { // infratickets needs to create for a day
|
|
168
|
-
type: Boolean,
|
|
169
|
-
default: false,
|
|
170
|
-
},
|
|
171
|
-
// liveConfig: { // live one - Every 1 hour, three - every three hour
|
|
172
|
-
// type: Number, // liveConfig is changed to ticketPeriod by praveen
|
|
173
|
-
// default: 0,
|
|
174
|
-
// },
|
|
175
|
-
ticketReopen: {
|
|
176
|
-
type: Number,
|
|
177
|
-
default: 0,
|
|
178
|
-
},
|
|
179
|
-
infraLimit: { // Downtime limit for creating ticket
|
|
180
|
-
type: Number,
|
|
181
|
-
},
|
|
182
|
-
autoGenerate: { // if its 2 day downtime is past two days reach the infralimit then will need to create ticket
|
|
183
|
-
type: Number,
|
|
184
|
-
default: 0,
|
|
185
|
-
},
|
|
186
|
-
infraDowntime: {
|
|
187
|
-
type: Number,
|
|
188
|
-
default: 0,
|
|
189
|
-
},
|
|
190
|
-
storeAddedStatus: { // if it is true after add a store against brand
|
|
191
|
-
type: Boolean,
|
|
192
|
-
default: false,
|
|
158
|
+
default: "",
|
|
159
|
+
},
|
|
160
|
+
ratio: {
|
|
161
|
+
type: mongoose.Types.Decimal128,
|
|
162
|
+
default: 0.75,
|
|
163
|
+
},
|
|
193
164
|
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
165
|
+
ticketConfigs: {
|
|
166
|
+
|
|
167
|
+
liveTickets: {
|
|
168
|
+
// live needs to create for a day
|
|
169
|
+
type: Boolean,
|
|
170
|
+
default: false,
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
ticketPeriod: { //live ticket period in minutes
|
|
174
|
+
type: Number,
|
|
175
|
+
default: 120, // in minutes
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
infraTickets: {
|
|
179
|
+
// infratickets needs to create for a day t-1
|
|
180
|
+
type: Boolean,
|
|
181
|
+
default: false,
|
|
182
|
+
},
|
|
183
|
+
// liveConfig: { // live one - Every 1 hour, three - every three hour
|
|
184
|
+
// type: Number, // liveConfig is changed to ticketPeriod by praveen
|
|
185
|
+
// default: 0,
|
|
186
|
+
// },
|
|
187
|
+
ticketReopen: {
|
|
188
|
+
type: Number,
|
|
189
|
+
default: 0,
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
infraLimit: {
|
|
193
|
+
// Downtime limit for creating ticket
|
|
194
|
+
type: Number,
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
autoGenerate: {
|
|
198
|
+
// if its 2 day downtime is past two days reach the infralimit then will need to create ticket
|
|
199
|
+
type: Number,
|
|
200
|
+
default: 0,
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
// infraDowntime: {
|
|
204
|
+
// type: Number,
|
|
205
|
+
// default: 0,
|
|
206
|
+
// }, //removed by praveen
|
|
207
|
+
|
|
208
|
+
storeAddedStatus: {
|
|
209
|
+
// if it is true after add a store against brand
|
|
210
|
+
type: Boolean,
|
|
211
|
+
default: false,
|
|
212
|
+
},
|
|
213
|
+
|
|
197
214
|
},
|
|
198
215
|
},
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
216
|
+
{
|
|
217
|
+
strict: true,
|
|
218
|
+
versionKey: false,
|
|
219
|
+
timestamps: true,
|
|
220
|
+
}
|
|
221
|
+
);
|
|
204
222
|
|
|
205
|
-
clientSchema.plugin(
|
|
223
|
+
clientSchema.plugin(uniqueValidator);
|
|
206
224
|
|
|
207
|
-
|
|
225
|
+
export default mongoose.model("Client", clientSchema);
|
package/schema/stores.model.js
CHANGED
|
@@ -150,10 +150,6 @@ const collection = new mongoose.Schema(
|
|
|
150
150
|
type: Boolean,
|
|
151
151
|
default: true,
|
|
152
152
|
},
|
|
153
|
-
forceInstall: {
|
|
154
|
-
type: Boolean,
|
|
155
|
-
default: false,
|
|
156
|
-
},
|
|
157
153
|
timeDownload: {
|
|
158
154
|
type: Date,
|
|
159
155
|
},
|
|
@@ -174,14 +170,6 @@ const collection = new mongoose.Schema(
|
|
|
174
170
|
trim: true,
|
|
175
171
|
enum: [ 'x32', 'x64' ],
|
|
176
172
|
},
|
|
177
|
-
paired: {
|
|
178
|
-
type: Boolean,
|
|
179
|
-
default: false,
|
|
180
|
-
},
|
|
181
|
-
configured: {
|
|
182
|
-
type: Boolean,
|
|
183
|
-
default: false,
|
|
184
|
-
},
|
|
185
173
|
updateAppVersion: {
|
|
186
174
|
type: String,
|
|
187
175
|
trim: true,
|
|
@@ -278,6 +266,9 @@ const collection = new mongoose.Schema(
|
|
|
278
266
|
systemTimeZone: {
|
|
279
267
|
type: String,
|
|
280
268
|
},
|
|
269
|
+
configurationStage:{
|
|
270
|
+
type: String,
|
|
271
|
+
}
|
|
281
272
|
},
|
|
282
273
|
pendingInit: { //next level of initialization
|
|
283
274
|
type: String,
|