@grapadigital/shared-schemas 1.0.164 → 1.0.165
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/.claude/settings.json +7 -0
- package/dist/schemas/action.schema.js +6 -0
- package/dist/schemas/client.schema.js +4 -0
- package/dist/schemas/commission.schema.js +5 -0
- package/dist/schemas/content.schema.js +6 -0
- package/dist/schemas/invoice.schema.js +5 -0
- package/dist/schemas/log.schema.js +2 -0
- package/dist/schemas/payment.schema.js +10 -0
- package/dist/schemas/profile.schema.js +3 -0
- package/dist/schemas/recruitment.schema.js +5 -0
- package/dist/schemas/sale.schema.js +8 -0
- package/dist/schemas/schedule.schema.js +3 -0
- package/dist/schemas/token.schema.js +2 -0
- package/dist/schemas/user.schema.js +4 -0
- package/package.json +1 -1
- package/src/schemas/action.schema.ts +8 -0
- package/src/schemas/client.schema.ts +6 -0
- package/src/schemas/commission.schema.ts +7 -0
- package/src/schemas/content.schema.ts +8 -0
- package/src/schemas/invoice.schema.ts +7 -0
- package/src/schemas/log.schema.ts +4 -0
- package/src/schemas/payment.schema.ts +12 -0
- package/src/schemas/profile.schema.ts +5 -0
- package/src/schemas/recruitment.schema.ts +7 -0
- package/src/schemas/sale.schema.ts +10 -0
- package/src/schemas/schedule.schema.ts +5 -0
- package/src/schemas/token.schema.ts +4 -0
- package/src/schemas/user.schema.ts +6 -0
|
@@ -281,4 +281,10 @@ Action = __decorate([
|
|
|
281
281
|
], Action);
|
|
282
282
|
exports.Action = Action;
|
|
283
283
|
exports.ActionSchema = mongoose_1.SchemaFactory.createForClass(Action);
|
|
284
|
+
exports.ActionSchema.index({ organization: 1, status: 1 });
|
|
285
|
+
exports.ActionSchema.index({ organization: 1, client: 1 });
|
|
286
|
+
exports.ActionSchema.index({ organization: 1, sale: 1 });
|
|
287
|
+
exports.ActionSchema.index({ sale: 1 });
|
|
288
|
+
exports.ActionSchema.index({ organization: 1, startDate: 1, endDate: 1 });
|
|
289
|
+
exports.ActionSchema.index({ 'responsibles.service.email': 1 });
|
|
284
290
|
exports.ActionModel = (0, mongoose_2.model)('Action', exports.ActionSchema);
|
|
@@ -139,4 +139,8 @@ Client = __decorate([
|
|
|
139
139
|
], Client);
|
|
140
140
|
exports.Client = Client;
|
|
141
141
|
exports.ClientSchema = mongoose_1.SchemaFactory.createForClass(Client);
|
|
142
|
+
exports.ClientSchema.index({ name: 1 });
|
|
143
|
+
exports.ClientSchema.index({ 'company.legalName': 1 });
|
|
144
|
+
exports.ClientSchema.index({ 'company.document': 1 });
|
|
145
|
+
exports.ClientSchema.index({ createdAt: -1 });
|
|
142
146
|
exports.ClientModel = (0, mongoose_2.model)('Client', exports.ClientSchema);
|
|
@@ -113,4 +113,9 @@ Commission = __decorate([
|
|
|
113
113
|
], Commission);
|
|
114
114
|
exports.Commission = Commission;
|
|
115
115
|
exports.CommissionSchema = mongoose_1.SchemaFactory.createForClass(Commission);
|
|
116
|
+
exports.CommissionSchema.index({ email: 1, organization: 1 });
|
|
117
|
+
exports.CommissionSchema.index({ email: 1, status: 1 });
|
|
118
|
+
exports.CommissionSchema.index({ email: 1, createdAt: -1 });
|
|
119
|
+
exports.CommissionSchema.index({ organization: 1, status: 1 });
|
|
120
|
+
exports.CommissionSchema.index({ sale: 1, installmentNumber: 1, status: 1 });
|
|
116
121
|
exports.CommissionModel = (0, mongoose_2.model)('Commission', exports.CommissionSchema);
|
|
@@ -300,4 +300,10 @@ Content = __decorate([
|
|
|
300
300
|
], Content);
|
|
301
301
|
exports.Content = Content;
|
|
302
302
|
exports.ContentSchema = mongoose_1.SchemaFactory.createForClass(Content);
|
|
303
|
+
exports.ContentSchema.index({ action: 1, status: 1 });
|
|
304
|
+
exports.ContentSchema.index({ action: 1, profile: 1, type: 1 });
|
|
305
|
+
exports.ContentSchema.index({ action: 1, profile: 1, socialnetwork: 1 });
|
|
306
|
+
exports.ContentSchema.index({ action: 1, status: 1, postedAt: 1 });
|
|
307
|
+
exports.ContentSchema.index({ profile: 1 });
|
|
308
|
+
exports.ContentSchema.index({ createdAt: -1, status: 1 });
|
|
303
309
|
exports.ContentModel = (0, mongoose_2.model)('Content', exports.ContentSchema);
|
|
@@ -262,4 +262,9 @@ Invoice = __decorate([
|
|
|
262
262
|
], Invoice);
|
|
263
263
|
exports.Invoice = Invoice;
|
|
264
264
|
exports.InvoiceSchema = mongoose_1.SchemaFactory.createForClass(Invoice);
|
|
265
|
+
exports.InvoiceSchema.index({ organization: 1, phase: 1 });
|
|
266
|
+
exports.InvoiceSchema.index({ organization: 1, 'invoiced.issueDate': 1 });
|
|
267
|
+
exports.InvoiceSchema.index({ sale: 1, installmentNumber: 1 });
|
|
268
|
+
exports.InvoiceSchema.index({ sale: 1, phase: 1 });
|
|
269
|
+
exports.InvoiceSchema.index({ tags: 1 });
|
|
265
270
|
exports.InvoiceModel = (0, mongoose_2.model)('Invoice', exports.InvoiceSchema);
|
|
@@ -87,4 +87,6 @@ Log = __decorate([
|
|
|
87
87
|
], Log);
|
|
88
88
|
exports.Log = Log;
|
|
89
89
|
exports.LogSchema = mongoose_1.SchemaFactory.createForClass(Log);
|
|
90
|
+
exports.LogSchema.index({ referenceId: 1, reference: 1 });
|
|
91
|
+
exports.LogSchema.index({ reference: 1, updatedAt: -1 });
|
|
90
92
|
exports.LogModel = (0, mongoose_2.model)('Log', exports.LogSchema);
|
|
@@ -356,4 +356,14 @@ Payment = __decorate([
|
|
|
356
356
|
], Payment);
|
|
357
357
|
exports.Payment = Payment;
|
|
358
358
|
exports.PaymentSchema = mongoose_1.SchemaFactory.createForClass(Payment);
|
|
359
|
+
exports.PaymentSchema.index({ 'pending.sale': 1 });
|
|
360
|
+
exports.PaymentSchema.index({ 'pending.influencer': 1 });
|
|
361
|
+
exports.PaymentSchema.index({ 'pending.recruitment': 1 });
|
|
362
|
+
exports.PaymentSchema.index({ 'pending.action': 1 });
|
|
363
|
+
exports.PaymentSchema.index({ 'pending.supplier': 1 });
|
|
364
|
+
exports.PaymentSchema.index({ 'pending.recruitment': 1, 'pending.type': 1 });
|
|
365
|
+
exports.PaymentSchema.index({ 'pending.influencer': 1, 'pending.recruitment': 1, 'pending.action': 1, 'pending.type': 1 });
|
|
366
|
+
exports.PaymentSchema.index({ organization: 1, phase: 1 });
|
|
367
|
+
exports.PaymentSchema.index({ organization: 1, 'queued.issueDate': 1 });
|
|
368
|
+
exports.PaymentSchema.index({ omieId: 1 }, { sparse: true });
|
|
359
369
|
exports.PaymentModel = (0, mongoose_2.model)('Payment', exports.PaymentSchema);
|
|
@@ -55,4 +55,7 @@ Profile = __decorate([
|
|
|
55
55
|
], Profile);
|
|
56
56
|
exports.Profile = Profile;
|
|
57
57
|
exports.ProfileSchema = mongoose_1.SchemaFactory.createForClass(Profile);
|
|
58
|
+
exports.ProfileSchema.index({ influencer: 1 });
|
|
59
|
+
exports.ProfileSchema.index({ username: 1 });
|
|
60
|
+
exports.ProfileSchema.index({ username: 1, influencer: 1 });
|
|
58
61
|
exports.ProfileModel = (0, mongoose_2.model)('Profile', exports.ProfileSchema);
|
|
@@ -331,4 +331,9 @@ Recruitment = __decorate([
|
|
|
331
331
|
], Recruitment);
|
|
332
332
|
exports.Recruitment = Recruitment;
|
|
333
333
|
exports.RecruitmentSchema = mongoose_1.SchemaFactory.createForClass(Recruitment);
|
|
334
|
+
exports.RecruitmentSchema.index({ action: 1, status: 1 });
|
|
335
|
+
exports.RecruitmentSchema.index({ action: 1 });
|
|
336
|
+
exports.RecruitmentSchema.index({ profile: 1, status: 1 });
|
|
337
|
+
exports.RecruitmentSchema.index({ profile: 1, status: 1, 'scope.exclusivity': 1 });
|
|
338
|
+
exports.RecruitmentSchema.index({ username: 1, _id: 1 });
|
|
334
339
|
exports.RecruitmentModel = (0, mongoose_2.model)('Recruitment', exports.RecruitmentSchema);
|
|
@@ -482,4 +482,12 @@ Sale = __decorate([
|
|
|
482
482
|
], Sale);
|
|
483
483
|
exports.Sale = Sale;
|
|
484
484
|
exports.SaleSchema = mongoose_1.SchemaFactory.createForClass(Sale);
|
|
485
|
+
exports.SaleSchema.index({ organization: 1, phase: 1 });
|
|
486
|
+
exports.SaleSchema.index({ organization: 1, createdAt: -1 });
|
|
487
|
+
exports.SaleSchema.index({ organization: 1, 'formalization.brand': 1 });
|
|
488
|
+
exports.SaleSchema.index({ organization: 1, 'formalization.agency': 1 });
|
|
489
|
+
exports.SaleSchema.index({ organization: 1, closedAt: 1, phase: 1 });
|
|
490
|
+
exports.SaleSchema.index({ 'proposal.influencer': 1 });
|
|
491
|
+
exports.SaleSchema.index({ 'proposal.responsable.email': 1 });
|
|
492
|
+
exports.SaleSchema.index({ tags: 1 });
|
|
485
493
|
exports.SaleModel = (0, mongoose_2.model)('Sale', exports.SaleSchema);
|
|
@@ -74,4 +74,7 @@ Schedule = __decorate([
|
|
|
74
74
|
], Schedule);
|
|
75
75
|
exports.Schedule = Schedule;
|
|
76
76
|
exports.ScheduleSchema = mongoose_1.SchemaFactory.createForClass(Schedule);
|
|
77
|
+
exports.ScheduleSchema.index({ actionId: 1, scheduledAt: 1 });
|
|
78
|
+
exports.ScheduleSchema.index({ clientId: 1 });
|
|
79
|
+
exports.ScheduleSchema.index({ recruitmentId: 1 });
|
|
77
80
|
exports.ScheduleModel = (0, mongoose_2.model)('Schedule', exports.ScheduleSchema);
|
|
@@ -55,4 +55,6 @@ Token = __decorate([
|
|
|
55
55
|
], Token);
|
|
56
56
|
exports.Token = Token;
|
|
57
57
|
exports.TokenSchema = mongoose_1.SchemaFactory.createForClass(Token);
|
|
58
|
+
exports.TokenSchema.index({ profileId: 1, provider: 1 });
|
|
59
|
+
exports.TokenSchema.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
|
|
58
60
|
exports.TokenModel = (0, mongoose_2.model)('Token', exports.TokenSchema);
|
|
@@ -168,4 +168,8 @@ User = __decorate([
|
|
|
168
168
|
], User);
|
|
169
169
|
exports.User = User;
|
|
170
170
|
exports.UserSchema = mongoose_1.SchemaFactory.createForClass(User);
|
|
171
|
+
exports.UserSchema.index({ name: 1 });
|
|
172
|
+
exports.UserSchema.index({ 'company.document': 1 });
|
|
173
|
+
exports.UserSchema.index({ 'company.legalName': 1 });
|
|
174
|
+
exports.UserSchema.index({ createdAt: -1 });
|
|
171
175
|
exports.UserModel = (0, mongoose_2.model)('User', exports.UserSchema);
|
package/package.json
CHANGED
|
@@ -223,4 +223,12 @@ export class Action {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
export const ActionSchema = SchemaFactory.createForClass(Action);
|
|
226
|
+
|
|
227
|
+
ActionSchema.index({ organization: 1, status: 1 });
|
|
228
|
+
ActionSchema.index({ organization: 1, client: 1 });
|
|
229
|
+
ActionSchema.index({ organization: 1, sale: 1 });
|
|
230
|
+
ActionSchema.index({ sale: 1 });
|
|
231
|
+
ActionSchema.index({ organization: 1, startDate: 1, endDate: 1 });
|
|
232
|
+
ActionSchema.index({ 'responsibles.service.email': 1 });
|
|
233
|
+
|
|
226
234
|
export const ActionModel = MongooseModel('Action', ActionSchema);
|
|
@@ -97,4 +97,10 @@ export class Client extends User {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
export const ClientSchema = SchemaFactory.createForClass(Client);
|
|
100
|
+
|
|
101
|
+
ClientSchema.index({ name: 1 });
|
|
102
|
+
ClientSchema.index({ 'company.legalName': 1 });
|
|
103
|
+
ClientSchema.index({ 'company.document': 1 });
|
|
104
|
+
ClientSchema.index({ createdAt: -1 });
|
|
105
|
+
|
|
100
106
|
export const ClientModel = MongooseModel('Client', ClientSchema);
|
|
@@ -89,4 +89,11 @@ export class Commission {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export const CommissionSchema = SchemaFactory.createForClass(Commission);
|
|
92
|
+
|
|
93
|
+
CommissionSchema.index({ email: 1, organization: 1 });
|
|
94
|
+
CommissionSchema.index({ email: 1, status: 1 });
|
|
95
|
+
CommissionSchema.index({ email: 1, createdAt: -1 });
|
|
96
|
+
CommissionSchema.index({ organization: 1, status: 1 });
|
|
97
|
+
CommissionSchema.index({ sale: 1, installmentNumber: 1, status: 1 });
|
|
98
|
+
|
|
92
99
|
export const CommissionModel = MongooseModel('Commission', CommissionSchema);
|
|
@@ -228,4 +228,12 @@ export class Content {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
export const ContentSchema = SchemaFactory.createForClass(Content);
|
|
231
|
+
|
|
232
|
+
ContentSchema.index({ action: 1, status: 1 });
|
|
233
|
+
ContentSchema.index({ action: 1, profile: 1, type: 1 });
|
|
234
|
+
ContentSchema.index({ action: 1, profile: 1, socialnetwork: 1 });
|
|
235
|
+
ContentSchema.index({ action: 1, status: 1, postedAt: 1 });
|
|
236
|
+
ContentSchema.index({ profile: 1 });
|
|
237
|
+
ContentSchema.index({ createdAt: -1, status: 1 });
|
|
238
|
+
|
|
231
239
|
export const ContentModel = MongooseModel('Content', ContentSchema);
|
|
@@ -165,4 +165,11 @@ export class Invoice {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
export const InvoiceSchema = SchemaFactory.createForClass(Invoice);
|
|
168
|
+
|
|
169
|
+
InvoiceSchema.index({ organization: 1, phase: 1 });
|
|
170
|
+
InvoiceSchema.index({ organization: 1, 'invoiced.issueDate': 1 });
|
|
171
|
+
InvoiceSchema.index({ sale: 1, installmentNumber: 1 });
|
|
172
|
+
InvoiceSchema.index({ sale: 1, phase: 1 });
|
|
173
|
+
InvoiceSchema.index({ tags: 1 });
|
|
174
|
+
|
|
168
175
|
export const InvoiceModel = MongooseModel('Invoice', InvoiceSchema);
|
|
@@ -56,4 +56,8 @@ export class Log {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export const LogSchema = SchemaFactory.createForClass(Log);
|
|
59
|
+
|
|
60
|
+
LogSchema.index({ referenceId: 1, reference: 1 });
|
|
61
|
+
LogSchema.index({ reference: 1, updatedAt: -1 });
|
|
62
|
+
|
|
59
63
|
export const LogModel = MongooseModel('Log', LogSchema);
|
|
@@ -267,4 +267,16 @@ export class Payment {
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
export const PaymentSchema = SchemaFactory.createForClass(Payment);
|
|
270
|
+
|
|
271
|
+
PaymentSchema.index({ 'pending.sale': 1 });
|
|
272
|
+
PaymentSchema.index({ 'pending.influencer': 1 });
|
|
273
|
+
PaymentSchema.index({ 'pending.recruitment': 1 });
|
|
274
|
+
PaymentSchema.index({ 'pending.action': 1 });
|
|
275
|
+
PaymentSchema.index({ 'pending.supplier': 1 });
|
|
276
|
+
PaymentSchema.index({ 'pending.recruitment': 1, 'pending.type': 1 });
|
|
277
|
+
PaymentSchema.index({ 'pending.influencer': 1, 'pending.recruitment': 1, 'pending.action': 1, 'pending.type': 1 });
|
|
278
|
+
PaymentSchema.index({ organization: 1, phase: 1 });
|
|
279
|
+
PaymentSchema.index({ organization: 1, 'queued.issueDate': 1 });
|
|
280
|
+
PaymentSchema.index({ omieId: 1 }, { sparse: true });
|
|
281
|
+
|
|
270
282
|
export const PaymentModel = MongooseModel('Payment', PaymentSchema);
|
|
@@ -35,5 +35,10 @@ export class Profile {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export const ProfileSchema = SchemaFactory.createForClass(Profile);
|
|
38
|
+
|
|
39
|
+
ProfileSchema.index({ influencer: 1 });
|
|
40
|
+
ProfileSchema.index({ username: 1 });
|
|
41
|
+
ProfileSchema.index({ username: 1, influencer: 1 });
|
|
42
|
+
|
|
38
43
|
export const ProfileModel = MongooseModel('Profile', ProfileSchema);
|
|
39
44
|
|
|
@@ -217,5 +217,12 @@ export class Recruitment {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
export const RecruitmentSchema = SchemaFactory.createForClass(Recruitment);
|
|
220
|
+
|
|
221
|
+
RecruitmentSchema.index({ action: 1, status: 1 });
|
|
222
|
+
RecruitmentSchema.index({ action: 1 });
|
|
223
|
+
RecruitmentSchema.index({ profile: 1, status: 1 });
|
|
224
|
+
RecruitmentSchema.index({ profile: 1, status: 1, 'scope.exclusivity': 1 });
|
|
225
|
+
RecruitmentSchema.index({ username: 1, _id: 1 });
|
|
226
|
+
|
|
220
227
|
export const RecruitmentModel = MongooseModel('Recruitment', RecruitmentSchema);
|
|
221
228
|
|
|
@@ -269,4 +269,14 @@ export class Sale {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
export const SaleSchema = SchemaFactory.createForClass(Sale);
|
|
272
|
+
|
|
273
|
+
SaleSchema.index({ organization: 1, phase: 1 });
|
|
274
|
+
SaleSchema.index({ organization: 1, createdAt: -1 });
|
|
275
|
+
SaleSchema.index({ organization: 1, 'formalization.brand': 1 });
|
|
276
|
+
SaleSchema.index({ organization: 1, 'formalization.agency': 1 });
|
|
277
|
+
SaleSchema.index({ organization: 1, closedAt: 1, phase: 1 });
|
|
278
|
+
SaleSchema.index({ 'proposal.influencer': 1 });
|
|
279
|
+
SaleSchema.index({ 'proposal.responsable.email': 1 });
|
|
280
|
+
SaleSchema.index({ tags: 1 });
|
|
281
|
+
|
|
272
282
|
export const SaleModel = MongooseModel('Sale', SaleSchema);
|
|
@@ -64,4 +64,9 @@ export class Schedule {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export const ScheduleSchema = SchemaFactory.createForClass(Schedule);
|
|
67
|
+
|
|
68
|
+
ScheduleSchema.index({ actionId: 1, scheduledAt: 1 });
|
|
69
|
+
ScheduleSchema.index({ clientId: 1 });
|
|
70
|
+
ScheduleSchema.index({ recruitmentId: 1 });
|
|
71
|
+
|
|
67
72
|
export const ScheduleModel = MongooseModel('Schedule', ScheduleSchema);
|
|
@@ -34,5 +34,9 @@ export class Token {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export const TokenSchema = SchemaFactory.createForClass(Token);
|
|
37
|
+
|
|
38
|
+
TokenSchema.index({ profileId: 1, provider: 1 });
|
|
39
|
+
TokenSchema.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
|
|
40
|
+
|
|
37
41
|
export const TokenModel = MongooseModel('Token', TokenSchema);
|
|
38
42
|
|
|
@@ -120,5 +120,11 @@ export class User {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
export const UserSchema = SchemaFactory.createForClass(User);
|
|
123
|
+
|
|
124
|
+
UserSchema.index({ name: 1 });
|
|
125
|
+
UserSchema.index({ 'company.document': 1 });
|
|
126
|
+
UserSchema.index({ 'company.legalName': 1 });
|
|
127
|
+
UserSchema.index({ createdAt: -1 });
|
|
128
|
+
|
|
123
129
|
export const UserModel = MongooseModel('User', UserSchema);
|
|
124
130
|
|