@grapadigital/shared-schemas 1.0.241 → 1.1.0

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 (148) hide show
  1. package/dist/index.d.ts +42 -42
  2. package/dist/schemas/action.schema.d.ts +13 -38
  3. package/dist/schemas/action.schema.js +81 -64
  4. package/dist/schemas/assignment.schema.d.ts +6 -31
  5. package/dist/schemas/assignment.schema.js +44 -44
  6. package/dist/schemas/benchmark.schema.d.ts +5 -30
  7. package/dist/schemas/benchmark.schema.js +11 -6
  8. package/dist/schemas/campaign.schema.d.ts +4 -29
  9. package/dist/schemas/campaign.schema.js +4 -4
  10. package/dist/schemas/client.schema.d.ts +30 -91
  11. package/dist/schemas/client.schema.js +73 -71
  12. package/dist/schemas/comment.schema.d.ts +9 -34
  13. package/dist/schemas/comment.schema.js +42 -37
  14. package/dist/schemas/commission.schema.d.ts +7 -32
  15. package/dist/schemas/commission.schema.js +10 -10
  16. package/dist/schemas/content-capture-process.schema.d.ts +12 -37
  17. package/dist/schemas/content-capture-process.schema.js +24 -17
  18. package/dist/schemas/content-draft.schema.d.ts +4 -29
  19. package/dist/schemas/content-draft.schema.js +5 -5
  20. package/dist/schemas/content.schema.d.ts +20 -45
  21. package/dist/schemas/content.schema.js +84 -74
  22. package/dist/schemas/contract.schema.d.ts +5 -30
  23. package/dist/schemas/contract.schema.js +5 -5
  24. package/dist/schemas/creative.schema.d.ts +11 -36
  25. package/dist/schemas/creative.schema.js +22 -31
  26. package/dist/schemas/export-comments-job.schema.d.ts +4 -29
  27. package/dist/schemas/export-comments-job.schema.js +6 -6
  28. package/dist/schemas/group.schema.d.ts +2 -27
  29. package/dist/schemas/group.schema.js +5 -5
  30. package/dist/schemas/influencer.schema.d.ts +12 -37
  31. package/dist/schemas/influencer.schema.js +16 -18
  32. package/dist/schemas/invoice.schema.d.ts +6 -31
  33. package/dist/schemas/invoice.schema.js +42 -32
  34. package/dist/schemas/job.schema.d.ts +4 -29
  35. package/dist/schemas/job.schema.js +14 -14
  36. package/dist/schemas/lead.schema.d.ts +15 -40
  37. package/dist/schemas/lead.schema.js +67 -64
  38. package/dist/schemas/log.schema.d.ts +3 -28
  39. package/dist/schemas/log.schema.js +24 -24
  40. package/dist/schemas/note.schema.d.ts +3 -28
  41. package/dist/schemas/note.schema.js +9 -9
  42. package/dist/schemas/notifications.schema.d.ts +3 -28
  43. package/dist/schemas/notifications.schema.js +8 -8
  44. package/dist/schemas/organization.schema.d.ts +2 -27
  45. package/dist/schemas/organization.schema.js +4 -4
  46. package/dist/schemas/party.schema.d.ts +6 -31
  47. package/dist/schemas/party.schema.js +11 -11
  48. package/dist/schemas/payment.schema.d.ts +20 -45
  49. package/dist/schemas/payment.schema.js +63 -54
  50. package/dist/schemas/profile.schema.d.ts +5 -30
  51. package/dist/schemas/profile.schema.js +6 -6
  52. package/dist/schemas/project.schema.d.ts +9 -34
  53. package/dist/schemas/project.schema.js +13 -13
  54. package/dist/schemas/prospect.schema.d.ts +6 -31
  55. package/dist/schemas/prospect.schema.js +9 -9
  56. package/dist/schemas/recruitment.schema.d.ts +19 -44
  57. package/dist/schemas/recruitment.schema.js +36 -36
  58. package/dist/schemas/responsible.schema.d.ts +1 -27
  59. package/dist/schemas/responsible.schema.js +6 -6
  60. package/dist/schemas/sale.schema.d.ts +19 -44
  61. package/dist/schemas/sale.schema.js +43 -51
  62. package/dist/schemas/script.schema.d.ts +11 -36
  63. package/dist/schemas/script.schema.js +21 -30
  64. package/dist/schemas/snapshot.schema.d.ts +5 -30
  65. package/dist/schemas/snapshot.schema.js +6 -6
  66. package/dist/schemas/store-visit.schema.d.ts +3 -28
  67. package/dist/schemas/store-visit.schema.js +21 -17
  68. package/dist/schemas/store.schema.d.ts +5 -30
  69. package/dist/schemas/store.schema.js +8 -8
  70. package/dist/schemas/supplier.schema.d.ts +4 -29
  71. package/dist/schemas/supplier.schema.js +3 -3
  72. package/dist/schemas/tag.schema.d.ts +2 -27
  73. package/dist/schemas/tag.schema.js +5 -5
  74. package/dist/schemas/task.schema.d.ts +11 -36
  75. package/dist/schemas/task.schema.js +67 -67
  76. package/dist/schemas/token.schema.d.ts +3 -28
  77. package/dist/schemas/token.schema.js +3 -3
  78. package/dist/schemas/trigger.schema.d.ts +3 -28
  79. package/dist/schemas/trigger.schema.js +5 -5
  80. package/dist/schemas/user.schema.d.ts +3 -28
  81. package/dist/schemas/user.schema.js +7 -7
  82. package/dist/schemas/webhook.schema.d.ts +6 -31
  83. package/dist/schemas/webhook.schema.js +10 -10
  84. package/dist/utils/merge-metrics-breakdown.util.d.ts +1 -1
  85. package/dist/utils/merge-metrics-breakdown.util.js +7 -2
  86. package/dist/utils/normalize-content-link.util.js +7 -7
  87. package/package.json +29 -16
  88. package/.eslintrc.json +0 -28
  89. package/.prettierrc +0 -4
  90. package/dist/schemas/profile-followers-snapshot.schema.d.ts +0 -67
  91. package/dist/schemas/profile-followers-snapshot.schema.js +0 -65
  92. package/dist/schemas/schedule.schema.d.ts +0 -73
  93. package/dist/schemas/schedule.schema.js +0 -116
  94. package/dist/utils/cost-per-impact.util.d.ts +0 -37
  95. package/dist/utils/cost-per-impact.util.js +0 -72
  96. package/dist/utils/influencer-contract.util.d.ts +0 -32
  97. package/dist/utils/influencer-contract.util.js +0 -77
  98. package/docs/code-review.md +0 -27
  99. package/docs/constitution.md +0 -75
  100. package/docs/specs/GD-692.md +0 -112
  101. package/docs/specs/GD-761.md +0 -94
  102. package/index.d.ts +0 -3
  103. package/src/index.ts +0 -42
  104. package/src/schemas/action.schema.ts +0 -328
  105. package/src/schemas/assignment.schema.ts +0 -154
  106. package/src/schemas/benchmark.schema.ts +0 -39
  107. package/src/schemas/campaign.schema.ts +0 -38
  108. package/src/schemas/client.schema.ts +0 -319
  109. package/src/schemas/comment.schema.ts +0 -216
  110. package/src/schemas/commission.schema.ts +0 -108
  111. package/src/schemas/content-capture-process.schema.ts +0 -195
  112. package/src/schemas/content-draft.schema.ts +0 -49
  113. package/src/schemas/content.schema.ts +0 -688
  114. package/src/schemas/contract.schema.ts +0 -44
  115. package/src/schemas/creative.schema.ts +0 -256
  116. package/src/schemas/export-comments-job.schema.ts +0 -59
  117. package/src/schemas/group.schema.ts +0 -23
  118. package/src/schemas/influencer.schema.ts +0 -184
  119. package/src/schemas/invoice.schema.ts +0 -164
  120. package/src/schemas/job.schema.ts +0 -111
  121. package/src/schemas/lead.schema.ts +0 -372
  122. package/src/schemas/log.schema.ts +0 -91
  123. package/src/schemas/note.schema.ts +0 -34
  124. package/src/schemas/notifications.schema.ts +0 -61
  125. package/src/schemas/organization.schema.ts +0 -29
  126. package/src/schemas/party.schema.ts +0 -65
  127. package/src/schemas/payment.schema.ts +0 -275
  128. package/src/schemas/profile.schema.ts +0 -77
  129. package/src/schemas/project.schema.ts +0 -116
  130. package/src/schemas/prospect.schema.ts +0 -62
  131. package/src/schemas/recruitment.schema.ts +0 -277
  132. package/src/schemas/responsible.schema.ts +0 -27
  133. package/src/schemas/sale.schema.ts +0 -297
  134. package/src/schemas/script.schema.ts +0 -235
  135. package/src/schemas/snapshot.schema.ts +0 -55
  136. package/src/schemas/store-visit.schema.ts +0 -68
  137. package/src/schemas/store.schema.ts +0 -52
  138. package/src/schemas/supplier.schema.ts +0 -12
  139. package/src/schemas/tag.schema.ts +0 -26
  140. package/src/schemas/task.schema.ts +0 -205
  141. package/src/schemas/token.schema.ts +0 -42
  142. package/src/schemas/trigger.schema.ts +0 -48
  143. package/src/schemas/user.schema.ts +0 -59
  144. package/src/schemas/webhook.schema.ts +0 -81
  145. package/src/utils/merge-metrics-breakdown.util.ts +0 -51
  146. package/src/utils/normalize-content-link.util.ts +0 -31
  147. package/tsconfig.build.json +0 -5
  148. package/tsconfig.json +0 -29
