tango-api-schema 1.0.15 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,207 +1,225 @@
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
- const clientSchema=new mongoose.Schema( {
5
- brandName: {
6
- type: String,
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
- email: {
38
- type: String,
39
- trim: true,
40
- required: true,
41
- unique: true,
12
+ brandIndex: {
13
+ type: Number,
42
14
  },
43
- dialCode: {
15
+ clientId: {
16
+ // client_Id changed to clientId
44
17
  type: String,
45
18
  trim: true,
46
19
  },
47
- },
48
- active: {
49
- type: Boolean,
50
- default: true,
51
- },
52
- profileDetail: {
53
- registeredCompanyName: {
54
- type: String,
55
- trim: true,
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
- industry: {
58
- type: String,
59
- trim: true,
50
+ active: {
51
+ type: Boolean,
52
+ default: true,
60
53
  },
61
- subIndustry: {
62
- type: String,
63
- trim: true,
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
- headQuarters: {
66
- type: String,
67
- trim: true,
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
- CINNumber: {
120
+ clientStatus: {
70
121
  type: String,
122
+ enum: ["pending", "live", "hold", "suspended", "deactivated", "rejected"],
123
+ default: "pending",
71
124
  trim: true,
72
125
  },
73
- registeredAddress: {
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
- website: {
78
- type: String,
79
- },
80
- open: {
81
- type: String,
82
- default: '10:00:00',
83
- },
84
- close: {
85
- type: String,
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
- reverseAPI:{
103
- status:{
104
- type:Boolean
143
+ auditConfigs: {
144
+ count: {
145
+ type: Number,
146
+ default: 200,
105
147
  },
106
- api:{
107
- type: String,
148
+ audit: {
149
+ type: Boolean,
150
+ default: true,
108
151
  },
109
- apiType:{
110
- enum: [ 'receiving', 'collection' ],
111
- type: String,
152
+ default: {
153
+ type: Boolean,
154
+ default: true,
112
155
  },
113
- apiKey:{
156
+ queueName: {
114
157
  type: String,
115
- }
116
- }
117
- },
118
- clientStatus: {
119
- type: String,
120
- enum: [ 'pending', 'live', 'hold', 'suspended', 'deactivated', 'rejected' ],
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
- ticketPeriod: {
195
- type: Number,
196
- default: 120, // in minutes
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
- strict: true,
201
- versionKey: false,
202
- timestamps: true,
203
- } );
216
+ {
217
+ strict: true,
218
+ versionKey: false,
219
+ timestamps: true,
220
+ }
221
+ );
204
222
 
205
- clientSchema.plugin( uniqueValidator );
223
+ clientSchema.plugin(uniqueValidator);
206
224
 
207
- export default mongoose.model( 'Client', clientSchema );
225
+ export default mongoose.model("Client", clientSchema);
@@ -1,9 +1,9 @@
1
- import { Schema, model } from 'mongoose';
1
+ import mongoose from 'mongoose';
2
2
 
3
- const nobSchema=new Schema( {
3
+ const nobSchema=new mongoose.Schema( {
4
4
 
5
5
  client: { // client_Id changed to clientId
6
- type: Schema.Types.ObjectId,
6
+ type: mongoose.Schema.Types.ObjectId,
7
7
  ref: 'Brand',
8
8
  },
9
9
  clientId: {
@@ -19,7 +19,7 @@ const nobSchema=new Schema( {
19
19
  required: true,
20
20
  },
21
21
  store: {
22
- type: Schema.Types.ObjectId,
22
+ type: mongoose.Schema.Types.ObjectId,
23
23
  ref: 'Store',
24
24
  },
25
25
  nobCount: {
@@ -27,8 +27,8 @@ const nobSchema=new Schema( {
27
27
  trim: true,
28
28
  },
29
29
  nobAmount: {
30
- type: Schema.Types.Decimal128,
31
- default: '0.0',
30
+ type: mongoose.Schema.Types.Decimal128,
31
+ //default: '0.0',
32
32
  },
33
33
  }, {
34
34
  strict: true,
@@ -36,4 +36,4 @@ const nobSchema=new Schema( {
36
36
  timestamps: true,
37
37
  } );
38
38
 
39
- export default model( 'nobBilling', nobSchema, 'nobBilling' );
39
+ export default mongoose.model( 'nobBilling', nobSchema, 'nobBilling' );
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  // NPM Modules
7
- import { Schema, model } from 'mongoose';
7
+ import mongoose from 'mongoose';
8
8
 
9
9
  // Schema
10
- const collection = new Schema(
10
+ const collection = new mongoose.Schema(
11
11
  {
12
12
  source: {
13
13
  type: Object,
@@ -23,4 +23,4 @@ const collection = new Schema(
23
23
 
24
24
  // collection.plugin(uniqueValidator);
25
25
 
26
- export default model( 'nobClient', collection, 'nobClient' );
26
+ export default mongoose.model( 'nobClient', collection, 'nobClient' );
@@ -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,
@@ -92,4 +92,4 @@ const collection = new mongoose.Schema(
92
92
  // Plugins
93
93
  collection.plugin(uniqueValidator);
94
94
 
95
- export default model("User", collection);
95
+ export default mongoose.model("User", collection);