tango-api-schema 1.0.57 → 1.0.59

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 CHANGED
@@ -34,6 +34,8 @@ import dlZoneModel from "./schema/dlZone.model.js";
34
34
  import eyeTestModel from './schema/eyeTest.model.js';
35
35
  import ticketModel from "./schema/ticket.model.js";
36
36
  import activitylogModel from "./schema/activitylog.model.js";
37
+ import dailyWorkLogModel from "./schema/dailyWorkLog.model.js";
38
+
37
39
  export default {
38
40
  clientModel,
39
41
  cameraModel,
@@ -70,5 +72,6 @@ export default {
70
72
  dlZoneModel,
71
73
  eyeTestModel,
72
74
  ticketModel,
73
- activitylogModel
75
+ activitylogModel,
76
+ dailyWorkLogModel
74
77
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,208 +1,248 @@
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: {
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: {
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: {
5
+ {
6
+ brandName: {
48
7
  type: String,
49
8
  trim: true,
9
+ required: true,
10
+ unique: true,
50
11
  },
51
- CINNumber: {
52
- type: String,
53
- trim: true,
12
+ brandIndex: {
13
+ type: Number,
54
14
  },
55
- registeredAddress: {
15
+ clientId: {
16
+ // client_Id changed to clientId
56
17
  type: String,
57
18
  trim: true,
58
19
  },
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,
20
+ userDetail: {
21
+ userId: {
22
+ type: mongoose.Schema.Types.ObjectId,
23
+ ref: 'User',
24
+ },
75
25
  },
76
- status: {
26
+ active: {
77
27
  type: Boolean,
78
- default: false,
79
- },
80
- allowedIps: {
81
- type: Array,
82
- default: ["*"],
28
+ default: true,
83
29
  },
84
- reverseAPI: {
85
- status: {
86
- type: Boolean,
30
+ profileDetail: {
31
+ image: {
32
+ type: String,
33
+ trim: true,
87
34
  },
88
- api: {
35
+ registeredCompanyName: {
89
36
  type: String,
37
+ trim: true,
90
38
  },
91
- apiType: {
92
- enum: ["receiving", "collection"],
39
+ industry: {
93
40
  type: String,
41
+ trim: true,
94
42
  },
95
- apiKey: {
43
+ subIndustry: {
96
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,
61
+ },
62
+ open: {
63
+ type: String,
64
+ default: '10:00:00',
65
+ },
66
+ close: {
67
+ type: String,
68
+ default: '22:00:00',
97
69
  },
98
70
  },
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,
71
+ clientApi: {
72
+ apiKey: {
73
+ 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
+ },
125
99
  },
126
- reportName: {
100
+ clientStatus: {
127
101
  type: String,
128
- default: "",
129
- },
130
- },
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,
102
+ enum: [ 'pending', 'live', 'hold', 'suspended', 'deactivated', 'rejected' ],
103
+ default: 'pending',
104
+ trim: true,
143
105
  },
144
- queueName: {
106
+ accountType: {
107
+ // client_type changed to accountType
145
108
  type: String,
146
- default: "",
147
- },
148
- ratio: {
149
- type: mongoose.Schema.Types.Number,
150
- default: 0.75,
109
+ enum: [ 'free', 'trial', 'paid' ],
110
+ trim: true,
111
+ default: 'trial',
151
112
  },
152
- },
153
- ticketConfigs: {
154
- liveTickets: {
155
- type: Boolean,
156
- default: true,
113
+ assignedUsers: {
114
+ csm: {
115
+ type: Object,
116
+ },
117
+ ops: {
118
+ type: Array,
119
+ },
157
120
  },
158
- infraTickets: {
159
- // infratickets needs to create for a day t-1
160
- type: Boolean,
161
- default: false,
121
+ reportConfigs: {
122
+ report: {
123
+ type: Boolean,
124
+ default: true,
125
+ },
126
+ reportName: {
127
+ type: String,
128
+ default: '',
129
+ },
162
130
  },
163
- infraLimit: {
164
- type: Number,
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
+ },
165
152
  },
166
- autoGenerate: {
153
+ ticketConfigs: {
154
+ liveTickets: {
155
+ type: Boolean,
156
+ default: true,
157
+ },
158
+ infraTickets: {
159
+ // infratickets needs to create for a day t-1
160
+ type: Boolean,
161
+ default: false,
162
+ },
163
+ infraLimit: {
164
+ type: Number,
165
+ },
166
+ autoGenerate: {
167
167
  // 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
- //live ticket period in minutes
173
- type: Number,
174
- default: 120, // in minutes
175
- },
176
- ReInstallation: {
177
- type: Number,
178
- default: 0,
168
+ type: Number,
169
+ default: 0,
170
+ },
171
+ ticketPeriod: {
172
+ // 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
+ },
179
187
  },
180
- ticketReopen: {
181
- type: Number,
182
- default: 0,
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
+ },
183
227
  },
184
- liveTicketTime: {
185
- type: Date,
228
+ finance: {
229
+ costPerStore: {
230
+ type: Number,
231
+ },
186
232
  },
187
- },
188
- finance: {
189
- costPerStore: {
190
- type: Number,
233
+ store_added_status: {
234
+ // if it is true after add a store against brand
235
+ type: Boolean,
236
+ default: false,
191
237
  },
192
238
  },
193
- store_added_status: {
194
- // if it is true after add a store against brand
195
- type: Boolean,
196
- default: false,
239
+ {
240
+ strict: true,
241
+ versionKey: false,
242
+ timestamps: true,
197
243
  },
198
- },
199
- {
200
- strict: true,
201
- versionKey: false,
202
- timestamps: true,
203
- }
204
244
  );
205
245
 
206
- clientSchema.plugin(uniqueValidator);
246
+ clientSchema.plugin( uniqueValidator );
207
247
 
208
- export default mongoose.model("Client", clientSchema);
248
+ export default mongoose.model( 'Client', clientSchema );
@@ -0,0 +1,141 @@
1
+ import mongoose from 'mongoose';
2
+
3
+ // Model
4
+ const collection = new mongoose.Schema(
5
+ {
6
+ clientId: {
7
+ type: String,
8
+ required: true,
9
+ },
10
+ storeId: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ storeName: {
15
+ type: String,
16
+ },
17
+ storeDate: {
18
+ type: String,
19
+ required: true,
20
+ },
21
+ storeDateISO: {
22
+ type: Date,
23
+ },
24
+ employee_id: {
25
+ type: String,
26
+ required: true,
27
+ },
28
+ employee_org_id: {
29
+ type: String,
30
+ },
31
+ employee_name: {
32
+ type: String,
33
+ },
34
+ employee_entry_time: {
35
+ type: String,
36
+ },
37
+ employee_exit_time: {
38
+ type: String,
39
+ },
40
+ employee_productive_time: {
41
+ type: Number,
42
+ },
43
+ employee_break_time: {
44
+ type: Number,
45
+ },
46
+ avg_time_taken_to_assist_in_secs: {
47
+ type: Number,
48
+ },
49
+ avg_time_spent_with_customers_in_mins: {
50
+ type: Number,
51
+ },
52
+ total_customers_attended: {
53
+ type: Number,
54
+ },
55
+ avg_assist_and_timespent_in_zones: [
56
+ {
57
+ zone_name: {
58
+ type: String,
59
+ },
60
+ avg_assist_time: {
61
+ type: Number,
62
+ },
63
+ avg_timespent_time: {
64
+ type: Number,
65
+ },
66
+ },
67
+ ],
68
+ demographics: [
69
+ {
70
+ customer_id: {
71
+ type: Number,
72
+ },
73
+ customer_age: {
74
+ type: Number,
75
+ },
76
+ customer_gender: {
77
+ type: String,
78
+ },
79
+ },
80
+ ],
81
+ assist_and_timespent_data: [
82
+ {
83
+ customer_id: {
84
+ type: Number,
85
+ },
86
+ customer_entry_time: {
87
+ type: String,
88
+ },
89
+ customer_exit_time: {
90
+ type: String,
91
+ },
92
+ staff_assisted_time: {
93
+ type: String,
94
+ },
95
+ time_taken_to_assist_in_secs: {
96
+ type: Number,
97
+ },
98
+ timespent_with_customer_in_secs: {
99
+ type: Number,
100
+ },
101
+ },
102
+ ],
103
+ zone_timespent_and_assisted_data: [
104
+ {
105
+ zone_name: {
106
+ type: String,
107
+ },
108
+ customer_details: [
109
+ {
110
+ customer_id: {
111
+ type: Number,
112
+ },
113
+ cust_first_entry_time_in_zone: {
114
+ type: String,
115
+ },
116
+ cust_last_exit_time_in_zone: {
117
+ type: String,
118
+ },
119
+ staff_assisted_time_in_zone: {
120
+ type: String,
121
+ },
122
+ time_taken_to_assist_in_zone: {
123
+ type: Number,
124
+ },
125
+ time_spent_in_zone: {
126
+ type: Number,
127
+ },
128
+ },
129
+ ],
130
+ },
131
+
132
+ ],
133
+ },
134
+ {
135
+ timestamps: true,
136
+ strict: true,
137
+ versionKey: false,
138
+ },
139
+ );
140
+
141
+ export default mongoose.model( 'dailyWorkLog', collection );