@@ -19,7 +19,7 @@ const responsible_schema_1 = require("./responsible.schema");
19
19
  * Personalizações de cliente: ligam telas e regras que valem só para ele.
20
20
  * Ver GD-683 (samsung) e GD-663 (shoulder).
21
21
  */
22
- exports.CLIENT_CUSTOMIZATION_VALUES = ['samsung', 'shoulder'];
22
+ exports.CLIENT_CUSTOMIZATION_VALUES = ["samsung", "shoulder"];
23
23
  /**
24
24
  * Catálogo de métricas que podem virar meta no Tier ou na Meta anual do
25
25
  * cliente. Quem cadastra escolhe a métrica e o valor; nada fica fixo.
@@ -27,48 +27,49 @@ exports.CLIENT_CUSTOMIZATION_VALUES = ['samsung', 'shoulder'];
27
27
  * Ver GD-687.
28
28
  */
29
29
  exports.CLIENT_GOAL_METRIC_VALUES = [
30
- 'potentialReach',
31
- 'reachCount',
32
- 'impressionCount',
33
- 'engagementCount',
34
- 'engagementRate',
35
- 'reachEngagementRate',
36
- 'followersEngagementRate',
37
- 'qualifiedEngagementRate',
38
- 'effectiveReach',
39
- 'earnedMediaValue',
40
- 'score',
41
- 'costPerInfluency',
42
- 'costPerImpact',
43
- 'costPerEngagement',
44
- 'savedCount',
45
- 'shareCount',
46
- 'videoCompletionRate',
47
- 'viralReachEngagementRate',
30
+ "potentialReach",
31
+ "reachCount",
32
+ "impressionCount",
33
+ "engagementCount",
34
+ "engagementRate",
35
+ "reachEngagementRate",
36
+ "followersEngagementRate",
37
+ "qualifiedEngagementRate",
38
+ "effectiveReach",
39
+ "earnedMediaValue",
40
+ "score",
41
+ "costPerInfluency",
42
+ "costPerImpact",
43
+ "costPerEngagement",
44
+ "savedCount",
45
+ "shareCount",
46
+ "videoCompletionRate",
47
+ "viralReachEngagementRate",
48
48
  ];
