@grapadigital/shared-schemas 1.0.242 → 1.1.1

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 (150) hide show
  1. package/dist/index.d.ts +42 -42
  2. package/dist/schemas/action.schema.d.ts +9 -34
  3. package/dist/schemas/action.schema.js +81 -64
  4. package/dist/schemas/assignment.schema.d.ts +3 -28
  5. package/dist/schemas/assignment.schema.js +44 -44
  6. package/dist/schemas/attachment.schema.d.ts +13 -0
  7. package/dist/schemas/attachment.schema.js +28 -0
  8. package/dist/schemas/benchmark.schema.d.ts +3 -28
  9. package/dist/schemas/benchmark.schema.js +11 -6
  10. package/dist/schemas/campaign.schema.d.ts +2 -27
  11. package/dist/schemas/campaign.schema.js +4 -4
  12. package/dist/schemas/client.schema.d.ts +18 -79
  13. package/dist/schemas/client.schema.js +73 -71
  14. package/dist/schemas/comment.schema.d.ts +5 -30
  15. package/dist/schemas/comment.schema.js +42 -37
  16. package/dist/schemas/commission.schema.d.ts +5 -30
  17. package/dist/schemas/commission.schema.js +10 -10
  18. package/dist/schemas/content-capture-process.schema.d.ts +6 -31
  19. package/dist/schemas/content-capture-process.schema.js +24 -17
  20. package/dist/schemas/content-draft.schema.d.ts +2 -27
  21. package/dist/schemas/content-draft.schema.js +5 -5
  22. package/dist/schemas/content.schema.d.ts +6 -31
  23. package/dist/schemas/content.schema.js +84 -74
  24. package/dist/schemas/contract.schema.d.ts +3 -28
  25. package/dist/schemas/contract.schema.js +5 -5
  26. package/dist/schemas/creative.schema.d.ts +6 -31
  27. package/dist/schemas/creative.schema.js +22 -31
  28. package/dist/schemas/export-comments-job.schema.d.ts +2 -27
  29. package/dist/schemas/export-comments-job.schema.js +6 -6
  30. package/dist/schemas/group.schema.d.ts +1 -26
  31. package/dist/schemas/group.schema.js +5 -5
  32. package/dist/schemas/influencer.schema.d.ts +6 -31
  33. package/dist/schemas/influencer.schema.js +16 -18
  34. package/dist/schemas/invoice.schema.d.ts +4 -29
  35. package/dist/schemas/invoice.schema.js +42 -32
  36. package/dist/schemas/job.schema.d.ts +2 -27
  37. package/dist/schemas/job.schema.js +14 -14
  38. package/dist/schemas/lead.schema.d.ts +1 -26
  39. package/dist/schemas/lead.schema.js +67 -64
  40. package/dist/schemas/log.schema.d.ts +1 -26
  41. package/dist/schemas/log.schema.js +24 -24
  42. package/dist/schemas/note.schema.d.ts +1 -26
  43. package/dist/schemas/note.schema.js +9 -9
  44. package/dist/schemas/notifications.schema.d.ts +1 -26
  45. package/dist/schemas/notifications.schema.js +8 -8
  46. package/dist/schemas/organization.schema.d.ts +2 -26
  47. package/dist/schemas/organization.schema.js +8 -4
  48. package/dist/schemas/party.schema.d.ts +1 -26
  49. package/dist/schemas/party.schema.js +11 -11
  50. package/dist/schemas/payment.schema.d.ts +12 -49
  51. package/dist/schemas/payment.schema.js +66 -69
  52. package/dist/schemas/profile.schema.d.ts +3 -28
  53. package/dist/schemas/profile.schema.js +6 -6
  54. package/dist/schemas/project.schema.d.ts +4 -29
  55. package/dist/schemas/project.schema.js +13 -13
  56. package/dist/schemas/prospect.schema.d.ts +3 -28
  57. package/dist/schemas/prospect.schema.js +9 -9
  58. package/dist/schemas/recruitment.schema.d.ts +5 -30
  59. package/dist/schemas/recruitment.schema.js +36 -36
  60. package/dist/schemas/responsible.schema.d.ts +0 -26
  61. package/dist/schemas/responsible.schema.js +6 -6
  62. package/dist/schemas/sale.schema.d.ts +31 -46
  63. package/dist/schemas/sale.schema.js +66 -62
  64. package/dist/schemas/script.schema.d.ts +6 -31
  65. package/dist/schemas/script.schema.js +21 -30
  66. package/dist/schemas/snapshot.schema.d.ts +3 -28
  67. package/dist/schemas/snapshot.schema.js +6 -6
  68. package/dist/schemas/store-visit.schema.d.ts +2 -27
  69. package/dist/schemas/store-visit.schema.js +21 -17
  70. package/dist/schemas/store.schema.d.ts +3 -28
  71. package/dist/schemas/store.schema.js +8 -8
  72. package/dist/schemas/supplier.schema.d.ts +2 -27
  73. package/dist/schemas/supplier.schema.js +3 -3
  74. package/dist/schemas/tag.schema.d.ts +1 -26
  75. package/dist/schemas/tag.schema.js +5 -5
  76. package/dist/schemas/task.schema.d.ts +9 -34
  77. package/dist/schemas/task.schema.js +67 -67
  78. package/dist/schemas/token.schema.d.ts +1 -26
  79. package/dist/schemas/token.schema.js +3 -3
  80. package/dist/schemas/trigger.schema.d.ts +2 -27
  81. package/dist/schemas/trigger.schema.js +5 -5
  82. package/dist/schemas/user.schema.d.ts +2 -27
  83. package/dist/schemas/user.schema.js +7 -7
  84. package/dist/schemas/webhook.schema.d.ts +1 -26
  85. package/dist/schemas/webhook.schema.js +10 -10
  86. package/dist/utils/merge-metrics-breakdown.util.d.ts +1 -1
  87. package/dist/utils/merge-metrics-breakdown.util.js +7 -2
  88. package/dist/utils/normalize-content-link.util.js +7 -7
  89. package/package.json +22 -10
  90. package/.eslintrc.json +0 -28
  91. package/.prettierrc +0 -4
  92. package/dist/schemas/profile-followers-snapshot.schema.d.ts +0 -67
  93. package/dist/schemas/profile-followers-snapshot.schema.js +0 -65
  94. package/dist/schemas/schedule.schema.d.ts +0 -73
  95. package/dist/schemas/schedule.schema.js +0 -116
  96. package/dist/utils/cost-per-impact.util.d.ts +0 -37
  97. package/dist/utils/cost-per-impact.util.js +0 -72
  98. package/dist/utils/influencer-contract.util.d.ts +0 -32
  99. package/dist/utils/influencer-contract.util.js +0 -77
  100. package/docs/code-review.md +0 -27
  101. package/docs/constitution.md +0 -75
  102. package/docs/specs/GD-692.md +0 -112
  103. package/docs/specs/GD-761.md +0 -94
  104. package/index.d.ts +0 -3
  105. package/src/index.ts +0 -42
  106. package/src/schemas/action.schema.ts +0 -328
  107. package/src/schemas/assignment.schema.ts +0 -154
  108. package/src/schemas/benchmark.schema.ts +0 -39
  109. package/src/schemas/campaign.schema.ts +0 -38
  110. package/src/schemas/client.schema.ts +0 -319
  111. package/src/schemas/comment.schema.ts +0 -216
  112. package/src/schemas/commission.schema.ts +0 -108
  113. package/src/schemas/content-capture-process.schema.ts +0 -195
  114. package/src/schemas/content-draft.schema.ts +0 -49
  115. package/src/schemas/content.schema.ts +0 -688
  116. package/src/schemas/contract.schema.ts +0 -44
  117. package/src/schemas/creative.schema.ts +0 -256
  118. package/src/schemas/export-comments-job.schema.ts +0 -59
  119. package/src/schemas/group.schema.ts +0 -23
  120. package/src/schemas/influencer.schema.ts +0 -184
  121. package/src/schemas/invoice.schema.ts +0 -164
  122. package/src/schemas/job.schema.ts +0 -111
  123. package/src/schemas/lead.schema.ts +0 -372
  124. package/src/schemas/log.schema.ts +0 -91
  125. package/src/schemas/note.schema.ts +0 -34
  126. package/src/schemas/notifications.schema.ts +0 -61
  127. package/src/schemas/organization.schema.ts +0 -29
  128. package/src/schemas/party.schema.ts +0 -65
  129. package/src/schemas/payment.schema.ts +0 -275
  130. package/src/schemas/profile.schema.ts +0 -77
  131. package/src/schemas/project.schema.ts +0 -116
  132. package/src/schemas/prospect.schema.ts +0 -62
  133. package/src/schemas/recruitment.schema.ts +0 -277
  134. package/src/schemas/responsible.schema.ts +0 -27
  135. package/src/schemas/sale.schema.ts +0 -297
  136. package/src/schemas/script.schema.ts +0 -235
  137. package/src/schemas/snapshot.schema.ts +0 -55
  138. package/src/schemas/store-visit.schema.ts +0 -68
  139. package/src/schemas/store.schema.ts +0 -52
  140. package/src/schemas/supplier.schema.ts +0 -12
  141. package/src/schemas/tag.schema.ts +0 -26
  142. package/src/schemas/task.schema.ts +0 -205
  143. package/src/schemas/token.schema.ts +0 -42
  144. package/src/schemas/trigger.schema.ts +0 -48
  145. package/src/schemas/user.schema.ts +0 -59
  146. package/src/schemas/webhook.schema.ts +0 -81
  147. package/src/utils/merge-metrics-breakdown.util.ts +0 -51
  148. package/src/utils/normalize-content-link.util.ts +0 -31
  149. package/tsconfig.build.json +0 -5
  150. package/tsconfig.json +0 -29
