tango-api-schema 1.0.65 → 1.0.67

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/schema/client.model.js +212 -208
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,248 +1,252 @@
1
- import mongoose from 'mongoose';
2
- import uniqueValidator from 'mongoose-unique-validator';
1
+ import mongoose from "mongoose";
2
+ import uniqueValidator from "mongoose-unique-validator";
3
3
 
4
4
  const clientSchema = new mongoose.Schema(
5
- {
6
- brandName: {
5
+ {
6
+ brandName: {
7
+ type: String,
8
+ trim: true,
9
+ required: true,
10
+ unique: true,
11
+ },
12
+ brandIndex: {
13
+ type: Number,
14
+ },
15
+ clientId: {
16
+ // client_Id changed to clientId
17
+ type: String,
18
+ trim: true,
19
+ },
20
+ userDetail: {
21
+ userId: {
22
+ type: mongoose.Schema.Types.ObjectId,
23
+ ref: "User",
24
+ },
25
+ },
26
+ active: {
27
+ type: Boolean,
28
+ default: true,
29
+ },
30
+ profileDetail: {
31
+ image: {
7
32
  type: String,
8
33
  trim: true,
9
- required: true,
10
- unique: true,
11
34
  },
12
- brandIndex: {
13
- type: Number,
35
+ registeredCompanyName: {
36
+ type: String,
37
+ trim: true,
14
38
  },
15
- clientId: {
16
- // client_Id changed to clientId
39
+ industry: {
17
40
  type: String,
18
41
  trim: true,
19
42
  },
20
- userDetail: {
21
- userId: {
22
- type: mongoose.Schema.Types.ObjectId,
23
- ref: 'User',
24
- },
43
+ subIndustry: {
44
+ type: String,
45
+ trim: true,
46
+ },
47
+ headQuarters: {
48
+ type: String,
49
+ trim: true,
25
50
  },
26
- active: {
51
+ CINNumber: {
52
+ type: String,
53
+ trim: true,
54
+ },
55
+ registeredAddress: {
56
+ type: String,
57
+ trim: true,
58
+ },
59
+ website: {
60
+ type: String,
61
+ },
62
+ open: {
63
+ type: String,
64
+ default: "10:00:00",
65
+ },
66
+ close: {
67
+ type: String,
68
+ default: "22:00:00",
69
+ },
70
+ },
71
+ clientApi: {
72
+ apiKey: {
73
+ type: String,
74
+ default: null,
75
+ },
76
+ status: {
27
77
  type: Boolean,
28
- default: true,
78
+ default: false,
29
79
  },
30
- profileDetail: {
31
- image: {
32
- type: String,
33
- trim: true,
34
- },
35
- registeredCompanyName: {
36
- type: String,
37
- trim: true,
38
- },
39
- industry: {
40
- type: String,
41
- trim: true,
42
- },
43
- subIndustry: {
44
- type: String,
45
- trim: true,
46
- },
47
- headQuarters: {
48
- type: String,
49
- trim: true,
50
- },
51
- CINNumber: {
52
- type: String,
53
- trim: true,
54
- },
55
- registeredAddress: {
56
- type: String,
57
- trim: true,
58
- },
59
- website: {
60
- type: String,
80
+ allowedIps: {
81
+ type: Array,
82
+ default: ["*"],
83
+ },
84
+ reverseAPI: {
85
+ status: {
86
+ type: Boolean,
61
87
  },
62
- open: {
88
+ api: {
63
89
  type: String,
64
- default: '10:00:00',
65
90
  },
66
- close: {
91
+ apiType: {
92
+ enum: ["receiving", "collection"],
67
93
  type: String,
68
- default: '22:00:00',
69
94
  },
70
- },
71
- clientApi: {
72
95
  apiKey: {
73
96
  type: String,
74
- default: null,
75
- },
76
- status: {
77
- type: Boolean,
78
- default: false,
79
- },
80
- allowedIps: {
81
- type: Array,
82
- default: [ '*' ],
83
- },
84
- reverseAPI: {
85
- status: {
86
- type: Boolean,
87
- },
88
- api: {
89
- type: String,
90
- },
91
- apiType: {
92
- enum: [ 'receiving', 'collection' ],
93
- type: String,
94
- },
95
- apiKey: {
96
- type: String,
97
- },
98
97
  },
99
98
  },
100
- clientStatus: {
99
+ },
100
+ clientStatus: {
101
+ type: String,
102
+ enum: ["pending", "live", "hold", "suspended", "deactivated", "rejected"],
103
+ default: "pending",
104
+ trim: true,
105
+ },
106
+ accountType: {
107
+ // client_type changed to accountType
108
+ type: String,
109
+ enum: ["free", "trial", "paid"],
110
+ trim: true,
111
+ default: "trial",
112
+ },
113
+ assignedUsers: {
114
+ csm: {
115
+ type: Object,
116
+ },
117
+ ops: {
118
+ type: Array,
119
+ },
120
+ },
121
+ reportConfigs: {
122
+ report: {
123
+ type: Boolean,
124
+ default: true,
125
+ },
126
+ reportName: {
101
127
  type: String,
102
- enum: [ 'pending', 'live', 'hold', 'suspended', 'deactivated', 'rejected' ],
103
- default: 'pending',
104
- trim: true,
128
+ default: "",
105
129
  },
106
- accountType: {
107
- // client_type changed to accountType
130
+ liveMetrics: {
108
131
  type: String,
109
- enum: [ 'free', 'trial', 'paid' ],
110
- trim: true,
111
- default: 'trial',
132
+ default: "",
112
133
  },
113
- assignedUsers: {
114
- csm: {
115
- type: Object,
116
- },
117
- ops: {
118
- type: Array,
119
- },
134
+ },
135
+ auditConfigs: {
136
+ count: {
137
+ type: Number,
138
+ default: 200,
120
139
  },
121
- reportConfigs: {
122
- report: {
123
- type: Boolean,
124
- default: true,
125
- },
126
- reportName: {
127
- type: String,
128
- default: '',
129
- },
140
+ audit: {
141
+ type: Boolean,
142
+ default: true,
130
143
  },
131
- auditConfigs: {
132
- count: {
133
- type: Number,
134
- default: 200,
135
- },
136
- audit: {
137
- type: Boolean,
138
- default: true,
139
- },
140
- default: {
141
- type: Boolean,
142
- default: true,
143
- },
144
- queueName: {
145
- type: String,
146
- default: '',
147
- },
148
- ratio: {
149
- type: mongoose.Schema.Types.Number,
150
- default: 0.75,
151
- },
144
+ default: {
145
+ type: Boolean,
146
+ default: true,
152
147
  },
153
- ticketConfigs: {
154
- liveTickets: {
155
- type: Boolean,
156
- default: true,
157
- },
158
- infraTickets: {
148
+ queueName: {
149
+ type: String,
150
+ default: "",
151
+ },
152
+ ratio: {
153
+ type: mongoose.Schema.Types.Number,
154
+ default: 0.75,
155
+ },
156
+ },
157
+ ticketConfigs: {
158
+ liveTickets: {
159
+ type: Boolean,
160
+ default: true,
161
+ },
162
+ infraTickets: {
159
163
  // infratickets needs to create for a day t-1
160
- type: Boolean,
161
- default: false,
162
- },
163
- infraLimit: {
164
- type: Number,
165
- },
166
- autoGenerate: {
164
+ type: Boolean,
165
+ default: false,
166
+ },
167
+ infraLimit: {
168
+ type: Number,
169
+ },
170
+ autoGenerate: {
167
171
  // if its 2 day downtime is past two days reach the infralimit then will need to create ticket
168
- type: Number,
169
- default: 0,
170
- },
171
- ticketPeriod: {
172
+ type: Number,
173
+ default: 0,
174
+ },
175
+ ticketPeriod: {
172
176
  // live ticket period in minutes
173
- type: Number,
174
- default: 120, // in minutes
175
- },
176
- ReInstallation: {
177
- type: Number,
178
- default: 0,
179
- },
180
- ticketReopen: {
181
- type: Number,
182
- default: 0,
183
- },
184
- liveTicketTime: {
185
- type: Date,
186
- },
177
+ type: Number,
178
+ default: 120, // in minutes
187
179
  },
188
- clientConfig: {
189
- missedOpportunityStartTime: {
190
- type: String,
191
- default: '>1',
192
- },
193
- bouncedConfigTime: {
194
- type: String,
195
- default: '<=1',
196
- },
197
- missedOpportunityEndTime: {
198
- type: String,
199
- default: '<=5',
200
- },
201
- conversionConfigTime: {
202
- type: String,
203
- default: '>5',
204
- },
205
- missedOpportunityCalculate: {
206
- type: String,
207
- enum: [ 'engagers-conversion', 'group-conversion' ],
208
- default: 'engagers-conversion',
209
- },
210
- conversionCalculate: {
211
- type: String,
212
- enum: [ 'footfall-count', 'engagers-count', 'billable-entities' ],
213
- default: 'engagers-count',
214
- },
215
- billableCalculate: {
216
- type: String,
217
- enum: [ 'footfall-count', 'engagers-count' ],
218
- default: 'engagers-count',
219
- },
220
- downtimeConsiderCameraCount: {
221
- type: String,
222
- },
223
- normalizedDowntime: {
224
- type: Number,
225
- default: 300,
226
- },
180
+ ReInstallation: {
181
+ type: Number,
182
+ default: 0,
227
183
  },
228
- finance: {
229
- costPerStore: {
230
- type: Number,
231
- },
184
+ ticketReopen: {
185
+ type: Number,
186
+ default: 0,
232
187
  },
233
- store_added_status: {
234
- // if it is true after add a store against brand
235
- type: Boolean,
236
- default: false,
188
+ liveTicketTime: {
189
+ type: Date,
190
+ },
191
+ },
192
+ clientConfig: {
193
+ missedOpportunityStartTime: {
194
+ type: String,
195
+ default: ">1",
196
+ },
197
+ bouncedConfigTime: {
198
+ type: String,
199
+ default: "<=1",
200
+ },
201
+ missedOpportunityEndTime: {
202
+ type: String,
203
+ default: "<=5",
204
+ },
205
+ conversionConfigTime: {
206
+ type: String,
207
+ default: ">5",
208
+ },
209
+ missedOpportunityCalculate: {
210
+ type: String,
211
+ enum: ["engagers-conversion", "group-conversion"],
212
+ default: "engagers-conversion",
213
+ },
214
+ conversionCalculate: {
215
+ type: String,
216
+ enum: ["footfall-count", "engagers-count", "billable-entities"],
217
+ default: "engagers-count",
218
+ },
219
+ billableCalculate: {
220
+ type: String,
221
+ enum: ["footfall-count", "engagers-count"],
222
+ default: "engagers-count",
223
+ },
224
+ downtimeConsiderCameraCount: {
225
+ type: String,
226
+ },
227
+ normalizedDowntime: {
228
+ type: Number,
229
+ default: 300,
237
230
  },
238
231
  },
239
- {
240
- strict: true,
241
- versionKey: false,
242
- timestamps: true,
232
+ finance: {
233
+ costPerStore: {
234
+ type: Number,
235
+ },
236
+ },
237
+ store_added_status: {
238
+ // if it is true after add a store against brand
239
+ type: Boolean,
240
+ default: false,
243
241
  },
242
+ },
243
+ {
244
+ strict: true,
245
+ versionKey: false,
246
+ timestamps: true,
247
+ }
244
248
  );
245
249
 
246
- clientSchema.plugin( uniqueValidator );
250
+ clientSchema.plugin(uniqueValidator);
247
251
 
248
- export default mongoose.model( 'Client', clientSchema );
252
+ export default mongoose.model("Client", clientSchema);