49
49
  /** Unidade de cada métrica. `rate` é guardado como fração (0,10 = 10%). */
50
50
  exports.CLIENT_GOAL_METRIC_UNITS = {
51
- potentialReach: 'count',
52
- reachCount: 'count',
53
- impressionCount: 'count',
54
- engagementCount: 'count',
55
- engagementRate: 'rate',
56
- reachEngagementRate: 'rate',
57
- followersEngagementRate: 'rate',
58
- qualifiedEngagementRate: 'rate',
59
- effectiveReach: 'count',
60
- earnedMediaValue: 'currency',
61
- score: 'count',
62
- costPerInfluency: 'currency',
63
- costPerImpact: 'currency',
64
- costPerEngagement: 'currency',
65
- savedCount: 'count',
66
- shareCount: 'count',
67
- videoCompletionRate: 'rate',
68
- viralReachEngagementRate: 'rate',
51
+ potentialReach: "count",
52
+ reachCount: "count",
53
+ impressionCount: "count",
54
+ engagementCount: "count",
55
+ engagementRate: "rate",
56
+ reachEngagementRate: "rate",
57
+ followersEngagementRate: "rate",
58
+ qualifiedEngagementRate: "rate",
59
+ effectiveReach: "count",
60
+ earnedMediaValue: "currency",
61
+ score: "count",
62
+ costPerInfluency: "currency",
63
+ costPerImpact: "currency",
64
+ costPerEngagement: "currency",
65
+ savedCount: "count",
66
+ shareCount: "count",
67
+ videoCompletionRate: "rate",
68
+ viralReachEngagementRate: "rate",
69
69
  };
70
70
  let Cluster = class Cluster {
71
71
  };
