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