@@ -1,32 +1,7 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/session" />
19
- /// <reference types="mongoose/types/types" />
20
- /// <reference types="mongoose/types/utility" />
21
- /// <reference types="mongoose/types/validation" />
22
- /// <reference types="mongoose/types/virtuals" />
23
- /// <reference types="mongoose/types/schematypes" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
- /// <reference types="mongoose/types/inferrawdoctype" />
26
- import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
27
- import { Action } from './action.schema';
28
- import type { Influencer } from './influencer.schema';
29
- import { Profile } from './profile.schema';
1
+ import { HydratedDocument, Schema as MongooseSchema, Types } from "mongoose";
2
+ import { Action } from "./action.schema";
3
+ import type { Influencer } from "./influencer.schema";
4
+ import { Profile } from "./profile.schema";
30
5
  export type RecruitmentDocument = HydratedDocument<Recruitment>;
31
6
  export declare class Delivery {
32
7
  reels?: number;
@@ -224,7 +199,7 @@ export declare class Recruitment {
224
199
  _id?: Types.ObjectId;
225
200
  username: string;
226
201
  picture: string;
227
- status: 'selected' | 'inContact' | 'inApproval' | 'recruited' | 'removed';
202
+ status: "selected" | "inContact" | "inApproval" | "recruited" | "removed";
228
203
  action: Types.ObjectId | Action;
229
204
  influencer: Types.ObjectId | Influencer;
230
205
  profiles: RecruitmentProfile[];
@@ -14,6 +14,7 @@ const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
15
  let Delivery = class Delivery {
16
16
  };
17
+ exports.Delivery = Delivery;
17
18
  __decorate([
18
19
  (0, mongoose_1.Prop)({ required: false }),
19
20
  __metadata("design:type", Number)
@@ -50,13 +51,13 @@ __decorate([
50
51
  (0, mongoose_1.Prop)({ required: false }),
51
52
  __metadata("design:type", Number)
52
53
  ], Delivery.prototype, "dayAllocation", void 0);
53
- Delivery = __decorate([
54
+ exports.Delivery = Delivery = __decorate([
54
55
  (0, mongoose_1.Schema)({ _id: false })
55
56
  ], Delivery);
56
- exports.Delivery = Delivery;
57
57
  exports.DeliverySchema = mongoose_1.SchemaFactory.createForClass(Delivery);
58
58
  let Right = class Right {
59
59
  };
60
+ exports.Right = Right;
60
61
  __decorate([
61
62
  (0, mongoose_1.Prop)(),
62
63
  __metadata("design:type", Boolean)
@@ -65,13 +66,13 @@ __decorate([
65
66
  (0, mongoose_1.Prop)(),
66
67
  __metadata("design:type", String)
67
68
  ], Right.prototype, "period", void 0);
68
- Right = __decorate([
69
+ exports.Right = Right = __decorate([
69
70
  (0, mongoose_1.Schema)({ _id: false })
70
71
  ], Right);
71
- exports.Right = Right;
72
72
  exports.RightSchema = mongoose_1.SchemaFactory.createForClass(Right);
73
73
  let Rights = class Rights {
74
74
  };
75
+ exports.Rights = Rights;
75
76
  __decorate([
76
77
  (0, mongoose_1.Prop)({ type: exports.RightSchema }),
77
78
  __metadata("design:type", Right)
@@ -84,13 +85,13 @@ __decorate([
84
85
  (0, mongoose_1.Prop)({ type: exports.RightSchema }),
85
86
  __metadata("design:type", Right)
86
87
  ], Rights.prototype, "imageUsage", void 0);
87
- Rights = __decorate([
88
+ exports.Rights = Rights = __decorate([
88
89
  (0, mongoose_1.Schema)({ _id: false })
89
90
  ], Rights);
90
- exports.Rights = Rights;
91
91
  exports.RightsSchema = mongoose_1.SchemaFactory.createForClass(Rights);
92
92
  let InstallmentInfo = class InstallmentInfo {
93
93
  };
94
+ exports.InstallmentInfo = InstallmentInfo;
94
95
  __decorate([
95
96
  (0, mongoose_1.Prop)(),
96
97
  __metadata("design:type", Number)
@@ -99,10 +100,9 @@ __decorate([
99
100
  (0, mongoose_1.Prop)(),
100
101
  __metadata("design:type", Number)
101
102
  ], InstallmentInfo.prototype, "value", void 0);
102
- InstallmentInfo = __decorate([
103
+ exports.InstallmentInfo = InstallmentInfo = __decorate([
103
104
  (0, mongoose_1.Schema)({ _id: false })
104
105
  ], InstallmentInfo);
105
- exports.InstallmentInfo = InstallmentInfo;
106
106
  exports.InstallmentInfoSchema = mongoose_1.SchemaFactory.createForClass(InstallmentInfo);
107
107
  let Payment = class Payment {
108
108
  };
@@ -132,6 +132,7 @@ Payment = __decorate([
132
132
  const PaymentSchema = mongoose_1.SchemaFactory.createForClass(Payment);
133
133
  let Exchange = class Exchange {
134
134
  };
135
+ exports.Exchange = Exchange;
135
136
  __decorate([
136
137
  (0, mongoose_1.Prop)(),
137
138
  __metadata("design:type", Boolean)
@@ -140,13 +141,13 @@ __decorate([
140
141
  (0, mongoose_1.Prop)(),
141
142
  __metadata("design:type", String)
142
143
  ], Exchange.prototype, "description", void 0);
143
- Exchange = __decorate([
144
+ exports.Exchange = Exchange = __decorate([
144
145
  (0, mongoose_1.Schema)({ _id: false })
145
146
  ], Exchange);
146
- exports.Exchange = Exchange;
147
147
  exports.ExchangeSchema = mongoose_1.SchemaFactory.createForClass(Exchange);
148
148
  let Collab = class Collab {
149
149
  };
150
+ exports.Collab = Collab;
150
151
  __decorate([
151
152
  (0, mongoose_1.Prop)(),
152
153
  __metadata("design:type", Boolean)
@@ -155,24 +156,24 @@ __decorate([
155
156
  (0, mongoose_1.Prop)(),
156
157
  __metadata("design:type", String)
157
158
  ], Collab.prototype, "description", void 0);
158
- Collab = __decorate([
159
+ exports.Collab = Collab = __decorate([
159
160
  (0, mongoose_1.Schema)({ _id: false })
160
161
  ], Collab);
161
- exports.Collab = Collab;
162
162
  exports.CollabSchema = mongoose_1.SchemaFactory.createForClass(Collab);
163
163
  let OptIn = class OptIn {
164
164
  };
165
+ exports.OptIn = OptIn;
165
166
  __decorate([
166
167
  (0, mongoose_1.Prop)(),
167
168
  __metadata("design:type", Boolean)
168
169
  ], OptIn.prototype, "hasOptIn", void 0);
169
- OptIn = __decorate([
170
+ exports.OptIn = OptIn = __decorate([
170
171
  (0, mongoose_1.Schema)({ _id: false })
171
172
  ], OptIn);
172
- exports.OptIn = OptIn;
173
173
  exports.OptInSchema = mongoose_1.SchemaFactory.createForClass(OptIn);
174
174
  let ScopeEstimateMetrics = class ScopeEstimateMetrics {
175
175
  };
176
+ exports.ScopeEstimateMetrics = ScopeEstimateMetrics;
176
177
  __decorate([
177
178
  (0, mongoose_1.Prop)(),
178
179
  __metadata("design:type", Number)
@@ -189,13 +190,13 @@ __decorate([
189
190
  (0, mongoose_1.Prop)(),
190
191
  __metadata("design:type", Number)
191
192
  ], ScopeEstimateMetrics.prototype, "engagementRate", void 0);
192
- ScopeEstimateMetrics = __decorate([
193
+ exports.ScopeEstimateMetrics = ScopeEstimateMetrics = __decorate([
193
194
  (0, mongoose_1.Schema)({ _id: false })
194
195
  ], ScopeEstimateMetrics);
195
- exports.ScopeEstimateMetrics = ScopeEstimateMetrics;
196
196
  exports.ScopeEstimateMetricsSchema = mongoose_1.SchemaFactory.createForClass(ScopeEstimateMetrics);
197
197
  let ScopeEstimateBreakdown = class ScopeEstimateBreakdown {
198
198
  };
199
+ exports.ScopeEstimateBreakdown = ScopeEstimateBreakdown;
199
200
  __decorate([
200
201
  (0, mongoose_1.Prop)(),
201
202
  __metadata("design:type", String)
@@ -216,13 +217,13 @@ __decorate([
216
217
  (0, mongoose_1.Prop)({ type: exports.ScopeEstimateMetricsSchema }),
217
218
  __metadata("design:type", ScopeEstimateMetrics)
218
219
  ], ScopeEstimateBreakdown.prototype, "estimates", void 0);
219
- ScopeEstimateBreakdown = __decorate([
220
+ exports.ScopeEstimateBreakdown = ScopeEstimateBreakdown = __decorate([
220
221
  (0, mongoose_1.Schema)({ _id: false })
221
222
  ], ScopeEstimateBreakdown);
222
- exports.ScopeEstimateBreakdown = ScopeEstimateBreakdown;
223
223
  exports.ScopeEstimateBreakdownSchema = mongoose_1.SchemaFactory.createForClass(ScopeEstimateBreakdown);
224
224
  let ScopeEstimates = class ScopeEstimates {
225
225
  };
226
+ exports.ScopeEstimates = ScopeEstimates;
226
227
  __decorate([
227
228
  (0, mongoose_1.Prop)(),
228
229
  __metadata("design:type", Number)
@@ -247,13 +248,13 @@ __decorate([
247
248
  (0, mongoose_1.Prop)({ type: [exports.ScopeEstimateBreakdownSchema] }),
248
249
  __metadata("design:type", Array)
249
250
  ], ScopeEstimates.prototype, "breakdown", void 0);
250
- ScopeEstimates = __decorate([
251
+ exports.ScopeEstimates = ScopeEstimates = __decorate([
251
252
  (0, mongoose_1.Schema)({ _id: false })
252
253
  ], ScopeEstimates);
253
- exports.ScopeEstimates = ScopeEstimates;
254
254
  exports.ScopeEstimatesSchema = mongoose_1.SchemaFactory.createForClass(ScopeEstimates);
255
255
  let Scope = class Scope {
256
256
  };
257
+ exports.Scope = Scope;
257
258
  __decorate([
258
259
  (0, mongoose_1.Prop)({ type: exports.DeliverySchema }),
259
260
  __metadata("design:type", Delivery)
@@ -294,33 +295,33 @@ __decorate([
294
295
  (0, mongoose_1.Prop)({ type: exports.ScopeEstimatesSchema, required: false }),
295
296
  __metadata("design:type", ScopeEstimates)
296
297
  ], Scope.prototype, "estimates", void 0);
297
- Scope = __decorate([
298
+ exports.Scope = Scope = __decorate([
298
299
  (0, mongoose_1.Schema)({ _id: false })
299
300
  ], Scope);
300
- exports.Scope = Scope;
301
301
  exports.ScopeSchema = mongoose_1.SchemaFactory.createForClass(Scope);
302
302
  // Perfil participante do recrutamento — cada um tem a sua collaboration na
303
303
  // Primetag (primetagId = collaboration_id), criada quando o recrutamento vira
304
304
  // 'recruited'.
305
305
  let RecruitmentProfile = class RecruitmentProfile {
306
306
  };
307
+ exports.RecruitmentProfile = RecruitmentProfile;
307
308
  __decorate([
308
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: true }),
309
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Profile", required: true }),
309
310
  __metadata("design:type", Object)
310
311
  ], RecruitmentProfile.prototype, "profile", void 0);
311
312
  __decorate([
312
313
  (0, mongoose_1.Prop)({ type: String, required: false }),
313
314
  __metadata("design:type", String)
314
315
  ], RecruitmentProfile.prototype, "primetagId", void 0);
315
- RecruitmentProfile = __decorate([
316
+ exports.RecruitmentProfile = RecruitmentProfile = __decorate([
316
317
  (0, mongoose_1.Schema)({ _id: false })
317
318
  ], RecruitmentProfile);
318
- exports.RecruitmentProfile = RecruitmentProfile;
319
319
  exports.RecruitmentProfileSchema = mongoose_1.SchemaFactory.createForClass(RecruitmentProfile);
320
320
  // 1 por (action, influencer): o scope (entregas + pagamento) é do influenciador
321
321
  // na campanha inteira, dividido entre todos os perfis de `profiles`.
322
322
  let Recruitment = class Recruitment {
323
323
  };
324
+ exports.Recruitment = Recruitment;
324
325
  __decorate([
325
326
  (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
326
327
  __metadata("design:type", mongoose_2.Types.ObjectId)
@@ -336,17 +337,17 @@ __decorate([
336
337
  __decorate([
337
338
  (0, mongoose_1.Prop)({
338
339
  type: String,
339
- default: 'selected',
340
- enum: ['selected', 'inContact', 'inApproval', 'recruited', 'removed'],
340
+ default: "selected",
341
+ enum: ["selected", "inContact", "inApproval", "recruited", "removed"],
341
342
  }),
342
343
  __metadata("design:type", String)
343
344
  ], Recruitment.prototype, "status", void 0);
344
345
  __decorate([
345
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Action' }),
346
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Action" }),
346
347
  __metadata("design:type", Object)
347
348
  ], Recruitment.prototype, "action", void 0);
348
349
  __decorate([
349
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Influencer', required: true }),
350
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Influencer", required: true }),
350
351
  __metadata("design:type", Object)
351
352
  ], Recruitment.prototype, "influencer", void 0);
352
353
  __decorate([
@@ -369,18 +370,17 @@ __decorate([
369
370
  (0, mongoose_1.Prop)({ type: Boolean, required: false, default: false }),
370
371
  __metadata("design:type", Boolean)
371
372
  ], Recruitment.prototype, "useAmbassadorContract", void 0);
372
- Recruitment = __decorate([
373
+ exports.Recruitment = Recruitment = __decorate([
373
374
  (0, mongoose_1.Schema)({ timestamps: true })
374
375
  ], Recruitment);
375
- exports.Recruitment = Recruitment;
376
376
  exports.RecruitmentSchema = mongoose_1.SchemaFactory.createForClass(Recruitment);
377
377
  exports.RecruitmentSchema.index({ action: 1, status: 1 });
378
378
  exports.RecruitmentSchema.index({ action: 1 });
379
379
  // Parcial: recrutamentos legados cujo perfil não tem influenciador ficaram no
380
380
  // formato antigo (sem `influencer`) e não entram na unicidade.
381
- exports.RecruitmentSchema.index({ action: 1, influencer: 1 }, { unique: true, partialFilterExpression: { influencer: { $type: 'objectId' } } });
382
- exports.RecruitmentSchema.index({ 'profiles.profile': 1, status: 1 });
383
- exports.RecruitmentSchema.index({ influencer: 1, status: 1, 'scope.exclusivity': 1 });
384
- exports.RecruitmentSchema.index({ action: 1, 'profiles.primetagId': 1 });
381
+ exports.RecruitmentSchema.index({ action: 1, influencer: 1 }, { unique: true, partialFilterExpression: { influencer: { $type: "objectId" } } });
382
+ exports.RecruitmentSchema.index({ "profiles.profile": 1, status: 1 });
383
+ exports.RecruitmentSchema.index({ influencer: 1, status: 1, "scope.exclusivity": 1 });
384
+ exports.RecruitmentSchema.index({ action: 1, "profiles.primetagId": 1 });
385
385
  exports.RecruitmentSchema.index({ username: 1, _id: 1 });
386
- exports.RecruitmentModel = (0, mongoose_2.model)('Recruitment', exports.RecruitmentSchema);
386
+ exports.RecruitmentModel = (0, mongoose_2.model)("Recruitment", exports.RecruitmentSchema);
@@ -1,29 +1,3 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/session" />
19
- /// <reference types="mongoose/types/types" />
20
- /// <reference types="mongoose/types/utility" />
21
- /// <reference types="mongoose/types/validation" />
22
- /// <reference types="mongoose/types/virtuals" />
23
- /// <reference types="mongoose" />
24
- /// <reference types="mongoose/types/schematypes" />
25
- /// <reference types="mongoose/types/inferschematype" />
26
- /// <reference types="mongoose/types/inferrawdoctype" />
27
1
  /**
28
2
  * Formato único de responsável em todas as entidades (`responsible`).
29
3
  * `username` vem de `User.username` (api-admin).
@@ -18,28 +18,28 @@ const swagger_1 = require("@nestjs/swagger");
18
18
  */
19
19
  let Responsible = class Responsible {
20
20
  };
21
+ exports.Responsible = Responsible;
21
22
  __decorate([
22
- (0, swagger_1.ApiProperty)({ example: 'Maria Oliveira' }),
23
+ (0, swagger_1.ApiProperty)({ example: "Maria Oliveira" }),
23
24
  (0, mongoose_1.Prop)({ type: String, required: true }),
24
25
  __metadata("design:type", String)
25
26
  ], Responsible.prototype, "name", void 0);
26
27
  __decorate([
27
- (0, swagger_1.ApiProperty)({ example: 'maria@empresa.com' }),
28
+ (0, swagger_1.ApiProperty)({ example: "maria@empresa.com" }),
28
29
  (0, mongoose_1.Prop)({ type: String, required: true }),
29
30
  __metadata("design:type", String)
30
31
  ], Responsible.prototype, "email", void 0);
31
32
  __decorate([
32
- (0, swagger_1.ApiProperty)({ example: 'maria.oliveira' }),
33
+ (0, swagger_1.ApiProperty)({ example: "maria.oliveira" }),
33
34
  (0, mongoose_1.Prop)({ type: String, required: true }),
34
35
  __metadata("design:type", String)
35
36
  ], Responsible.prototype, "username", void 0);
36
37
  __decorate([
37
- (0, swagger_1.ApiProperty)({ example: 'service', required: false }),
38
+ (0, swagger_1.ApiProperty)({ example: "service", required: false }),
38
39
  (0, mongoose_1.Prop)({ type: String, required: false }),
39
40
  __metadata("design:type", String)
40
41
  ], Responsible.prototype, "team", void 0);
41
- Responsible = __decorate([
42
+ exports.Responsible = Responsible = __decorate([
42
43
  (0, mongoose_1.Schema)({ _id: false })
43
44
  ], Responsible);
44
- exports.Responsible = Responsible;
45
45
  exports.ResponsibleSchema = mongoose_1.SchemaFactory.createForClass(Responsible);
@@ -1,52 +1,28 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/session" />
19
- /// <reference types="mongoose/types/types" />
20
- /// <reference types="mongoose/types/utility" />
21
- /// <reference types="mongoose/types/validation" />
22
- /// <reference types="mongoose/types/virtuals" />
23
- /// <reference types="mongoose/types/schematypes" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
- /// <reference types="mongoose/types/inferrawdoctype" />
26
- import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
27
- import { Profile } from './profile.schema';
28
- import { Client } from './client.schema';
29
- import { Influencer } from './influencer.schema';
30
- import { Note } from './note.schema';
31
- import { Responsible } from './responsible.schema';
1
+ import { HydratedDocument, Schema as MongooseSchema, Types } from "mongoose";
2
+ import { Profile } from "./profile.schema";
3
+ import { Client } from "./client.schema";
4
+ import { Influencer } from "./influencer.schema";
5
+ import { Note } from "./note.schema";
6
+ import { Responsible } from "./responsible.schema";
7
+ import { Attachment } from "./attachment.schema";
32
8
  export type SaleDocument = HydratedDocument<Sale>;
33
9
  export declare class Proposal {
34
- businessUnit: 'service' | 'comercial';
10
+ businessUnit: "service" | "comercial";
35
11
  contact: string;
36
12
  initialScope: string;
37
- origin: 'inbound' | 'outbound';
13
+ origin: "inbound" | "outbound";
38
14
  profile?: Types.ObjectId | Profile;
39
15
  influencer?: Types.ObjectId | Influencer;
40
16
  }
41
17
  export declare class Negotiation {
42
- calculatorType: 'withPreDefinedBudget' | 'withoutPreDefinedBudget' | 'byCommission' | 'bourbon';
18
+ calculatorType: "withPreDefinedBudget" | "withoutPreDefinedBudget" | "byCommission" | "bourbon";
43
19
  childPermit?: boolean;
44
20
  childPermitValue?: number;
45
- childPermitMethod?: 'direct' | 'debit_note' | 'client';
21
+ childPermitMethod?: "direct" | "debit_note" | "client";
46
22
  influencerBroadcastValue: number;
47
- influencerBroadcastMethod: 'transfer' | 'direct' | 'debit_note' | 'client';
23
+ influencerBroadcastMethod: "transfer" | "direct" | "debit_note" | "client";
48
24
  productionAndOthersValue: number;
49
- productionAndOthersMethod: 'direct' | 'debit_note' | 'client';
25
+ productionAndOthersMethod: "direct" | "debit_note" | "client";
50
26
  commissionRate: number;
51
27
  broadcastBonusRate: number;
52
28
  taxRate: number;
@@ -76,11 +52,11 @@ export declare class Formalization {
76
52
  totalInstallments: number;
77
53
  }
78
54
  export declare class Lost {
79
- reason: 'declined' | 'other' | 'spam' | 'no_response' | 'no_budget' | 'no_profile_fit' | 'invite_exchange';
55
+ reason: "declined" | "other" | "spam" | "no_response" | "no_budget" | "no_profile_fit" | "invite_exchange";
80
56
  details?: string;
81
57
  }
82
58
  export declare class Activity {
83
- type: 'email' | 'whatsapp' | 'meeting' | 'call' | 'linkedin' | 'instagram_dm';
59
+ type: "email" | "whatsapp" | "meeting" | "call" | "linkedin" | "instagram_dm";
84
60
  description?: string;
85
61
  owner: string;
86
62
  createdAt: Date;
@@ -130,16 +106,24 @@ export declare const SaleResponsibleSchema: MongooseSchema<SaleResponsible, impo
130
106
  } & {
131
107
  __v: number;
132
108
  }>;
133
- export declare class SaleLinks {
134
- contract?: string;
135
- clientSheet?: string;
136
- internalSheet?: string;
109
+ export declare class SaleLink {
110
+ label: string;
111
+ url: string;
137
112
  }
113
+ export declare const SaleLinkSchema: MongooseSchema<SaleLink, import("mongoose").Model<SaleLink, any, any, any, import("mongoose").Document<unknown, any, SaleLink, any, {}> & SaleLink & {
114
+ _id: Types.ObjectId;
115
+ } & {
116
+ __v: number;
117
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, SaleLink, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<SaleLink>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<SaleLink> & {
118
+ _id: Types.ObjectId;
119
+ } & {
120
+ __v: number;
121
+ }>;
138
122
  export declare class Sale {
139
123
  _id?: Types.ObjectId;
140
124
  title: string;
141
- phase: 'inbox' | 'proposal' | 'negotiation' | 'commission' | 'formalization' | 'closed' | 'lost';
142
- type: 'new' | 'organic_expansion' | 'strategic_expansion' | 'renewal' | 'comercial_winback' | 'organic_winback';
125
+ phase: "inbox" | "strategy" | "proposal" | "negotiation" | "commission" | "formalization" | "closed" | "lost";
126
+ type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
143
127
  proposal?: Proposal;
144
128
  negotiation?: Negotiation;
145
129
  formalization?: Formalization;
@@ -157,7 +141,8 @@ export declare class Sale {
157
141
  updatedAt?: Date;
158
142
  omieId?: string;
159
143
  responsible?: SaleResponsible;
160
- links?: SaleLinks;
144
+ links?: SaleLink[];
145
+ attachments?: Attachment[];
161
146
  }
162
147
  export declare const SaleSchema: MongooseSchema<Sale, import("mongoose").Model<Sale, any, any, any, import("mongoose").Document<unknown, any, Sale, any, {}> & Sale & Required<{
163
148
  _id: Types.ObjectId;