72
+ exports.Cluster = Cluster;
72
73
  __decorate([
73
74
  (0, mongoose_1.Prop)({ required: true }),
74
75
  __metadata("design:type", String)
@@ -77,10 +78,9 @@ __decorate([
77
78
  (0, mongoose_1.Prop)({ required: true }),
78
79
  __metadata("design:type", String)
79
80
  ], Cluster.prototype, "label", void 0);
80
- Cluster = __decorate([
81
+ exports.Cluster = Cluster = __decorate([
81
82
  (0, mongoose_1.Schema)({ _id: false })
82
83
  ], Cluster);
83
- exports.Cluster = Cluster;
84
84
  exports.ClusterSchema = mongoose_1.SchemaFactory.createForClass(Cluster);
85
85
  /**
86
86
  * Squad do cliente (ex.: { key: 'alto_padrao', label: 'Alto Padrão' }). A chave
@@ -89,6 +89,7 @@ exports.ClusterSchema = mongoose_1.SchemaFactory.createForClass(Cluster);
89
89
  */
90
90
  let ClientSquad = class ClientSquad {
91
91
  };
92
+ exports.ClientSquad = ClientSquad;
92
93
  __decorate([
93
94
  (0, mongoose_1.Prop)({ required: true }),
94
95
  __metadata("design:type", String)
@@ -97,13 +98,13 @@ __decorate([
97
98
  (0, mongoose_1.Prop)({ required: true }),
98
99
  __metadata("design:type", String)
99
100
  ], ClientSquad.prototype, "label", void 0);
100
- ClientSquad = __decorate([
101
+ exports.ClientSquad = ClientSquad = __decorate([
101
102
  (0, mongoose_1.Schema)({ _id: false })
102
103
  ], ClientSquad);
103
- exports.ClientSquad = ClientSquad;
104
104
  exports.ClientSquadSchema = mongoose_1.SchemaFactory.createForClass(ClientSquad);
105
105
  let Company = class Company {
106
106
  };
107
+ exports.Company = Company;
107
108
  __decorate([
108
109
  (0, mongoose_1.Prop)(),
109
110
  __metadata("design:type", String)
@@ -112,13 +113,13 @@ __decorate([
112
113
  (0, mongoose_1.Prop)(),
113
114
  __metadata("design:type", String)
114
115
  ], Company.prototype, "document", void 0);
115
- Company = __decorate([
116
+ exports.Company = Company = __decorate([
116
117
  (0, mongoose_1.Schema)({ _id: false })
117
118
  ], Company);
118
- exports.Company = Company;
119
119
  exports.CompanySchema = mongoose_1.SchemaFactory.createForClass(Company);
120
120
  let CommissionRange = class CommissionRange {
121
121
  };
122
+ exports.CommissionRange = CommissionRange;
122
123
  __decorate([
123
124
  (0, mongoose_1.Prop)({ required: false }),
124
125
  __metadata("design:type", Number)
@@ -131,27 +132,29 @@ __decorate([
131
132
  (0, mongoose_1.Prop)({ required: true }),
132
133
  __metadata("design:type", Number)
133
134
  ], CommissionRange.prototype, "percent", void 0);
134
- CommissionRange = __decorate([
135
+ exports.CommissionRange = CommissionRange = __decorate([
135
136
  (0, mongoose_1.Schema)({ _id: false })
136
137
  ], CommissionRange);
137
- exports.CommissionRange = CommissionRange;
138
138
  exports.CommissionRangeSchema = mongoose_1.SchemaFactory.createForClass(CommissionRange);
139
139
  let ClientMetricGoal = class ClientMetricGoal {
140
140
  };
141
+ exports.ClientMetricGoal = ClientMetricGoal;
141
142
  __decorate([
142
- (0, swagger_1.ApiProperty)({ enum: exports.CLIENT_GOAL_METRIC_VALUES, example: 'potentialReach' }),
143
+ (0, swagger_1.ApiProperty)({ enum: exports.CLIENT_GOAL_METRIC_VALUES, example: "potentialReach" }),
143
144
  (0, mongoose_1.Prop)({ type: String, enum: exports.CLIENT_GOAL_METRIC_VALUES, required: true }),
144
145
  __metadata("design:type", String)
145
146
  ], ClientMetricGoal.prototype, "metric", void 0);
146
147
  __decorate([
147
- (0, swagger_1.ApiProperty)({ example: 120000000, description: 'Na unidade da métrica; percentuais em fração (0,25 = 25%)' }),
148
+ (0, swagger_1.ApiProperty)({
149
+ example: 120000000,
150
+ description: "Na unidade da métrica; percentuais em fração (0,25 = 25%)",
151
+ }),
148
152
  (0, mongoose_1.Prop)({ type: Number, required: true }),
149
153
  __metadata("design:type", Number)
150
154
  ], ClientMetricGoal.prototype, "value", void 0);
151
- ClientMetricGoal = __decorate([
155
+ exports.ClientMetricGoal = ClientMetricGoal = __decorate([
152
156
  (0, mongoose_1.Schema)({ _id: false })
153
157
  ], ClientMetricGoal);
154
- exports.ClientMetricGoal = ClientMetricGoal;
155
158
  exports.ClientMetricGoalSchema = mongoose_1.SchemaFactory.createForClass(ClientMetricGoal);
156
159
  /**
157
160
  * Faixa de seguidores do cliente com as metas dela (ex.: Micro, Macro, Hero,
@@ -161,6 +164,7 @@ exports.ClientMetricGoalSchema = mongoose_1.SchemaFactory.createForClass(ClientM
161
164
  */
162
165
  let ClientTier = class ClientTier {
163
166
  };
167
+ exports.ClientTier = ClientTier;
164
168
  __decorate([
165
169
  (0, mongoose_1.Prop)({ type: String, required: true }),
166
170
  __metadata("design:type", String)
@@ -177,14 +181,14 @@ __decorate([
177
181
  (0, mongoose_1.Prop)({ type: [exports.ClientMetricGoalSchema], default: [] }),
178
182
  __metadata("design:type", Array)
179
183
  ], ClientTier.prototype, "goals", void 0);
180
- ClientTier = __decorate([
184
+ exports.ClientTier = ClientTier = __decorate([
181
185
  (0, mongoose_1.Schema)({ _id: false })
182
186
  ], ClientTier);
183
- exports.ClientTier = ClientTier;
184
187
  exports.ClientTierSchema = mongoose_1.SchemaFactory.createForClass(ClientTier);
185
188
  /** Metas do cliente num ano (alimentam os cards do gen_ia). Ver GD-687. */
186
189
  let ClientAnnualGoal = class ClientAnnualGoal {
187
190
  };
191
+ exports.ClientAnnualGoal = ClientAnnualGoal;
188
192
  __decorate([
189
193
  (0, mongoose_1.Prop)({ type: Number, required: true }),
190
194
  __metadata("design:type", Number)
@@ -193,13 +197,13 @@ __decorate([
193
197
  (0, mongoose_1.Prop)({ type: [exports.ClientMetricGoalSchema], default: [] }),
194
198
  __metadata("design:type", Array)
195
199
  ], ClientAnnualGoal.prototype, "goals", void 0);
196
- ClientAnnualGoal = __decorate([
200
+ exports.ClientAnnualGoal = ClientAnnualGoal = __decorate([
197
201
  (0, mongoose_1.Schema)({ _id: false })
198
202
  ], ClientAnnualGoal);
199
- exports.ClientAnnualGoal = ClientAnnualGoal;
200
203
  exports.ClientAnnualGoalSchema = mongoose_1.SchemaFactory.createForClass(ClientAnnualGoal);
201
204
  let AgencyCommissionPeriod = class AgencyCommissionPeriod {
202
205
  };
206
+ exports.AgencyCommissionPeriod = AgencyCommissionPeriod;
203
207
  __decorate([
204
208
  (0, mongoose_1.Prop)({ type: [exports.CommissionRangeSchema], required: true, default: [] }),
205
209
  __metadata("design:type", Array)
@@ -212,13 +216,13 @@ __decorate([
212
216
  (0, mongoose_1.Prop)({ required: true }),
213
217
  __metadata("design:type", Date)
214
218
  ], AgencyCommissionPeriod.prototype, "endDate", void 0);
215
- AgencyCommissionPeriod = __decorate([
219
+ exports.AgencyCommissionPeriod = AgencyCommissionPeriod = __decorate([
216
220
  (0, mongoose_1.Schema)({ _id: false })
217
221
  ], AgencyCommissionPeriod);
218
- exports.AgencyCommissionPeriod = AgencyCommissionPeriod;
219
222
  exports.AgencyCommissionPeriodSchema = mongoose_1.SchemaFactory.createForClass(AgencyCommissionPeriod);
220
223
  let NicheItem = class NicheItem {
221
224
  };
225
+ exports.NicheItem = NicheItem;
222
226
  __decorate([
223
227
  (0, mongoose_1.Prop)({ required: true }),
224
228
  __metadata("design:type", String)
@@ -231,10 +235,9 @@ __decorate([
231
235
  (0, mongoose_1.Prop)({ default: null }),
232
236
  __metadata("design:type", String)
233
237
  ], NicheItem.prototype, "parentId", void 0);
234
- NicheItem = __decorate([
238
+ exports.NicheItem = NicheItem = __decorate([
235
239
  (0, mongoose_1.Schema)({ _id: false })
236
240
  ], NicheItem);
237
- exports.NicheItem = NicheItem;
238
241
  exports.NicheItemSchema = mongoose_1.SchemaFactory.createForClass(NicheItem);
239
242
  /**
240
243
  * Responsáveis do cliente: `report` são usuários da plataforma que cuidam dos
@@ -242,23 +245,24 @@ exports.NicheItemSchema = mongoose_1.SchemaFactory.createForClass(NicheItem);
242
245
  */
243
246
  let ClientResponsible = class ClientResponsible {
244
247
  };
248
+ exports.ClientResponsible = ClientResponsible;
245
249
  __decorate([
246
250
  (0, swagger_1.ApiProperty)({ type: () => [responsible_schema_1.Responsible], required: false }),
247
251
  (0, mongoose_1.Prop)({ type: [responsible_schema_1.ResponsibleSchema], required: false, default: [] }),
248
252
  __metadata("design:type", Array)
249
253
  ], ClientResponsible.prototype, "report", void 0);
250
254
  __decorate([
251
- (0, swagger_1.ApiProperty)({ example: 'Maite', required: false }),
255
+ (0, swagger_1.ApiProperty)({ example: "Maite", required: false }),
252
256
  (0, mongoose_1.Prop)({ type: String, required: false }),
253
257
  __metadata("design:type", String)
254
258
  ], ClientResponsible.prototype, "brand", void 0);
255
- ClientResponsible = __decorate([
259
+ exports.ClientResponsible = ClientResponsible = __decorate([
256
260
  (0, mongoose_1.Schema)({ _id: false })
257
261
  ], ClientResponsible);
258
- exports.ClientResponsible = ClientResponsible;
259
262
  exports.ClientResponsibleSchema = mongoose_1.SchemaFactory.createForClass(ClientResponsible);
260
263
  let Client = class Client extends party_schema_1.Party {
261
264
  };
265
+ exports.Client = Client;
262
266
  __decorate([
263
267
  (0, mongoose_1.Prop)({ type: [exports.ClusterSchema], default: [] }),
264
268
  __metadata("design:type", Array)
@@ -272,7 +276,7 @@ __decorate([
272
276
  __metadata("design:type", String)
273
277
  ], Client.prototype, "type", void 0);
274
278
  __decorate([
275
- (0, mongoose_1.Prop)({ type: String, enum: ['fixed', 'punctual'], required: false }),
279
+ (0, mongoose_1.Prop)({ type: String, enum: ["fixed", "punctual"], required: false }),
276
280
  __metadata("design:type", String)
277
281
  ], Client.prototype, "engagement", void 0);
278
282
  __decorate([
@@ -283,7 +287,8 @@ __decorate([
283
287
  (0, mongoose_1.Prop)({
284
288
  type: [exports.NicheItemSchema],
285
289
  default: [],
286
- _id: false, required: false
290
+ _id: false,
291
+ required: false,
287
292
  }),
288
293
  __metadata("design:type", Array)
289
294
  ], Client.prototype, "niches", void 0);
@@ -320,7 +325,7 @@ __decorate([
320
325
  __metadata("design:type", Array)
321
326
  ], Client.prototype, "squads", void 0);
322
327
  __decorate([
323
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Organization', required: false }),
328
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Organization", required: false }),
324
329
  __metadata("design:type", mongoose_2.Types.ObjectId)
325
330
  ], Client.prototype, "organization", void 0);
326
331
  __decorate([
@@ -328,19 +333,16 @@ __decorate([
328
333
  __metadata("design:type", ClientResponsible)
329
334
  ], Client.prototype, "responsible", void 0);
330
335
  __decorate([
331
- (0, mongoose_1.Prop)([
332
- { type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: false },
333
- ]),
336
+ (0, mongoose_1.Prop)([{ type: mongoose_2.Schema.Types.ObjectId, ref: "Profile", required: false }]),
334
337
  __metadata("design:type", Array)
335
338
  ], Client.prototype, "profiles", void 0);
336
- Client = __decorate([
339
+ exports.Client = Client = __decorate([
337
340
  (0, mongoose_1.Schema)({ timestamps: true })
338
341
  ], Client);
339
- exports.Client = Client;
340
342
  exports.ClientSchema = mongoose_1.SchemaFactory.createForClass(Client);
341
343
  exports.ClientSchema.index({ name: 1 });
342
- exports.ClientSchema.index({ 'company.legalName': 1 });
343
- exports.ClientSchema.index({ 'company.document': 1 });
344
+ exports.ClientSchema.index({ "company.legalName": 1 });
345
+ exports.ClientSchema.index({ "company.document": 1 });
344
346
  exports.ClientSchema.index({ createdAt: -1 });
345
347
  exports.ClientSchema.index({ organization: 1 }, { sparse: true });
346
- exports.ClientModel = (0, mongoose_2.model)('Client', exports.ClientSchema);
348
+ exports.ClientModel = (0, mongoose_2.model)("Client", exports.ClientSchema);
@@ -1,31 +1,6 @@
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 { Content } from './content.schema';
28
- import { Action } from './action.schema';
1
+ import { HydratedDocument, Schema as MongooseSchema, Types } from "mongoose";
2
+ import { Content } from "./content.schema";
3
+ import { Action } from "./action.schema";
29
4
  export type CommentDocument = HydratedDocument<Comment>;
30
5
  export declare const COMMENT_TARGET_VALUES: readonly ["brand", "influencer", "content", "emoji", "spam"];
31
6
  export type CommentTarget = (typeof COMMENT_TARGET_VALUES)[number];
@@ -45,7 +20,7 @@ export declare const CommentSpamReasonSchema: MongooseSchema<CommentSpamReason,
45
20
  _id: Types.ObjectId;
46
21
  } & {
47
22
  __v: number;
48
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CommentSpamReason, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CommentSpamReason>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CommentSpamReason> & {
23
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CommentSpamReason, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CommentSpamReason>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<CommentSpamReason> & {
49
24
  _id: Types.ObjectId;
50
25
  } & {
51
26
  __v: number;
@@ -59,7 +34,7 @@ export declare const CommentClassifiedBySchema: MongooseSchema<CommentClassified
59
34
  _id: Types.ObjectId;
60
35
  } & {
61
36
  __v: number;
62
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CommentClassifiedBy, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CommentClassifiedBy>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CommentClassifiedBy> & {
37
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CommentClassifiedBy, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CommentClassifiedBy>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<CommentClassifiedBy> & {
63
38
  _id: Types.ObjectId;
64
39
  } & {
65
40
  __v: number;
@@ -79,8 +54,8 @@ export declare class Comment {
79
54
  parent?: Types.ObjectId | Comment | null;
80
55
  target?: CommentTarget | null;
81
56
  subject?: CommentSubject | null;
82
- polarity?: 'positive' | 'negative' | 'neutral' | null;
83
- funnel?: 'awareness' | 'consideration' | 'conversion' | 'none' | null;
57
+ polarity?: "positive" | "negative" | "neutral" | null;
58
+ funnel?: "awareness" | "consideration" | "conversion" | "none" | null;
84
59
  isEmojiOnly?: boolean;
85
60
  isSpam?: boolean;
86
61
  spamReason?: CommentSpamReason | null;
@@ -99,7 +74,7 @@ export declare const CommentSchema: MongooseSchema<Comment, import("mongoose").M
99
74
  _id: Types.ObjectId;
100
75
  }> & {
101
76
  __v: number;
102
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Comment, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Comment>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Comment> & Required<{
77
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Comment, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Comment>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<Comment> & Required<{
103
78
  _id: Types.ObjectId;
104
79
  }> & {
105
80
  __v: number;
@@ -112,7 +87,7 @@ export declare const CommentModel: import("mongoose").Model<Comment, {}, {}, {},
112
87
  _id: Types.ObjectId;
113
88
  }> & {
114
89
  __v: number;
115
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Comment, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Comment>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Comment> & Required<{
90
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Comment, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Comment>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<Comment> & Required<{
116
91
  _id: Types.ObjectId;
117
92
  }> & {
118
93
  __v: number;
@@ -12,37 +12,43 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CommentModel = exports.CommentSchema = exports.Comment = exports.CommentClassifiedBySchema = exports.CommentClassifiedBy = exports.CommentSpamReasonSchema = exports.CommentSpamReason = exports.COMMENT_SPAM_RULE_VALUES = exports.COMMENT_CLASSIFICATION_STATUS_VALUES = exports.COMMENT_SUBJECT_VALUES = exports.COMMENT_TARGET_VALUES = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
- exports.COMMENT_TARGET_VALUES = ['brand', 'influencer', 'content', 'emoji', 'spam'];
15
+ exports.COMMENT_TARGET_VALUES = ["brand", "influencer", "content", "emoji", "spam"];
16
16
  exports.COMMENT_SUBJECT_VALUES = [
17
- 'compliment_to_person',
18
- 'criticism',
19
- 'question',
20
- 'brand_recognition',
21
- 'influencer_response',
22
- 'account',
23
- 'reaction',
24
- 'doubt',
25
- 'about_story',
26
- 'about_self',
27
- 'competition',
28
- 'customer_service',
29
- 'tagged_someone',
30
- 'other',
31
- 'emoji_reaction',
17
+ "compliment_to_person",
18
+ "criticism",
19
+ "question",
20
+ "brand_recognition",
21
+ "influencer_response",
22
+ "account",
23
+ "reaction",
24
+ "doubt",
25
+ "about_story",
26
+ "about_self",
27
+ "competition",
28
+ "customer_service",
29
+ "tagged_someone",
30
+ "other",
31
+ "emoji_reaction",
32
32
  ];
33
33
  exports.COMMENT_CLASSIFICATION_STATUS_VALUES = [
34
- 'pending',
35
- 'processing',
36
- 'completed',
37
- 'failed',
38
- 'not_applicable',
34
+ "pending",
35
+ "processing",
36
+ "completed",
37
+ "failed",
38
+ "not_applicable",
39
+ ];
40
+ exports.COMMENT_SPAM_RULE_VALUES = [
41
+ "duplicate_text",
42
+ "repeat_author",
43
+ "manual",
44
+ "unknown",
39
45
  ];
40
- exports.COMMENT_SPAM_RULE_VALUES = ['duplicate_text', 'repeat_author', 'manual', 'unknown'];
41
46
  // Por que o comentário foi marcado como spam. `groupKey` identifica os outros
42
47
  // comentários do mesmo conteúdo que caíram na mesma regra: autor normalizado
43
48
  // (repeat_author) ou `autor::texto` normalizado (duplicate_text).
44
49
  let CommentSpamReason = class CommentSpamReason {
45
50
  };
51
+ exports.CommentSpamReason = CommentSpamReason;
46
52
  __decorate([
47
53
  (0, mongoose_1.Prop)({ type: String, enum: exports.COMMENT_SPAM_RULE_VALUES, required: true }),
48
54
  __metadata("design:type", String)
@@ -59,13 +65,13 @@ __decorate([
59
65
  (0, mongoose_1.Prop)({ type: String, required: false }),
60
66
  __metadata("design:type", String)
61
67
  ], CommentSpamReason.prototype, "groupKey", void 0);
62
- CommentSpamReason = __decorate([
68
+ exports.CommentSpamReason = CommentSpamReason = __decorate([
63
69
  (0, mongoose_1.Schema)({ _id: false })
64
70
  ], CommentSpamReason);
65
- exports.CommentSpamReason = CommentSpamReason;
66
71
  exports.CommentSpamReasonSchema = mongoose_1.SchemaFactory.createForClass(CommentSpamReason);
67
72
  let CommentClassifiedBy = class CommentClassifiedBy {
68
73
  };
74
+ exports.CommentClassifiedBy = CommentClassifiedBy;
69
75
  __decorate([
70
76
  (0, mongoose_1.Prop)({ type: String, required: false }),
71
77
  __metadata("design:type", String)
@@ -78,23 +84,23 @@ __decorate([
78
84
  (0, mongoose_1.Prop)({ type: String, required: false }),
79
85
  __metadata("design:type", String)
80
86
  ], CommentClassifiedBy.prototype, "email", void 0);
81
- CommentClassifiedBy = __decorate([
87
+ exports.CommentClassifiedBy = CommentClassifiedBy = __decorate([
82
88
  (0, mongoose_1.Schema)({ _id: false })
83
89
  ], CommentClassifiedBy);
84
- exports.CommentClassifiedBy = CommentClassifiedBy;
85
90
  exports.CommentClassifiedBySchema = mongoose_1.SchemaFactory.createForClass(CommentClassifiedBy);
86
91
  let Comment = class Comment {
87
92
  };
93
+ exports.Comment = Comment;
88
94
  __decorate([
89
95
  (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
90
96
  __metadata("design:type", mongoose_2.Types.ObjectId)
91
97
  ], Comment.prototype, "_id", void 0);
92
98
  __decorate([
93
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Content', required: true }),
99
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Content", required: true }),
94
100
  __metadata("design:type", Object)
95
101
  ], Comment.prototype, "content", void 0);
96
102
  __decorate([
97
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Action', required: true }),
103
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Action", required: true }),
98
104
  __metadata("design:type", Object)
99
105
  ], Comment.prototype, "action", void 0);
100
106
  __decorate([
@@ -130,7 +136,7 @@ __decorate([
130
136
  __metadata("design:type", Number)
131
137
  ], Comment.prototype, "likeCount", void 0);
132
138
  __decorate([
133
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Comment', required: false, default: null }),
139
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Comment", required: false, default: null }),
134
140
  __metadata("design:type", Object)
135
141
  ], Comment.prototype, "parent", void 0);
136
142
  __decorate([
@@ -154,7 +160,7 @@ __decorate([
154
160
  __decorate([
155
161
  (0, mongoose_1.Prop)({
156
162
  type: String,
157
- enum: ['positive', 'negative', 'neutral'],
163
+ enum: ["positive", "negative", "neutral"],
158
164
  required: false,
159
165
  default: null,
160
166
  }),
@@ -163,7 +169,7 @@ __decorate([
163
169
  __decorate([
164
170
  (0, mongoose_1.Prop)({
165
171
  type: String,
166
- enum: ['awareness', 'consideration', 'conversion', 'none'],
172
+ enum: ["awareness", "consideration", "conversion", "none"],
167
173
  required: false,
168
174
  default: null,
169
175
  }),
@@ -202,7 +208,7 @@ __decorate([
202
208
  type: String,
203
209
  enum: exports.COMMENT_CLASSIFICATION_STATUS_VALUES,
204
210
  required: false,
205
- default: 'pending',
211
+ default: "pending",
206
212
  }),
207
213
  __metadata("design:type", String)
208
214
  ], Comment.prototype, "classificationStatus", void 0);
@@ -215,7 +221,7 @@ __decorate([
215
221
  __metadata("design:type", Object)
216
222
  ], Comment.prototype, "classificationProcessedAt", void 0);
217
223
  __decorate([
218
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Comment', required: false, default: null }),
224
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Comment", required: false, default: null }),
219
225
  __metadata("design:type", Object)
220
226
  ], Comment.prototype, "sourceCommentId", void 0);
221
227
  __decorate([
@@ -226,10 +232,9 @@ __decorate([
226
232
  (0, mongoose_1.Prop)({ default: Date.now, required: false }),
227
233
  __metadata("design:type", Date)
228
234
  ], Comment.prototype, "updatedAt", void 0);
229
- Comment = __decorate([
235
+ exports.Comment = Comment = __decorate([
230
236
  (0, mongoose_1.Schema)({ timestamps: true })
231
237
  ], Comment);
232
- exports.Comment = Comment;
233
238
  exports.CommentSchema = mongoose_1.SchemaFactory.createForClass(Comment);
234
239
  // partialFilterExpression não aceita $exists:false (só $exists:true) — usamos
235
240
  // igualdade com null, que no Mongo casa tanto "campo ausente" quanto "campo
@@ -240,5 +245,5 @@ exports.CommentSchema.index({ action: 1, funnel: 1 });
240
245
  exports.CommentSchema.index({ action: 1, target: 1 });
241
246
  exports.CommentSchema.index({ content: 1, parent: 1 });
242
247
  exports.CommentSchema.index({ content: 1, classificationStatus: 1 });
243
- exports.CommentSchema.index({ content: 1, 'spamReason.groupKey': 1 });
244
- exports.CommentModel = (0, mongoose_2.model)('Comment', exports.CommentSchema);
248
+ exports.CommentSchema.index({ content: 1, "spamReason.groupKey": 1 });
249
+ exports.CommentModel = (0, mongoose_2.model)("Comment", exports.CommentSchema);
@@ -1,41 +1,16 @@
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 { Sale } from './sale.schema';
1
+ import { HydratedDocument, Schema as MongooseSchema, Types } from "mongoose";
2
+ import { Sale } from "./sale.schema";
28
3
  export type CommissionDocument = HydratedDocument<Commission>;
29
4
  export declare class Commission {
30
5
  _id?: Types.ObjectId;
31
6
  title: string;
32
7
  installmentNumber: number;
33
8
  email: string;
34
- role: 'origination' | 'commercial' | 'planning' | 'curation';
9
+ role: "origination" | "commercial" | "planning" | "curation";
35
10
  value: number;
36
11
  percentage: number;
37
- status: 'pending' | 'approved' | 'ready' | 'received' | 'paid' | 'cancelled' | 'disputed' | 'reproved';
38
- type: 'collaborator' | 'agency' | 'bonus';
12
+ status: "pending" | "approved" | "ready" | "received" | "paid" | "cancelled" | "disputed" | "reproved";
13
+ type: "collaborator" | "agency" | "bonus";
39
14
  sale: Types.ObjectId | Sale;
40
15
  paidAt?: Date;
41
16
  approvedAt?: Date;
@@ -65,7 +40,7 @@ export declare const CommissionSchema: MongooseSchema<Commission, import("mongoo
65
40
  _id: Types.ObjectId;
66
41
  }> & {
67
42
  __v: number;
68
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Commission, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Commission>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Commission> & Required<{
43
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Commission, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Commission>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<Commission> & Required<{
69
44
  _id: Types.ObjectId;
70
45
  }> & {
71
46
  __v: number;
@@ -78,7 +53,7 @@ export declare const CommissionModel: import("mongoose").Model<Commission, {}, {
78
53
  _id: Types.ObjectId;
79
54
  }> & {
80
55
  __v: number;
81
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Commission, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Commission>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Commission> & Required<{
56
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Commission, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Commission>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<Commission> & Required<{
82
57
  _id: Types.ObjectId;
83
58
  }> & {
84
59
  __v: number;