@grapadigital/shared-schemas 1.0.242 → 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 +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/benchmark.schema.d.ts +3 -28
  7. package/dist/schemas/benchmark.schema.js +11 -6
  8. package/dist/schemas/campaign.schema.d.ts +2 -27
  9. package/dist/schemas/campaign.schema.js +4 -4
  10. package/dist/schemas/client.schema.d.ts +18 -79
  11. package/dist/schemas/client.schema.js +73 -71
  12. package/dist/schemas/comment.schema.d.ts +5 -30
  13. package/dist/schemas/comment.schema.js +42 -37
  14. package/dist/schemas/commission.schema.d.ts +5 -30
  15. package/dist/schemas/commission.schema.js +10 -10
  16. package/dist/schemas/content-capture-process.schema.d.ts +6 -31
  17. package/dist/schemas/content-capture-process.schema.js +24 -17
  18. package/dist/schemas/content-draft.schema.d.ts +2 -27
  19. package/dist/schemas/content-draft.schema.js +5 -5
  20. package/dist/schemas/content.schema.d.ts +6 -31
  21. package/dist/schemas/content.schema.js +84 -74
  22. package/dist/schemas/contract.schema.d.ts +3 -28
  23. package/dist/schemas/contract.schema.js +5 -5
  24. package/dist/schemas/creative.schema.d.ts +6 -31
  25. package/dist/schemas/creative.schema.js +22 -31
  26. package/dist/schemas/export-comments-job.schema.d.ts +2 -27
  27. package/dist/schemas/export-comments-job.schema.js +6 -6
  28. package/dist/schemas/group.schema.d.ts +1 -26
  29. package/dist/schemas/group.schema.js +5 -5
  30. package/dist/schemas/influencer.schema.d.ts +6 -31
  31. package/dist/schemas/influencer.schema.js +16 -18
  32. package/dist/schemas/invoice.schema.d.ts +4 -29
  33. package/dist/schemas/invoice.schema.js +42 -32
  34. package/dist/schemas/job.schema.d.ts +2 -27
  35. package/dist/schemas/job.schema.js +14 -14
  36. package/dist/schemas/lead.schema.d.ts +1 -26
  37. package/dist/schemas/lead.schema.js +67 -64
  38. package/dist/schemas/log.schema.d.ts +1 -26
  39. package/dist/schemas/log.schema.js +24 -24
  40. package/dist/schemas/note.schema.d.ts +1 -26
  41. package/dist/schemas/note.schema.js +9 -9
  42. package/dist/schemas/notifications.schema.d.ts +1 -26
  43. package/dist/schemas/notifications.schema.js +8 -8
  44. package/dist/schemas/organization.schema.d.ts +1 -26
  45. package/dist/schemas/organization.schema.js +4 -4
  46. package/dist/schemas/party.schema.d.ts +1 -26
  47. package/dist/schemas/party.schema.js +11 -11
  48. package/dist/schemas/payment.schema.d.ts +10 -35
  49. package/dist/schemas/payment.schema.js +63 -54
  50. package/dist/schemas/profile.schema.d.ts +3 -28
  51. package/dist/schemas/profile.schema.js +6 -6
  52. package/dist/schemas/project.schema.d.ts +4 -29
  53. package/dist/schemas/project.schema.js +13 -13
  54. package/dist/schemas/prospect.schema.d.ts +3 -28
  55. package/dist/schemas/prospect.schema.js +9 -9
  56. package/dist/schemas/recruitment.schema.d.ts +5 -30
  57. package/dist/schemas/recruitment.schema.js +36 -36
  58. package/dist/schemas/responsible.schema.d.ts +0 -26
  59. package/dist/schemas/responsible.schema.js +6 -6
  60. package/dist/schemas/sale.schema.d.ts +16 -41
  61. package/dist/schemas/sale.schema.js +43 -51
  62. package/dist/schemas/script.schema.d.ts +6 -31
  63. package/dist/schemas/script.schema.js +21 -30
  64. package/dist/schemas/snapshot.schema.d.ts +3 -28
  65. package/dist/schemas/snapshot.schema.js +6 -6
  66. package/dist/schemas/store-visit.schema.d.ts +2 -27
  67. package/dist/schemas/store-visit.schema.js +21 -17
  68. package/dist/schemas/store.schema.d.ts +3 -28
  69. package/dist/schemas/store.schema.js +8 -8
  70. package/dist/schemas/supplier.schema.d.ts +2 -27
  71. package/dist/schemas/supplier.schema.js +3 -3
  72. package/dist/schemas/tag.schema.d.ts +1 -26
  73. package/dist/schemas/tag.schema.js +5 -5
  74. package/dist/schemas/task.schema.d.ts +9 -34
  75. package/dist/schemas/task.schema.js +67 -67
  76. package/dist/schemas/token.schema.d.ts +1 -26
  77. package/dist/schemas/token.schema.js +3 -3
  78. package/dist/schemas/trigger.schema.d.ts +2 -27
  79. package/dist/schemas/trigger.schema.js +5 -5
  80. package/dist/schemas/user.schema.d.ts +2 -27
  81. package/dist/schemas/user.schema.js +7 -7
  82. package/dist/schemas/webhook.schema.d.ts +1 -26
  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 +23 -13
  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
