@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.
- package/dist/index.d.ts +42 -42
- package/dist/schemas/action.schema.d.ts +9 -34
- package/dist/schemas/action.schema.js +81 -64
- package/dist/schemas/assignment.schema.d.ts +3 -28
- package/dist/schemas/assignment.schema.js +44 -44
- package/dist/schemas/benchmark.schema.d.ts +3 -28
- package/dist/schemas/benchmark.schema.js +11 -6
- package/dist/schemas/campaign.schema.d.ts +2 -27
- package/dist/schemas/campaign.schema.js +4 -4
- package/dist/schemas/client.schema.d.ts +18 -79
- package/dist/schemas/client.schema.js +73 -71
- package/dist/schemas/comment.schema.d.ts +5 -30
- package/dist/schemas/comment.schema.js +42 -37
- package/dist/schemas/commission.schema.d.ts +5 -30
- package/dist/schemas/commission.schema.js +10 -10
- package/dist/schemas/content-capture-process.schema.d.ts +6 -31
- package/dist/schemas/content-capture-process.schema.js +24 -17
- package/dist/schemas/content-draft.schema.d.ts +2 -27
- package/dist/schemas/content-draft.schema.js +5 -5
- package/dist/schemas/content.schema.d.ts +6 -31
- package/dist/schemas/content.schema.js +84 -74
- package/dist/schemas/contract.schema.d.ts +3 -28
- package/dist/schemas/contract.schema.js +5 -5
- package/dist/schemas/creative.schema.d.ts +6 -31
- package/dist/schemas/creative.schema.js +22 -31
- package/dist/schemas/export-comments-job.schema.d.ts +2 -27
- package/dist/schemas/export-comments-job.schema.js +6 -6
- package/dist/schemas/group.schema.d.ts +1 -26
- package/dist/schemas/group.schema.js +5 -5
- package/dist/schemas/influencer.schema.d.ts +6 -31
- package/dist/schemas/influencer.schema.js +16 -18
- package/dist/schemas/invoice.schema.d.ts +4 -29
- package/dist/schemas/invoice.schema.js +42 -32
- package/dist/schemas/job.schema.d.ts +2 -27
- package/dist/schemas/job.schema.js +14 -14
- package/dist/schemas/lead.schema.d.ts +1 -26
- package/dist/schemas/lead.schema.js +67 -64
- package/dist/schemas/log.schema.d.ts +1 -26
- package/dist/schemas/log.schema.js +24 -24
- package/dist/schemas/note.schema.d.ts +1 -26
- package/dist/schemas/note.schema.js +9 -9
- package/dist/schemas/notifications.schema.d.ts +1 -26
- package/dist/schemas/notifications.schema.js +8 -8
- package/dist/schemas/organization.schema.d.ts +1 -26
- package/dist/schemas/organization.schema.js +4 -4
- package/dist/schemas/party.schema.d.ts +1 -26
- package/dist/schemas/party.schema.js +11 -11
- package/dist/schemas/payment.schema.d.ts +10 -35
- package/dist/schemas/payment.schema.js +63 -54
- package/dist/schemas/profile.schema.d.ts +3 -28
- package/dist/schemas/profile.schema.js +6 -6
- package/dist/schemas/project.schema.d.ts +4 -29
- package/dist/schemas/project.schema.js +13 -13
- package/dist/schemas/prospect.schema.d.ts +3 -28
- package/dist/schemas/prospect.schema.js +9 -9
- package/dist/schemas/recruitment.schema.d.ts +5 -30
- package/dist/schemas/recruitment.schema.js +36 -36
- package/dist/schemas/responsible.schema.d.ts +0 -26
- package/dist/schemas/responsible.schema.js +6 -6
- package/dist/schemas/sale.schema.d.ts +16 -41
- package/dist/schemas/sale.schema.js +43 -51
- package/dist/schemas/script.schema.d.ts +6 -31
- package/dist/schemas/script.schema.js +21 -30
- package/dist/schemas/snapshot.schema.d.ts +3 -28
- package/dist/schemas/snapshot.schema.js +6 -6
- package/dist/schemas/store-visit.schema.d.ts +2 -27
- package/dist/schemas/store-visit.schema.js +21 -17
- package/dist/schemas/store.schema.d.ts +3 -28
- package/dist/schemas/store.schema.js +8 -8
- package/dist/schemas/supplier.schema.d.ts +2 -27
- package/dist/schemas/supplier.schema.js +3 -3
- package/dist/schemas/tag.schema.d.ts +1 -26
- package/dist/schemas/tag.schema.js +5 -5
- package/dist/schemas/task.schema.d.ts +9 -34
- package/dist/schemas/task.schema.js +67 -67
- package/dist/schemas/token.schema.d.ts +1 -26
- package/dist/schemas/token.schema.js +3 -3
- package/dist/schemas/trigger.schema.d.ts +2 -27
- package/dist/schemas/trigger.schema.js +5 -5
- package/dist/schemas/user.schema.d.ts +2 -27
- package/dist/schemas/user.schema.js +7 -7
- package/dist/schemas/webhook.schema.d.ts +1 -26
- package/dist/schemas/webhook.schema.js +10 -10
- package/dist/utils/merge-metrics-breakdown.util.d.ts +1 -1
- package/dist/utils/merge-metrics-breakdown.util.js +7 -2
- package/dist/utils/normalize-content-link.util.js +7 -7
- package/package.json +23 -13
- package/.eslintrc.json +0 -28
- package/.prettierrc +0 -4
- package/dist/schemas/profile-followers-snapshot.schema.d.ts +0 -67
- package/dist/schemas/profile-followers-snapshot.schema.js +0 -65
- package/dist/schemas/schedule.schema.d.ts +0 -73
- package/dist/schemas/schedule.schema.js +0 -116
- package/dist/utils/cost-per-impact.util.d.ts +0 -37
- package/dist/utils/cost-per-impact.util.js +0 -72
- package/dist/utils/influencer-contract.util.d.ts +0 -32
- package/dist/utils/influencer-contract.util.js +0 -77
- package/docs/code-review.md +0 -27
- package/docs/constitution.md +0 -75
- package/docs/specs/GD-692.md +0 -112
- package/docs/specs/GD-761.md +0 -94
- package/index.d.ts +0 -3
- package/src/index.ts +0 -42
- package/src/schemas/action.schema.ts +0 -328
- package/src/schemas/assignment.schema.ts +0 -154
- package/src/schemas/benchmark.schema.ts +0 -39
- package/src/schemas/campaign.schema.ts +0 -38
- package/src/schemas/client.schema.ts +0 -319
- package/src/schemas/comment.schema.ts +0 -216
- package/src/schemas/commission.schema.ts +0 -108
- package/src/schemas/content-capture-process.schema.ts +0 -195
- package/src/schemas/content-draft.schema.ts +0 -49
- package/src/schemas/content.schema.ts +0 -688
- package/src/schemas/contract.schema.ts +0 -44
- package/src/schemas/creative.schema.ts +0 -256
- package/src/schemas/export-comments-job.schema.ts +0 -59
- package/src/schemas/group.schema.ts +0 -23
- package/src/schemas/influencer.schema.ts +0 -184
- package/src/schemas/invoice.schema.ts +0 -164
- package/src/schemas/job.schema.ts +0 -111
- package/src/schemas/lead.schema.ts +0 -372
- package/src/schemas/log.schema.ts +0 -91
- package/src/schemas/note.schema.ts +0 -34
- package/src/schemas/notifications.schema.ts +0 -61
- package/src/schemas/organization.schema.ts +0 -29
- package/src/schemas/party.schema.ts +0 -65
- package/src/schemas/payment.schema.ts +0 -275
- package/src/schemas/profile.schema.ts +0 -77
- package/src/schemas/project.schema.ts +0 -116
- package/src/schemas/prospect.schema.ts +0 -62
- package/src/schemas/recruitment.schema.ts +0 -277
- package/src/schemas/responsible.schema.ts +0 -27
- package/src/schemas/sale.schema.ts +0 -297
- package/src/schemas/script.schema.ts +0 -235
- package/src/schemas/snapshot.schema.ts +0 -55
- package/src/schemas/store-visit.schema.ts +0 -68
- package/src/schemas/store.schema.ts +0 -52
- package/src/schemas/supplier.schema.ts +0 -12
- package/src/schemas/tag.schema.ts +0 -26
- package/src/schemas/task.schema.ts +0 -205
- package/src/schemas/token.schema.ts +0 -42
- package/src/schemas/trigger.schema.ts +0 -48
- package/src/schemas/user.schema.ts +0 -59
- package/src/schemas/webhook.schema.ts +0 -81
- package/src/utils/merge-metrics-breakdown.util.ts +0 -51
- package/src/utils/normalize-content-link.util.ts +0 -31
- package/tsconfig.build.json +0 -5
- package/tsconfig.json +0 -29
|
@@ -17,20 +17,12 @@ const action_schema_1 = require("./action.schema");
|
|
|
17
17
|
const client_schema_1 = require("./client.schema");
|
|
18
18
|
const profile_schema_1 = require("./profile.schema");
|
|
19
19
|
const task_schema_1 = require("./task.schema");
|
|
20
|
-
exports.CREATIVE_STATUS_VALUES = [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'approved',
|
|
24
|
-
'reproved',
|
|
25
|
-
];
|
|
26
|
-
exports.CREATIVE_DECISION_VALUES = [
|
|
27
|
-
'approved',
|
|
28
|
-
'reproved',
|
|
29
|
-
'questioned',
|
|
30
|
-
];
|
|
31
|
-
exports.CREATIVE_MEDIA_TYPE_VALUES = ['image', 'video'];
|
|
20
|
+
exports.CREATIVE_STATUS_VALUES = ["draft", "pending", "approved", "reproved"];
|
|
21
|
+
exports.CREATIVE_DECISION_VALUES = ["approved", "reproved", "questioned"];
|
|
22
|
+
exports.CREATIVE_MEDIA_TYPE_VALUES = ["image", "video"];
|
|
32
23
|
let CreativeDecision = class CreativeDecision {
|
|
33
24
|
};
|
|
25
|
+
exports.CreativeDecision = CreativeDecision;
|
|
34
26
|
__decorate([
|
|
35
27
|
(0, swagger_1.ApiProperty)({ enum: exports.CREATIVE_DECISION_VALUES }),
|
|
36
28
|
(0, mongoose_1.Prop)({ type: String, enum: exports.CREATIVE_DECISION_VALUES, required: true }),
|
|
@@ -42,7 +34,7 @@ __decorate([
|
|
|
42
34
|
__metadata("design:type", String)
|
|
43
35
|
], CreativeDecision.prototype, "comment", void 0);
|
|
44
36
|
__decorate([
|
|
45
|
-
(0, swagger_1.ApiProperty)({ description:
|
|
37
|
+
(0, swagger_1.ApiProperty)({ description: "Time do cliente que respondeu, lido do JWT" }),
|
|
46
38
|
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
47
39
|
__metadata("design:type", String)
|
|
48
40
|
], CreativeDecision.prototype, "team", void 0);
|
|
@@ -56,13 +48,13 @@ __decorate([
|
|
|
56
48
|
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
57
49
|
__metadata("design:type", Date)
|
|
58
50
|
], CreativeDecision.prototype, "respondedAt", void 0);
|
|
59
|
-
CreativeDecision = __decorate([
|
|
51
|
+
exports.CreativeDecision = CreativeDecision = __decorate([
|
|
60
52
|
(0, mongoose_1.Schema)({ _id: false })
|
|
61
53
|
], CreativeDecision);
|
|
62
|
-
exports.CreativeDecision = CreativeDecision;
|
|
63
54
|
exports.CreativeDecisionSchema = mongoose_1.SchemaFactory.createForClass(CreativeDecision);
|
|
64
55
|
let CreativeStaffReply = class CreativeStaffReply {
|
|
65
56
|
};
|
|
57
|
+
exports.CreativeStaffReply = CreativeStaffReply;
|
|
66
58
|
__decorate([
|
|
67
59
|
(0, swagger_1.ApiProperty)(),
|
|
68
60
|
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
@@ -78,13 +70,13 @@ __decorate([
|
|
|
78
70
|
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
79
71
|
__metadata("design:type", Date)
|
|
80
72
|
], CreativeStaffReply.prototype, "repliedAt", void 0);
|
|
81
|
-
CreativeStaffReply = __decorate([
|
|
73
|
+
exports.CreativeStaffReply = CreativeStaffReply = __decorate([
|
|
82
74
|
(0, mongoose_1.Schema)({ _id: false })
|
|
83
75
|
], CreativeStaffReply);
|
|
84
|
-
exports.CreativeStaffReply = CreativeStaffReply;
|
|
85
76
|
exports.CreativeStaffReplySchema = mongoose_1.SchemaFactory.createForClass(CreativeStaffReply);
|
|
86
77
|
let CreativeVersion = class CreativeVersion {
|
|
87
78
|
};
|
|
79
|
+
exports.CreativeVersion = CreativeVersion;
|
|
88
80
|
__decorate([
|
|
89
81
|
(0, swagger_1.ApiProperty)(),
|
|
90
82
|
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
@@ -116,8 +108,8 @@ __decorate([
|
|
|
116
108
|
__metadata("design:type", Object)
|
|
117
109
|
], CreativeVersion.prototype, "caption", void 0);
|
|
118
110
|
__decorate([
|
|
119
|
-
(0, swagger_1.ApiProperty)({ enum: [
|
|
120
|
-
(0, mongoose_1.Prop)({ type: String, enum: [
|
|
111
|
+
(0, swagger_1.ApiProperty)({ enum: ["approved", "reproved"] }),
|
|
112
|
+
(0, mongoose_1.Prop)({ type: String, enum: ["approved", "reproved"], required: true }),
|
|
121
113
|
__metadata("design:type", String)
|
|
122
114
|
], CreativeVersion.prototype, "status", void 0);
|
|
123
115
|
__decorate([
|
|
@@ -145,10 +137,9 @@ __decorate([
|
|
|
145
137
|
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
146
138
|
__metadata("design:type", Date)
|
|
147
139
|
], CreativeVersion.prototype, "archivedAt", void 0);
|
|
148
|
-
CreativeVersion = __decorate([
|
|
140
|
+
exports.CreativeVersion = CreativeVersion = __decorate([
|
|
149
141
|
(0, mongoose_1.Schema)({ _id: false })
|
|
150
142
|
], CreativeVersion);
|
|
151
|
-
exports.CreativeVersion = CreativeVersion;
|
|
152
143
|
exports.CreativeVersionSchema = mongoose_1.SchemaFactory.createForClass(CreativeVersion);
|
|
153
144
|
/**
|
|
154
145
|
* Aprovação de conteúdo (prévia final): um documento por (action, profile,
|
|
@@ -159,6 +150,7 @@ exports.CreativeVersionSchema = mongoose_1.SchemaFactory.createForClass(Creative
|
|
|
159
150
|
*/
|
|
160
151
|
let Creative = class Creative {
|
|
161
152
|
};
|
|
153
|
+
exports.Creative = Creative;
|
|
162
154
|
__decorate([
|
|
163
155
|
(0, swagger_1.ApiProperty)(),
|
|
164
156
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
|
|
@@ -166,23 +158,23 @@ __decorate([
|
|
|
166
158
|
], Creative.prototype, "_id", void 0);
|
|
167
159
|
__decorate([
|
|
168
160
|
(0, swagger_1.ApiProperty)({ type: () => action_schema_1.Action }),
|
|
169
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref:
|
|
161
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Action", required: true }),
|
|
170
162
|
__metadata("design:type", Object)
|
|
171
163
|
], Creative.prototype, "action", void 0);
|
|
172
164
|
__decorate([
|
|
173
165
|
(0, swagger_1.ApiProperty)({ type: () => client_schema_1.Client }),
|
|
174
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref:
|
|
166
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Client", required: false }),
|
|
175
167
|
__metadata("design:type", Object)
|
|
176
168
|
], Creative.prototype, "client", void 0);
|
|
177
169
|
__decorate([
|
|
178
170
|
(0, swagger_1.ApiProperty)({ type: () => profile_schema_1.Profile }),
|
|
179
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref:
|
|
171
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Profile", required: true }),
|
|
180
172
|
__metadata("design:type", Object)
|
|
181
173
|
], Creative.prototype, "profile", void 0);
|
|
182
174
|
__decorate([
|
|
183
175
|
(0, swagger_1.ApiProperty)({
|
|
184
176
|
enum: task_schema_1.TASK_FORMAT_VALUES,
|
|
185
|
-
description:
|
|
177
|
+
description: "Unidade de entrega do escopo (mesmos valores de recruitment.scope.delivery)",
|
|
186
178
|
}),
|
|
187
179
|
(0, mongoose_1.Prop)({ type: String, enum: task_schema_1.TASK_FORMAT_VALUES, required: true }),
|
|
188
180
|
__metadata("design:type", String)
|
|
@@ -220,7 +212,7 @@ __decorate([
|
|
|
220
212
|
__metadata("design:type", Object)
|
|
221
213
|
], Creative.prototype, "mediaType", void 0);
|
|
222
214
|
__decorate([
|
|
223
|
-
(0, swagger_1.ApiProperty)({ required: false, description:
|
|
215
|
+
(0, swagger_1.ApiProperty)({ required: false, description: "Legenda, campo separado do arquivo" }),
|
|
224
216
|
(0, mongoose_1.Prop)({ type: String, required: false, default: null }),
|
|
225
217
|
__metadata("design:type", Object)
|
|
226
218
|
], Creative.prototype, "caption", void 0);
|
|
@@ -230,14 +222,14 @@ __decorate([
|
|
|
230
222
|
type: String,
|
|
231
223
|
enum: exports.CREATIVE_STATUS_VALUES,
|
|
232
224
|
required: true,
|
|
233
|
-
default:
|
|
225
|
+
default: "draft",
|
|
234
226
|
}),
|
|
235
227
|
__metadata("design:type", String)
|
|
236
228
|
], Creative.prototype, "status", void 0);
|
|
237
229
|
__decorate([
|
|
238
230
|
(0, swagger_1.ApiProperty)({
|
|
239
231
|
type: [String],
|
|
240
|
-
description:
|
|
232
|
+
description: "Snapshot de Client.requiredTeams no momento da criação — vazio = 1 aprovação resolve; com times = todos precisam aprovar",
|
|
241
233
|
}),
|
|
242
234
|
(0, mongoose_1.Prop)({ type: [String], required: false, default: [] }),
|
|
243
235
|
__metadata("design:type", Array)
|
|
@@ -281,13 +273,12 @@ __decorate([
|
|
|
281
273
|
(0, mongoose_1.Prop)({ default: Date.now, required: false }),
|
|
282
274
|
__metadata("design:type", Date)
|
|
283
275
|
], Creative.prototype, "updatedAt", void 0);
|
|
284
|
-
Creative = __decorate([
|
|
276
|
+
exports.Creative = Creative = __decorate([
|
|
285
277
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
286
278
|
], Creative);
|
|
287
|
-
exports.Creative = Creative;
|
|
288
279
|
exports.CreativeSchema = mongoose_1.SchemaFactory.createForClass(Creative);
|
|
289
280
|
exports.CreativeSchema.index({ action: 1, profile: 1, deliverableType: 1, deliverableIndex: 1 }, { unique: true });
|
|
290
281
|
exports.CreativeSchema.index({ action: 1, status: 1 });
|
|
291
282
|
exports.CreativeSchema.index({ client: 1, status: 1 });
|
|
292
283
|
exports.CreativeSchema.index({ organization: 1, status: 1 });
|
|
293
|
-
exports.CreativeModel = (0, mongoose_2.model)(
|
|
284
|
+
exports.CreativeModel = (0, mongoose_2.model)("Creative", exports.CreativeSchema);
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
|
|
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';
|
|
1
|
+
import { HydratedDocument, Schema as MongooseSchema, Types } from "mongoose";
|
|
27
2
|
export type ExportCommentsJobDocument = HydratedDocument<ExportCommentsJob>;
|
|
28
3
|
/**
|
|
29
4
|
* Checkpoint de idempotência para o job assíncrono de captura de comentários
|
|
@@ -40,7 +15,7 @@ export declare class ExportCommentsJob {
|
|
|
40
15
|
guid?: string;
|
|
41
16
|
jsonUrl?: string;
|
|
42
17
|
raw?: unknown[];
|
|
43
|
-
status:
|
|
18
|
+
status: "creating" | "polling" | "done" | "error" | "timeout";
|
|
44
19
|
error?: string;
|
|
45
20
|
createdAt?: Date;
|
|
46
21
|
updatedAt?: Date;
|
|
@@ -23,6 +23,7 @@ const mongoose_2 = require("mongoose");
|
|
|
23
23
|
*/
|
|
24
24
|
let ExportCommentsJob = class ExportCommentsJob {
|
|
25
25
|
};
|
|
26
|
+
exports.ExportCommentsJob = ExportCommentsJob;
|
|
26
27
|
__decorate([
|
|
27
28
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
|
|
28
29
|
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
@@ -46,9 +47,9 @@ __decorate([
|
|
|
46
47
|
__decorate([
|
|
47
48
|
(0, mongoose_1.Prop)({
|
|
48
49
|
type: String,
|
|
49
|
-
enum: [
|
|
50
|
+
enum: ["creating", "polling", "done", "error", "timeout"],
|
|
50
51
|
required: true,
|
|
51
|
-
default:
|
|
52
|
+
default: "creating",
|
|
52
53
|
}),
|
|
53
54
|
__metadata("design:type", String)
|
|
54
55
|
], ExportCommentsJob.prototype, "status", void 0);
|
|
@@ -64,10 +65,9 @@ __decorate([
|
|
|
64
65
|
(0, mongoose_1.Prop)({ default: Date.now, required: false }),
|
|
65
66
|
__metadata("design:type", Date)
|
|
66
67
|
], ExportCommentsJob.prototype, "updatedAt", void 0);
|
|
67
|
-
ExportCommentsJob = __decorate([
|
|
68
|
-
(0, mongoose_1.Schema)({ collection:
|
|
68
|
+
exports.ExportCommentsJob = ExportCommentsJob = __decorate([
|
|
69
|
+
(0, mongoose_1.Schema)({ collection: "export-comments-jobs", timestamps: true })
|
|
69
70
|
], ExportCommentsJob);
|
|
70
|
-
exports.ExportCommentsJob = ExportCommentsJob;
|
|
71
71
|
exports.ExportCommentsJobSchema = mongoose_1.SchemaFactory.createForClass(ExportCommentsJob);
|
|
72
72
|
exports.ExportCommentsJobSchema.index({ contentId: 1 }, { unique: true });
|
|
73
|
-
exports.ExportCommentsJobModel = (0, mongoose_2.model)(
|
|
73
|
+
exports.ExportCommentsJobModel = (0, mongoose_2.model)("ExportCommentsJob", exports.ExportCommentsJobSchema);
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
|
|
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 type GroupDocument = HydratedDocument<Group>;
|
|
28
3
|
export declare class Group {
|
|
29
4
|
organization: Types.ObjectId;
|
|
@@ -14,8 +14,9 @@ const mongoose_1 = require("@nestjs/mongoose");
|
|
|
14
14
|
const mongoose_2 = require("mongoose");
|
|
15
15
|
let Group = class Group {
|
|
16
16
|
};
|
|
17
|
+
exports.Group = Group;
|
|
17
18
|
__decorate([
|
|
18
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref:
|
|
19
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: "Organization", required: true, index: true }),
|
|
19
20
|
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
20
21
|
], Group.prototype, "organization", void 0);
|
|
21
22
|
__decorate([
|
|
@@ -23,12 +24,11 @@ __decorate([
|
|
|
23
24
|
__metadata("design:type", String)
|
|
24
25
|
], Group.prototype, "name", void 0);
|
|
25
26
|
__decorate([
|
|
26
|
-
(0, mongoose_1.Prop)({ type: [mongoose_2.Types.ObjectId], ref:
|
|
27
|
+
(0, mongoose_1.Prop)({ type: [mongoose_2.Types.ObjectId], ref: "User", default: [] }),
|
|
27
28
|
__metadata("design:type", Array)
|
|
28
29
|
], Group.prototype, "memberIds", void 0);
|
|
29
|
-
Group = __decorate([
|
|
30
|
-
(0, mongoose_1.Schema)({ timestamps: true, collection:
|
|
30
|
+
exports.Group = Group = __decorate([
|
|
31
|
+
(0, mongoose_1.Schema)({ timestamps: true, collection: "group" })
|
|
31
32
|
], Group);
|
|
32
|
-
exports.Group = Group;
|
|
33
33
|
exports.GroupSchema = mongoose_1.SchemaFactory.createForClass(Group);
|
|
34
34
|
exports.GroupSchema.index({ organization: 1, name: 1 }, { unique: true });
|
|
@@ -1,33 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 { Party } from './party.schema';
|
|
29
|
-
import { Client } from './client.schema';
|
|
30
|
-
import { Delivery } from './recruitment.schema';
|
|
1
|
+
import { HydratedDocument, Schema as MongooseSchema, Types } from "mongoose";
|
|
2
|
+
import { Profile } from "./profile.schema";
|
|
3
|
+
import { Party } from "./party.schema";
|
|
4
|
+
import { Client } from "./client.schema";
|
|
5
|
+
import { Delivery } from "./recruitment.schema";
|
|
31
6
|
export type InfluencerDocument = HydratedDocument<Influencer>;
|
|
32
7
|
export declare class Advisor {
|
|
33
8
|
email: string;
|
|
@@ -101,7 +76,7 @@ export declare class InfluencerContract {
|
|
|
101
76
|
* Rateio do custo: monthly = valor mensal (total ÷ meses) por mês-calendário;
|
|
102
77
|
* annual = valor total no período.
|
|
103
78
|
*/
|
|
104
|
-
periodType:
|
|
79
|
+
periodType: "monthly" | "annual";
|
|
105
80
|
startDate: Date;
|
|
106
81
|
endDate?: Date;
|
|
107
82
|
deliveryScope?: Delivery;
|
|
@@ -16,6 +16,7 @@ const party_schema_1 = require("./party.schema");
|
|
|
16
16
|
const recruitment_schema_1 = require("./recruitment.schema");
|
|
17
17
|
let Advisor = class Advisor {
|
|
18
18
|
};
|
|
19
|
+
exports.Advisor = Advisor;
|
|
19
20
|
__decorate([
|
|
20
21
|
(0, mongoose_1.Prop)(),
|
|
21
22
|
__metadata("design:type", String)
|
|
@@ -48,13 +49,13 @@ __decorate([
|
|
|
48
49
|
(0, mongoose_1.Prop)(),
|
|
49
50
|
__metadata("design:type", String)
|
|
50
51
|
], Advisor.prototype, "digit", void 0);
|
|
51
|
-
Advisor = __decorate([
|
|
52
|
+
exports.Advisor = Advisor = __decorate([
|
|
52
53
|
(0, mongoose_1.Schema)({ _id: false })
|
|
53
54
|
], Advisor);
|
|
54
|
-
exports.Advisor = Advisor;
|
|
55
55
|
exports.AdvisorSchema = mongoose_1.SchemaFactory.createForClass(Advisor);
|
|
56
56
|
let Note = class Note {
|
|
57
57
|
};
|
|
58
|
+
exports.Note = Note;
|
|
58
59
|
__decorate([
|
|
59
60
|
(0, mongoose_1.Prop)(),
|
|
60
61
|
__metadata("design:type", String)
|
|
@@ -67,13 +68,12 @@ __decorate([
|
|
|
67
68
|
(0, mongoose_1.Prop)({ type: Date, default: Date.now }),
|
|
68
69
|
__metadata("design:type", Date)
|
|
69
70
|
], Note.prototype, "createdAt", void 0);
|
|
70
|
-
Note = __decorate([
|
|
71
|
+
exports.Note = Note = __decorate([
|
|
71
72
|
(0, mongoose_1.Schema)({ _id: false })
|
|
72
73
|
], Note);
|
|
73
|
-
exports.Note = Note;
|
|
74
74
|
exports.NoteSchema = mongoose_1.SchemaFactory.createForClass(Note);
|
|
75
75
|
/** Status do Contrato do Influenciador. Ver GD-715. */
|
|
76
|
-
exports.CONTRACT_STATUS_VALUES = [
|
|
76
|
+
exports.CONTRACT_STATUS_VALUES = ["draft", "proposed", "signed", "rejected"];
|
|
77
77
|
/**
|
|
78
78
|
* Aditivo do Contrato: soma no valor total quando ativo e pode estender a
|
|
79
79
|
* vigência (o fim do Contrato vai até o fim do último Aditivo ativo). Não tem
|
|
@@ -81,6 +81,7 @@ exports.CONTRACT_STATUS_VALUES = ['draft', 'proposed', 'signed', 'rejected'];
|
|
|
81
81
|
*/
|
|
82
82
|
let ContractAmendment = class ContractAmendment {
|
|
83
83
|
};
|
|
84
|
+
exports.ContractAmendment = ContractAmendment;
|
|
84
85
|
__decorate([
|
|
85
86
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
|
|
86
87
|
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
@@ -105,10 +106,9 @@ __decorate([
|
|
|
105
106
|
(0, mongoose_1.Prop)({ type: String, required: false, default: null }),
|
|
106
107
|
__metadata("design:type", Object)
|
|
107
108
|
], ContractAmendment.prototype, "description", void 0);
|
|
108
|
-
ContractAmendment = __decorate([
|
|
109
|
+
exports.ContractAmendment = ContractAmendment = __decorate([
|
|
109
110
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
110
111
|
], ContractAmendment);
|
|
111
|
-
exports.ContractAmendment = ContractAmendment;
|
|
112
112
|
exports.ContractAmendmentSchema = mongoose_1.SchemaFactory.createForClass(ContractAmendment);
|
|
113
113
|
// Contrato de valor fixo recorrente (influenciador embaixador de marca) —
|
|
114
114
|
// alternativa ao pagamento avulso por Recruitment (scope.payment/advisorPayment).
|
|
@@ -116,12 +116,13 @@ exports.ContractAmendmentSchema = mongoose_1.SchemaFactory.createForClass(Contra
|
|
|
116
116
|
// (Recruitment.scope.delivery), pra manter o mesmo vocabulário.
|
|
117
117
|
let InfluencerContract = class InfluencerContract {
|
|
118
118
|
};
|
|
119
|
+
exports.InfluencerContract = InfluencerContract;
|
|
119
120
|
__decorate([
|
|
120
121
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
|
|
121
122
|
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
122
123
|
], InfluencerContract.prototype, "_id", void 0);
|
|
123
124
|
__decorate([
|
|
124
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref:
|
|
125
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: "Client", required: true }),
|
|
125
126
|
__metadata("design:type", Object)
|
|
126
127
|
], InfluencerContract.prototype, "client", void 0);
|
|
127
128
|
__decorate([
|
|
@@ -133,7 +134,7 @@ __decorate([
|
|
|
133
134
|
__metadata("design:type", Number)
|
|
134
135
|
], InfluencerContract.prototype, "productsValue", void 0);
|
|
135
136
|
__decorate([
|
|
136
|
-
(0, mongoose_1.Prop)({ type: String, enum: exports.CONTRACT_STATUS_VALUES, required: false, default:
|
|
137
|
+
(0, mongoose_1.Prop)({ type: String, enum: exports.CONTRACT_STATUS_VALUES, required: false, default: "signed" }),
|
|
137
138
|
__metadata("design:type", String)
|
|
138
139
|
], InfluencerContract.prototype, "status", void 0);
|
|
139
140
|
__decorate([
|
|
@@ -141,7 +142,7 @@ __decorate([
|
|
|
141
142
|
__metadata("design:type", Boolean)
|
|
142
143
|
], InfluencerContract.prototype, "isActive", void 0);
|
|
143
144
|
__decorate([
|
|
144
|
-
(0, mongoose_1.Prop)({ type: String, enum: [
|
|
145
|
+
(0, mongoose_1.Prop)({ type: String, enum: ["monthly", "annual"], required: true }),
|
|
145
146
|
__metadata("design:type", String)
|
|
146
147
|
], InfluencerContract.prototype, "periodType", void 0);
|
|
147
148
|
__decorate([
|
|
@@ -184,13 +185,13 @@ __decorate([
|
|
|
184
185
|
(0, mongoose_1.Prop)({ type: [exports.ContractAmendmentSchema], required: false, default: [] }),
|
|
185
186
|
__metadata("design:type", Array)
|
|
186
187
|
], InfluencerContract.prototype, "amendments", void 0);
|
|
187
|
-
InfluencerContract = __decorate([
|
|
188
|
+
exports.InfluencerContract = InfluencerContract = __decorate([
|
|
188
189
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
189
190
|
], InfluencerContract);
|
|
190
|
-
exports.InfluencerContract = InfluencerContract;
|
|
191
191
|
exports.InfluencerContractSchema = mongoose_1.SchemaFactory.createForClass(InfluencerContract);
|
|
192
192
|
let Influencer = class Influencer extends party_schema_1.Party {
|
|
193
193
|
};
|
|
194
|
+
exports.Influencer = Influencer;
|
|
194
195
|
__decorate([
|
|
195
196
|
(0, mongoose_1.Prop)({ required: false }),
|
|
196
197
|
__metadata("design:type", String)
|
|
@@ -204,9 +205,7 @@ __decorate([
|
|
|
204
205
|
__metadata("design:type", Advisor)
|
|
205
206
|
], Influencer.prototype, "advisor", void 0);
|
|
206
207
|
__decorate([
|
|
207
|
-
(0, mongoose_1.Prop)([
|
|
208
|
-
{ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: false },
|
|
209
|
-
]),
|
|
208
|
+
(0, mongoose_1.Prop)([{ type: mongoose_2.Schema.Types.ObjectId, ref: "Profile", required: false }]),
|
|
210
209
|
__metadata("design:type", Array)
|
|
211
210
|
], Influencer.prototype, "profiles", void 0);
|
|
212
211
|
__decorate([
|
|
@@ -217,9 +216,8 @@ __decorate([
|
|
|
217
216
|
(0, mongoose_1.Prop)({ type: [exports.InfluencerContractSchema], required: false }),
|
|
218
217
|
__metadata("design:type", Array)
|
|
219
218
|
], Influencer.prototype, "contracts", void 0);
|
|
220
|
-
Influencer = __decorate([
|
|
219
|
+
exports.Influencer = Influencer = __decorate([
|
|
221
220
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
222
221
|
], Influencer);
|
|
223
|
-
exports.Influencer = Influencer;
|
|
224
222
|
exports.InfluencerSchema = mongoose_1.SchemaFactory.createForClass(Influencer);
|
|
225
|
-
exports.InfluencerModel = (0, mongoose_2.model)(
|
|
223
|
+
exports.InfluencerModel = (0, mongoose_2.model)("Influencer", exports.InfluencerSchema);
|
|
@@ -1,31 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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';
|
|
28
|
-
import { Note } from './note.schema';
|
|
1
|
+
import { HydratedDocument, Schema as MongooseSchema, Types } from "mongoose";
|
|
2
|
+
import { Sale } from "./sale.schema";
|
|
3
|
+
import { Note } from "./note.schema";
|
|
29
4
|
export type InvoiceDocument = HydratedDocument<Invoice>;
|
|
30
5
|
declare class Recipient {
|
|
31
6
|
legalName: string;
|
|
@@ -66,7 +41,7 @@ export declare class Invoice {
|
|
|
66
41
|
_id?: Types.ObjectId;
|
|
67
42
|
title: string;
|
|
68
43
|
installmentNumber: number;
|
|
69
|
-
phase:
|
|
44
|
+
phase: "inbox" | "review" | "awaiting" | "invoiced" | "received" | "canceled";
|
|
70
45
|
sale: Types.ObjectId | Sale;
|
|
71
46
|
organization: Types.ObjectId;
|
|
72
47
|
inbox?: Inbox;
|