@@ -17,12 +17,12 @@ const note_schema_1 = require("./note.schema");
17
17
  let Recipient = class Recipient {
18
18
  };
19
19
  __decorate([
20
- (0, swagger_1.ApiProperty)({ example: 'nome da empresa LTDA' }),
20
+ (0, swagger_1.ApiProperty)({ example: "nome da empresa LTDA" }),
21
21
  (0, mongoose_1.Prop)({ required: true }),
22
22
  __metadata("design:type", String)
23
23
  ], Recipient.prototype, "legalName", void 0);
24
24
  __decorate([
25
- (0, swagger_1.ApiProperty)({ example: 'xx.xxx.xxx/xxxx-xx' }),
25
+ (0, swagger_1.ApiProperty)({ example: "xx.xxx.xxx/xxxx-xx" }),
26
26
  (0, mongoose_1.Prop)({ required: true }),
27
27
  __metadata("design:type", String)
28
28
  ], Recipient.prototype, "document", void 0);
@@ -32,32 +32,34 @@ Recipient = __decorate([
32
32
  let Inbox = class Inbox {
33
33
  };
34
34
  __decorate([
35
- (0, swagger_1.ApiProperty)({ example: 'CNPJ da Marca que foi selecionado para o faturamento' }),
35
+ (0, swagger_1.ApiProperty)({ example: "CNPJ da Marca que foi selecionado para o faturamento" }),
36
36
  (0, mongoose_1.Prop)(),
37
37
  __metadata("design:type", String)
38
38
  ], Inbox.prototype, "document", void 0);
39
39
  __decorate([
40
- (0, swagger_1.ApiProperty)({ example: 'Razão Social da Marca que foi selecionado para o faturamento' }),
40
+ (0, swagger_1.ApiProperty)({ example: "Razão Social da Marca que foi selecionado para o faturamento" }),
41
41
  (0, mongoose_1.Prop)(),
42
42
  __metadata("design:type", String)
43
43
  ], Inbox.prototype, "legalName", void 0);
44
44
  __decorate([
45
- (0, swagger_1.ApiProperty)({ example: 'Descrição que deve contar na nota fiscal referente à prestação de serviços' }),
45
+ (0, swagger_1.ApiProperty)({
46
+ example: "Descrição que deve contar na nota fiscal referente à prestação de serviços",
47
+ }),
46
48
  (0, mongoose_1.Prop)(),
47
49
  __metadata("design:type", String)
48
50
  ], Inbox.prototype, "invoiceDescription", void 0);
49
51
  __decorate([
50
- (0, swagger_1.ApiProperty)({ example: 'Descrição que deve contar na nota fiscal referente ao influenciador' }),
52
+ (0, swagger_1.ApiProperty)({ example: "Descrição que deve contar na nota fiscal referente ao influenciador" }),
51
53
  (0, mongoose_1.Prop)(),
52
54
  __metadata("design:type", String)
53
55
  ], Inbox.prototype, "influencerInvoiceDescription", void 0);
54
56
  __decorate([
55
- (0, swagger_1.ApiProperty)({ example: 'financeiro@empresa.com' }),
57
+ (0, swagger_1.ApiProperty)({ example: "financeiro@empresa.com" }),
56
58
  (0, mongoose_1.Prop)(),
57
59
  __metadata("design:type", String)
58
60
  ], Inbox.prototype, "invoiceEmail", void 0);
59
61
  __decorate([
60
- (0, swagger_1.ApiProperty)({ example: 'Emitir até 5 dias úteis após a entrega' }),
62
+ (0, swagger_1.ApiProperty)({ example: "Emitir até 5 dias úteis após a entrega" }),
61
63
  (0, mongoose_1.Prop)(),
62
64
  __metadata("design:type", String)
63
65
  ], Inbox.prototype, "emissionNotes", void 0);
@@ -87,12 +89,12 @@ __decorate([
87
89
  __metadata("design:type", Number)
88
90
  ], Inbox.prototype, "installmentProductionAndOthersValue", void 0);
89
91
  __decorate([
90
- (0, swagger_1.ApiProperty)({ example: '2025-09-10T00:00:00.000Z' }),
92
+ (0, swagger_1.ApiProperty)({ example: "2025-09-10T00:00:00.000Z" }),
91
93
  (0, mongoose_1.Prop)({ required: true }),
92
94
  __metadata("design:type", Date)
93
95
  ], Inbox.prototype, "estimatedIssueDate", void 0);
94
96
  __decorate([
95
- (0, swagger_1.ApiProperty)({ example: '2025-09-25T00:00:00.000Z' }),
97
+ (0, swagger_1.ApiProperty)({ example: "2025-09-25T00:00:00.000Z" }),
96
98
  (0, mongoose_1.Prop)({ required: true }),
97
99
  __metadata("design:type", Date)
98
100
  ], Inbox.prototype, "estimatedDueDate", void 0);
@@ -102,12 +104,12 @@ Inbox = __decorate([
102
104
  let Review = class Review {
103
105
  };
104
106
  __decorate([
105
- (0, swagger_1.ApiProperty)({ example: '2025-09-12T00:00:00.000Z' }),
107
+ (0, swagger_1.ApiProperty)({ example: "2025-09-12T00:00:00.000Z" }),
106
108
  (0, mongoose_1.Prop)({ required: true }),
107
109
  __metadata("design:type", Date)
108
110
  ], Review.prototype, "revisedIssueDate", void 0);
109
111
  __decorate([
110
- (0, swagger_1.ApiProperty)({ example: '2025-09-28T00:00:00.000Z' }),
112
+ (0, swagger_1.ApiProperty)({ example: "2025-09-28T00:00:00.000Z" }),
111
113
  (0, mongoose_1.Prop)({ required: true }),
112
114
  __metadata("design:type", Date)
113
115
  ], Review.prototype, "revisedDueDate", void 0);
@@ -117,17 +119,17 @@ Review = __decorate([
117
119
  let Invoiced = class Invoiced {
118
120
  };
119
121
  __decorate([
120
- (0, swagger_1.ApiProperty)({ example: 'NF123456' }),
122
+ (0, swagger_1.ApiProperty)({ example: "NF123456" }),
121
123
  (0, mongoose_1.Prop)({ required: true }),
122
124
  __metadata("design:type", String)
123
125
  ], Invoiced.prototype, "code", void 0);
124
126
  __decorate([
125
- (0, swagger_1.ApiProperty)({ example: '2025-09-15T00:00:00.000Z' }),
127
+ (0, swagger_1.ApiProperty)({ example: "2025-09-15T00:00:00.000Z" }),
126
128
  (0, mongoose_1.Prop)({ required: true }),
127
129
  __metadata("design:type", Date)
128
130
  ], Invoiced.prototype, "issueDate", void 0);
129
131
  __decorate([
130
- (0, swagger_1.ApiProperty)({ example: '2025-09-30T00:00:00.000Z' }),
132
+ (0, swagger_1.ApiProperty)({ example: "2025-09-30T00:00:00.000Z" }),
131
133
  (0, mongoose_1.Prop)({ required: true }),
132
134
  __metadata("design:type", Date)
133
135
  ], Invoiced.prototype, "dueDate", void 0);
@@ -137,7 +139,7 @@ Invoiced = __decorate([
137
139
  let Received = class Received {
138
140
  };
139
141
  __decorate([
140
- (0, swagger_1.ApiProperty)({ example: '2025-10-05T00:00:00.000Z' }),
142
+ (0, swagger_1.ApiProperty)({ example: "2025-10-05T00:00:00.000Z" }),
141
143
  (0, mongoose_1.Prop)({ required: true }),
142
144
  __metadata("design:type", Date)
143
145
  ], Received.prototype, "date", void 0);
@@ -147,12 +149,12 @@ Received = __decorate([
147
149
  let Canceled = class Canceled {
148
150
  };
149
151
  __decorate([
150
- (0, swagger_1.ApiProperty)({ example: 'Cliente cancelou o contrato' }),
152
+ (0, swagger_1.ApiProperty)({ example: "Cliente cancelou o contrato" }),
151
153
  (0, mongoose_1.Prop)({ required: true }),
152
154
  __metadata("design:type", String)
153
155
  ], Canceled.prototype, "reason", void 0);
154
156
  __decorate([
155
- (0, swagger_1.ApiProperty)({ example: 'Cancelamento solicitado via e-mail em 25/08/2025' }),
157
+ (0, swagger_1.ApiProperty)({ example: "Cancelamento solicitado via e-mail em 25/08/2025" }),
156
158
  (0, mongoose_1.Prop)({ required: true }),
157
159
  __metadata("design:type", String)
158
160
  ], Canceled.prototype, "details", void 0);
@@ -161,13 +163,14 @@ Canceled = __decorate([
161
163
  ], Canceled);
162
164
  let Invoice = class Invoice {
163
165
  };
166
+ exports.Invoice = Invoice;
164
167
  __decorate([
165
- (0, swagger_1.ApiProperty)({ example: '64f1a5c8c7e4d5a6b2e9f123' }),
168
+ (0, swagger_1.ApiProperty)({ example: "64f1a5c8c7e4d5a6b2e9f123" }),
166
169
  (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
167
170
  __metadata("design:type", mongoose_2.Types.ObjectId)
168
171
  ], Invoice.prototype, "_id", void 0);
169
172
  __decorate([
170
- (0, swagger_1.ApiProperty)({ example: 'Fatura Parcela 01/03' }),
173
+ (0, swagger_1.ApiProperty)({ example: "Fatura Parcela 01/03" }),
171
174
  (0, mongoose_1.Prop)({ required: true }),
172
175
  __metadata("design:type", String)
173
176
  ], Invoice.prototype, "title", void 0);
@@ -177,16 +180,19 @@ __decorate([
177
180
  __metadata("design:type", Number)
178
181
  ], Invoice.prototype, "installmentNumber", void 0);
179
182
  __decorate([
180
- (0, swagger_1.ApiProperty)({ example: 'inbox', enum: ['inbox', 'review', 'awaiting', 'invoiced', 'received', 'canceled'] }),
183
+ (0, swagger_1.ApiProperty)({
184
+ example: "inbox",
185
+ enum: ["inbox", "review", "awaiting", "invoiced", "received", "canceled"],
186
+ }),
181
187
  (0, mongoose_1.Prop)({
182
188
  required: true,
183
- enum: ['inbox', 'review', 'awaiting', 'invoiced', 'received', 'canceled'],
189
+ enum: ["inbox", "review", "awaiting", "invoiced", "received", "canceled"],
184
190
  }),
185
191
  __metadata("design:type", String)
186
192
  ], Invoice.prototype, "phase", void 0);
187
193
  __decorate([
188
- (0, swagger_1.ApiProperty)({ example: '64f1a5c8c7e4d5a6b2e9f999' }),
189
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Sale', required: true }),
194
+ (0, swagger_1.ApiProperty)({ example: "64f1a5c8c7e4d5a6b2e9f999" }),
195
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Sale", required: true }),
190
196
  __metadata("design:type", Object)
191
197
  ], Invoice.prototype, "sale", void 0);
192
198
  __decorate([
@@ -219,33 +225,37 @@ __decorate([
219
225
  __metadata("design:type", Canceled)
220
226
  ], Invoice.prototype, "canceled", void 0);
221
227
  __decorate([
222
- (0, swagger_1.ApiProperty)({ type: [note_schema_1.Note], example: [{ text: 'Emitir NF', owner: 'maria.joaquina', createdAt: '2025-08-28T15:00:00.000Z' }] }),
228
+ (0, swagger_1.ApiProperty)({
229
+ type: [note_schema_1.Note],
230
+ example: [
231
+ { text: "Emitir NF", owner: "maria.joaquina", createdAt: "2025-08-28T15:00:00.000Z" },
232
+ ],
233
+ }),
223
234
  (0, mongoose_1.Prop)({ type: [note_schema_1.Note], default: [] }),
224
235
  __metadata("design:type", Array)
225
236
  ], Invoice.prototype, "notes", void 0);
226
237
  __decorate([
227
- (0, swagger_1.ApiProperty)({ example: ['Aguardando Faturamento', 'Janeiro'] }),
238
+ (0, swagger_1.ApiProperty)({ example: ["Aguardando Faturamento", "Janeiro"] }),
228
239
  (0, mongoose_1.Prop)({ type: [{ type: mongoose_2.Schema.Types.ObjectId }], default: [] }),
229
240
  __metadata("design:type", Array)
230
241
  ], Invoice.prototype, "tags", void 0);
231
242
  __decorate([
232
- (0, swagger_1.ApiProperty)({ example: '2025-08-28T15:00:00.000Z' }),
243
+ (0, swagger_1.ApiProperty)({ example: "2025-08-28T15:00:00.000Z" }),
233
244
  (0, mongoose_1.Prop)({ default: Date.now }),
234
245
  __metadata("design:type", Date)
235
246
  ], Invoice.prototype, "createdAt", void 0);
236
247
  __decorate([
237
- (0, swagger_1.ApiProperty)({ example: '2025-08-28T15:00:00.000Z' }),
248
+ (0, swagger_1.ApiProperty)({ example: "2025-08-28T15:00:00.000Z" }),
238
249
  (0, mongoose_1.Prop)({ default: Date.now }),
239
250
  __metadata("design:type", Date)
240
251
  ], Invoice.prototype, "updatedAt", void 0);
241
- Invoice = __decorate([
252
+ exports.Invoice = Invoice = __decorate([
242
253
  (0, mongoose_1.Schema)({ timestamps: true })
243
254
  ], Invoice);
244
- exports.Invoice = Invoice;
245
255
  exports.InvoiceSchema = mongoose_1.SchemaFactory.createForClass(Invoice);
246
256
  exports.InvoiceSchema.index({ organization: 1, phase: 1 });
247
- exports.InvoiceSchema.index({ organization: 1, 'invoiced.issueDate': 1 });
257
+ exports.InvoiceSchema.index({ organization: 1, "invoiced.issueDate": 1 });
248
258
  exports.InvoiceSchema.index({ sale: 1, installmentNumber: 1 });
249
259
  exports.InvoiceSchema.index({ sale: 1, phase: 1 });
250
260
  exports.InvoiceSchema.index({ tags: 1 });
251
- exports.InvoiceModel = (0, mongoose_2.model)('Invoice', exports.InvoiceSchema);
261
+ exports.InvoiceModel = (0, mongoose_2.model)("Invoice", exports.InvoiceSchema);
@@ -1,30 +1,5 @@
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';
1
+ import { HydratedDocument, Schema as MongooseSchema, Types } from "mongoose";
2
+ import { Action } from "./action.schema";
28
3
  export type JobDocument = HydratedDocument<Job>;
29
4
  export declare const JOB_ORIGINS: readonly ["trigger", "approval", "reclassify", "tagger"];
30
5
  export type JobOrigin = (typeof JOB_ORIGINS)[number];
@@ -13,20 +13,20 @@ exports.JobModel = exports.JobSchema = exports.Job = exports.JOB_STATUSES = expo
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
15
  // tagger: import do JSON da Tagger na tela (GD-767).
16
- exports.JOB_ORIGINS = ['trigger', 'approval', 'reclassify', 'tagger'];
16
+ exports.JOB_ORIGINS = ["trigger", "approval", "reclassify", "tagger"];
17
17
  exports.JOB_WORKERS = [
18
18
  // Clique de aprovação (lote): quantos conteúdos o disparo colocou no pipeline.
19
- 'api-campaigns',
20
- 'content-capture-trigger',
21
- 'content-capture',
22
- 'comment-capture',
23
- 'content-classification',
24
- 'metrics-generator',
25
- 'profile-sync',
19
+ "api-campaigns",
20
+ "content-capture-trigger",
21
+ "content-capture",
22
+ "comment-capture",
23
+ "content-classification",
24
+ "metrics-generator",
25
+ "profile-sync",
26
26
  ];
27
27
  // running: trabalho em andamento com checkpoint (ex.: job assíncrono da
28
28
  // exportcomments em criação/polling).
29
- exports.JOB_STATUSES = ['running', 'done', 'skipped', 'error'];
29
+ exports.JOB_STATUSES = ["running", "done", "skipped", "error"];
30
30
  /**
31
31
  * Trilha única do pipeline de captura: cada worker grava uma linha por
32
32
  * unidade de trabalho (action ou content), e todas as linhas da mesma rodada
@@ -38,6 +38,7 @@ exports.JOB_STATUSES = ['running', 'done', 'skipped', 'error'];
38
38
  */
39
39
  let Job = class Job {
40
40
  };
41
+ exports.Job = Job;
41
42
  __decorate([
42
43
  (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
43
44
  __metadata("design:type", mongoose_2.Types.ObjectId)
@@ -59,7 +60,7 @@ __decorate([
59
60
  __metadata("design:type", String)
60
61
  ], Job.prototype, "worker", void 0);
61
62
  __decorate([
62
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Action', required: true }),
63
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Action", required: true }),
63
64
  __metadata("design:type", Object)
64
65
  ], Job.prototype, "actionId", void 0);
65
66
  __decorate([
@@ -106,10 +107,9 @@ __decorate([
106
107
  (0, mongoose_1.Prop)({ default: Date.now, required: false }),
107
108
  __metadata("design:type", Date)
108
109
  ], Job.prototype, "updatedAt", void 0);
109
- Job = __decorate([
110
- (0, mongoose_1.Schema)({ collection: 'jobs', timestamps: true })
110
+ exports.Job = Job = __decorate([
111
+ (0, mongoose_1.Schema)({ collection: "jobs", timestamps: true })
111
112
  ], Job);
112
- exports.Job = Job;
113
113
  exports.JobSchema = mongoose_1.SchemaFactory.createForClass(Job);
114
114
  // Reentrega da mesma mensagem atualiza a mesma linha.
115
115
  exports.JobSchema.index({ runId: 1, requestId: 1, worker: 1, contentId: 1, primetagId: 1 }, { unique: true });
@@ -120,4 +120,4 @@ exports.JobSchema.index({ actionId: 1, worker: 1, origin: 1, startedAt: -1 });
120
120
  exports.JobSchema.index({ createdAt: 1 }, { expireAfterSeconds: 180 * 24 * 60 * 60 });
121
121
  // Raw mais recente de uma publication (linhas do content-capture).
122
122
  exports.JobSchema.index({ actionId: 1, worker: 1, primetagId: 1, startedAt: -1 });
123
- exports.JobModel = (0, mongoose_2.model)('Job', exports.JobSchema);
123
+ exports.JobModel = (0, mongoose_2.model)("Job", exports.JobSchema);
@@ -1,29 +1,4 @@
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, Types } from 'mongoose';
1
+ import { HydratedDocument, Types } from "mongoose";
27
2
  export declare const LEAD_STATUS_VALUES: readonly ["draft", "submitted"];
28
3
  export type LeadStatus = (typeof LEAD_STATUS_VALUES)[number];
29
4
  export declare const LEAD_PRESENTATION_FORMAT_VALUES: readonly ["online", "in_person", "email_only"];
@@ -14,49 +14,53 @@ const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
15
  // Lead = briefing de campanha preenchido pelo cliente numa página pública (GD-616).
16
16
  // O acesso público é sempre pelo accessToken, nunca pelo _id.
17
- exports.LEAD_STATUS_VALUES = ['draft', 'submitted'];
18
- exports.LEAD_PRESENTATION_FORMAT_VALUES = ['online', 'in_person', 'email_only'];
17
+ exports.LEAD_STATUS_VALUES = ["draft", "submitted"];
18
+ exports.LEAD_PRESENTATION_FORMAT_VALUES = ["online", "in_person", "email_only"];
19
19
  exports.LEAD_PAYMENT_TERM_VALUES = [30, 60, 90, 120];
20
- exports.LEAD_BILLING_MODEL_VALUES = [
21
- 'transfer',
22
- 'double_taxation',
23
- 'direct_payment',
24
- ];
20
+ exports.LEAD_BILLING_MODEL_VALUES = ["transfer", "double_taxation", "direct_payment"];
25
21
  exports.LEAD_DELIVERABLE_VALUES = [
26
- 'content_strategy',
27
- 'ppt_presentation',
28
- 'curation_sheet',
29
- 'production_sheet',
22
+ "content_strategy",
23
+ "ppt_presentation",
24
+ "curation_sheet",
25
+ "production_sheet",
30
26
  ];
31
- exports.LEAD_GOAL_VALUES = ['awareness', 'consideration', 'intent'];
32
- exports.LEAD_CHANNEL_VALUES = ['online', 'offline'];
27
+ exports.LEAD_GOAL_VALUES = ["awareness", "consideration", "intent"];
28
+ exports.LEAD_CHANNEL_VALUES = ["online", "offline"];
33
29
  exports.LEAD_RIGHT_VALUES = [
34
- 'influencer_collab',
35
- 'brand_collab',
36
- 'client_boost',
37
- 'influencer_boost',
38
- 'segment_exclusivity',
39
- 'image_rights',
40
- 'dark_post',
41
- 'offline',
30
+ "influencer_collab",
31
+ "brand_collab",
32
+ "client_boost",
33
+ "influencer_boost",
34
+ "segment_exclusivity",
35
+ "image_rights",
36
+ "dark_post",
37
+ "offline",
38
+ ];
39
+ exports.LEAD_FOLLOWER_TIER_VALUES = [
40
+ "heroes",
41
+ "macros",
42
+ "medios",
43
+ "micros",
44
+ "nanos",
45
+ "nda",
42
46
  ];
43
- exports.LEAD_FOLLOWER_TIER_VALUES = ['heroes', 'macros', 'medios', 'micros', 'nanos', 'nda'];
44
47
  exports.LEAD_SECTION_KEYS = [
45
- 'general',
46
- 'confidentiality',
47
- 'budget',
48
- 'competition',
49
- 'deliverables',
50
- 'strategicContext',
51
- 'objectives',
52
- 'deliveryScope',
53
- 'audience',
54
- 'curation',
55
- 'logistics',
56
- 'contentGuidelines',
48
+ "general",
49
+ "confidentiality",
50
+ "budget",
51
+ "competition",
52
+ "deliverables",
53
+ "strategicContext",
54
+ "objectives",
55
+ "deliveryScope",
56
+ "audience",
57
+ "curation",
58
+ "logistics",
59
+ "contentGuidelines",
57
60
  ];
58
61
  let LeadGeneral = class LeadGeneral {
59
62
  };
63
+ exports.LeadGeneral = LeadGeneral;
60
64
  __decorate([
61
65
  (0, mongoose_1.Prop)({ trim: true }),
62
66
  __metadata("design:type", String)
@@ -101,13 +105,13 @@ __decorate([
101
105
  (0, mongoose_1.Prop)({ trim: true, lowercase: true }),
102
106
  __metadata("design:type", String)
103
107
  ], LeadGeneral.prototype, "contactEmail", void 0);
104
- LeadGeneral = __decorate([
108
+ exports.LeadGeneral = LeadGeneral = __decorate([
105
109
  (0, mongoose_1.Schema)({ _id: false })
106
110
  ], LeadGeneral);
107
- exports.LeadGeneral = LeadGeneral;
108
111
  exports.LeadGeneralSchema = mongoose_1.SchemaFactory.createForClass(LeadGeneral);
109
112
  let LeadConfidentiality = class LeadConfidentiality {
110
113
  };
114
+ exports.LeadConfidentiality = LeadConfidentiality;
111
115
  __decorate([
112
116
  (0, mongoose_1.Prop)(),
113
117
  __metadata("design:type", Boolean)
@@ -116,13 +120,13 @@ __decorate([
116
120
  (0, mongoose_1.Prop)(),
117
121
  __metadata("design:type", String)
118
122
  ], LeadConfidentiality.prototype, "restrictionDetails", void 0);
119
- LeadConfidentiality = __decorate([
123
+ exports.LeadConfidentiality = LeadConfidentiality = __decorate([
120
124
  (0, mongoose_1.Schema)({ _id: false })
121
125
  ], LeadConfidentiality);
122
- exports.LeadConfidentiality = LeadConfidentiality;
123
126
  exports.LeadConfidentialitySchema = mongoose_1.SchemaFactory.createForClass(LeadConfidentiality);
124
127
  let LeadBudget = class LeadBudget {
125
128
  };
129
+ exports.LeadBudget = LeadBudget;
126
130
  __decorate([
127
131
  (0, mongoose_1.Prop)(),
128
132
  __metadata("design:type", Number)
@@ -143,13 +147,13 @@ __decorate([
143
147
  (0, mongoose_1.Prop)(),
144
148
  __metadata("design:type", Number)
145
149
  ], LeadBudget.prototype, "campaignDurationMonths", void 0);
146
- LeadBudget = __decorate([
150
+ exports.LeadBudget = LeadBudget = __decorate([
147
151
  (0, mongoose_1.Schema)({ _id: false })
148
152
  ], LeadBudget);
149
- exports.LeadBudget = LeadBudget;
150
153
  exports.LeadBudgetSchema = mongoose_1.SchemaFactory.createForClass(LeadBudget);
151
154
  let LeadCompetition = class LeadCompetition {
152
155
  };
156
+ exports.LeadCompetition = LeadCompetition;
153
157
  __decorate([
154
158
  (0, mongoose_1.Prop)(),
155
159
  __metadata("design:type", Boolean)
@@ -158,24 +162,24 @@ __decorate([
158
162
  (0, mongoose_1.Prop)(),
159
163
  __metadata("design:type", Boolean)
160
164
  ], LeadCompetition.prototype, "involveAreaLeaders", void 0);
161
- LeadCompetition = __decorate([
165
+ exports.LeadCompetition = LeadCompetition = __decorate([
162
166
  (0, mongoose_1.Schema)({ _id: false })
163
167
  ], LeadCompetition);
164
- exports.LeadCompetition = LeadCompetition;
165
168
  exports.LeadCompetitionSchema = mongoose_1.SchemaFactory.createForClass(LeadCompetition);
166
169
  let LeadDeliverables = class LeadDeliverables {
167
170
  };
171
+ exports.LeadDeliverables = LeadDeliverables;
168
172
  __decorate([
169
173
  (0, mongoose_1.Prop)({ type: [String], enum: exports.LEAD_DELIVERABLE_VALUES, default: undefined }),
170
174
  __metadata("design:type", Array)
171
175
  ], LeadDeliverables.prototype, "types", void 0);
172
- LeadDeliverables = __decorate([
176
+ exports.LeadDeliverables = LeadDeliverables = __decorate([
173
177
  (0, mongoose_1.Schema)({ _id: false })
174
178
  ], LeadDeliverables);
175
- exports.LeadDeliverables = LeadDeliverables;
176
179
  exports.LeadDeliverablesSchema = mongoose_1.SchemaFactory.createForClass(LeadDeliverables);
177
180
  let LeadStrategicContext = class LeadStrategicContext {
178
181
  };
182
+ exports.LeadStrategicContext = LeadStrategicContext;
179
183
  __decorate([
180
184
  (0, mongoose_1.Prop)(),
181
185
  __metadata("design:type", String)
@@ -208,13 +212,13 @@ __decorate([
208
212
  (0, mongoose_1.Prop)(),
209
213
  __metadata("design:type", String)
210
214
  ], LeadStrategicContext.prototype, "tone", void 0);
211
- LeadStrategicContext = __decorate([
215
+ exports.LeadStrategicContext = LeadStrategicContext = __decorate([
212
216
  (0, mongoose_1.Schema)({ _id: false })
213
217
  ], LeadStrategicContext);
214
- exports.LeadStrategicContext = LeadStrategicContext;
215
218
  exports.LeadStrategicContextSchema = mongoose_1.SchemaFactory.createForClass(LeadStrategicContext);
216
219
  let LeadObjectives = class LeadObjectives {
217
220
  };
221
+ exports.LeadObjectives = LeadObjectives;
218
222
  __decorate([
219
223
  (0, mongoose_1.Prop)({ type: [String], enum: exports.LEAD_GOAL_VALUES, default: undefined }),
220
224
  __metadata("design:type", Array)
@@ -223,13 +227,13 @@ __decorate([
223
227
  (0, mongoose_1.Prop)({ type: String, enum: exports.LEAD_GOAL_VALUES }),
224
228
  __metadata("design:type", String)
225
229
  ], LeadObjectives.prototype, "primaryGoal", void 0);
226
- LeadObjectives = __decorate([
230
+ exports.LeadObjectives = LeadObjectives = __decorate([
227
231
  (0, mongoose_1.Schema)({ _id: false })
228
232
  ], LeadObjectives);
229
- exports.LeadObjectives = LeadObjectives;
230
233
  exports.LeadObjectivesSchema = mongoose_1.SchemaFactory.createForClass(LeadObjectives);
231
234
  let LeadDeliveryScope = class LeadDeliveryScope {
232
235
  };
236
+ exports.LeadDeliveryScope = LeadDeliveryScope;
233
237
  __decorate([
234
238
  (0, mongoose_1.Prop)({ type: [String], enum: exports.LEAD_CHANNEL_VALUES, default: undefined }),
235
239
  __metadata("design:type", Array)
@@ -258,13 +262,13 @@ __decorate([
258
262
  (0, mongoose_1.Prop)(),
259
263
  __metadata("design:type", String)
260
264
  ], LeadDeliveryScope.prototype, "offlineFormats", void 0);
261
- LeadDeliveryScope = __decorate([
265
+ exports.LeadDeliveryScope = LeadDeliveryScope = __decorate([
262
266
  (0, mongoose_1.Schema)({ _id: false })
263
267
  ], LeadDeliveryScope);
264
- exports.LeadDeliveryScope = LeadDeliveryScope;
265
268
  exports.LeadDeliveryScopeSchema = mongoose_1.SchemaFactory.createForClass(LeadDeliveryScope);
266
269
  let LeadAudience = class LeadAudience {
267
270
  };
271
+ exports.LeadAudience = LeadAudience;
268
272
  __decorate([
269
273
  (0, mongoose_1.Prop)(),
270
274
  __metadata("design:type", String)
@@ -281,13 +285,13 @@ __decorate([
281
285
  (0, mongoose_1.Prop)(),
282
286
  __metadata("design:type", String)
283
287
  ], LeadAudience.prototype, "attitudinalProfile", void 0);
284
- LeadAudience = __decorate([
288
+ exports.LeadAudience = LeadAudience = __decorate([
285
289
  (0, mongoose_1.Schema)({ _id: false })
286
290
  ], LeadAudience);
287
- exports.LeadAudience = LeadAudience;
288
291
  exports.LeadAudienceSchema = mongoose_1.SchemaFactory.createForClass(LeadAudience);
289
292
  let LeadCuration = class LeadCuration {
290
293
  };
294
+ exports.LeadCuration = LeadCuration;
291
295
  __decorate([
292
296
  (0, mongoose_1.Prop)(),
293
297
  __metadata("design:type", String)
@@ -324,13 +328,13 @@ __decorate([
324
328
  (0, mongoose_1.Prop)(),
325
329
  __metadata("design:type", String)
326
330
  ], LeadCuration.prototype, "requirements", void 0);
327
- LeadCuration = __decorate([
331
+ exports.LeadCuration = LeadCuration = __decorate([
328
332
  (0, mongoose_1.Schema)({ _id: false })
329
333
  ], LeadCuration);
330
- exports.LeadCuration = LeadCuration;
331
334
  exports.LeadCurationSchema = mongoose_1.SchemaFactory.createForClass(LeadCuration);
332
335
  let LeadLogistics = class LeadLogistics {
333
336
  };
337
+ exports.LeadLogistics = LeadLogistics;
334
338
  __decorate([
335
339
  (0, mongoose_1.Prop)(),
336
340
  __metadata("design:type", String)
@@ -343,13 +347,13 @@ __decorate([
343
347
  (0, mongoose_1.Prop)(),
344
348
  __metadata("design:type", String)
345
349
  ], LeadLogistics.prototype, "otherLogistics", void 0);
346
- LeadLogistics = __decorate([
350
+ exports.LeadLogistics = LeadLogistics = __decorate([
347
351
  (0, mongoose_1.Schema)({ _id: false })
348
352
  ], LeadLogistics);
349
- exports.LeadLogistics = LeadLogistics;
350
353
  exports.LeadLogisticsSchema = mongoose_1.SchemaFactory.createForClass(LeadLogistics);
351
354
  let LeadContentGuidelines = class LeadContentGuidelines {
352
355
  };
356
+ exports.LeadContentGuidelines = LeadContentGuidelines;
353
357
  __decorate([
354
358
  (0, mongoose_1.Prop)(),
355
359
  __metadata("design:type", String)
@@ -382,23 +386,23 @@ __decorate([
382
386
  (0, mongoose_1.Prop)(),
383
387
  __metadata("design:type", String)
384
388
  ], LeadContentGuidelines.prototype, "additionalDirections", void 0);
385
- LeadContentGuidelines = __decorate([
389
+ exports.LeadContentGuidelines = LeadContentGuidelines = __decorate([
386
390
  (0, mongoose_1.Schema)({ _id: false })
387
391
  ], LeadContentGuidelines);
388
- exports.LeadContentGuidelines = LeadContentGuidelines;
389
392
  exports.LeadContentGuidelinesSchema = mongoose_1.SchemaFactory.createForClass(LeadContentGuidelines);
390
393
  let Lead = class Lead {
391
394
  };
395
+ exports.Lead = Lead;
392
396
  __decorate([
393
397
  (0, mongoose_1.Prop)({ required: true, unique: true, select: false }),
394
398
  __metadata("design:type", String)
395
399
  ], Lead.prototype, "accessToken", void 0);
396
400
  __decorate([
397
- (0, mongoose_1.Prop)({ type: String, enum: exports.LEAD_STATUS_VALUES, default: 'draft', index: true }),
401
+ (0, mongoose_1.Prop)({ type: String, enum: exports.LEAD_STATUS_VALUES, default: "draft", index: true }),
398
402
  __metadata("design:type", String)
399
403
  ], Lead.prototype, "status", void 0);
400
404
  __decorate([
401
- (0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: 'Organization', required: true }),
405
+ (0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: "Organization", required: true }),
402
406
  __metadata("design:type", mongoose_2.Types.ObjectId)
403
407
  ], Lead.prototype, "organization", void 0);
404
408
  __decorate([
@@ -461,9 +465,8 @@ __decorate([
461
465
  (0, mongoose_1.Prop)({ type: exports.LeadContentGuidelinesSchema, default: {} }),
462
466
  __metadata("design:type", LeadContentGuidelines)
463
467
  ], Lead.prototype, "contentGuidelines", void 0);
464
- Lead = __decorate([
465
- (0, mongoose_1.Schema)({ timestamps: true, collection: 'leads' })
468
+ exports.Lead = Lead = __decorate([
469
+ (0, mongoose_1.Schema)({ timestamps: true, collection: "leads" })
466
470
  ], Lead);
467
- exports.Lead = Lead;
468
471
  exports.LeadSchema = mongoose_1.SchemaFactory.createForClass(Lead);
469
- exports.LeadModel = (0, mongoose_2.model)('Lead', exports.LeadSchema);
472
+ exports.LeadModel = (0, mongoose_2.model)("Lead", exports.LeadSchema);