@grapadigital/shared-schemas 1.0.217 → 1.0.219
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 +1 -0
- package/dist/index.js +1 -0
- package/dist/schemas/action.schema.d.ts +1 -29
- package/dist/schemas/action.schema.js +4 -34
- package/dist/schemas/assignment.schema.d.ts +2 -1
- package/dist/schemas/assignment.schema.js +5 -4
- package/dist/schemas/client.schema.d.ts +73 -5
- package/dist/schemas/client.schema.js +121 -18
- package/dist/schemas/content-capture-process.schema.d.ts +2 -28
- package/dist/schemas/content-capture-process.schema.js +4 -35
- package/dist/schemas/prospect.schema.d.ts +2 -14
- package/dist/schemas/prospect.schema.js +6 -20
- package/dist/schemas/responsible.schema.d.ts +45 -0
- package/dist/schemas/responsible.schema.js +45 -0
- package/dist/schemas/sale.schema.d.ts +16 -15
- package/dist/schemas/sale.schema.js +14 -33
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/schemas/action.schema.ts +1 -25
- package/src/schemas/assignment.schema.ts +5 -4
- package/src/schemas/client.schema.ts +112 -14
- package/src/schemas/content-capture-process.schema.ts +3 -33
- package/src/schemas/prospect.schema.ts +5 -15
- package/src/schemas/responsible.schema.ts +27 -0
- package/src/schemas/sale.schema.ts +15 -45
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.NoteMentionSchema = exports.NoteMention = exports.NoteSchema = exports.Note = void 0;
|
|
18
|
+
__exportStar(require("./schemas/responsible.schema"), exports);
|
|
18
19
|
__exportStar(require("./schemas/action.schema"), exports);
|
|
19
20
|
__exportStar(require("./schemas/prospect.schema"), exports);
|
|
20
21
|
__exportStar(require("./schemas/client.schema"), exports);
|
|
@@ -30,36 +30,8 @@ import { Client } from './client.schema';
|
|
|
30
30
|
import { Sale } from './sale.schema';
|
|
31
31
|
import { Campaign } from './campaign.schema';
|
|
32
32
|
import { Note } from './note.schema';
|
|
33
|
+
import { Responsible } from './responsible.schema';
|
|
33
34
|
export type ActionDocument = HydratedDocument<Action>;
|
|
34
|
-
export declare class Responsible {
|
|
35
|
-
name: string;
|
|
36
|
-
team: string;
|
|
37
|
-
email: string;
|
|
38
|
-
}
|
|
39
|
-
export declare const ResponsibleSchema: MongooseSchema<Responsible, import("mongoose").Model<Responsible, any, any, any, import("mongoose").Document<unknown, any, Responsible, any, {}> & Responsible & {
|
|
40
|
-
_id: Types.ObjectId;
|
|
41
|
-
} & {
|
|
42
|
-
__v: number;
|
|
43
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Responsible, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Responsible>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Responsible> & {
|
|
44
|
-
_id: Types.ObjectId;
|
|
45
|
-
} & {
|
|
46
|
-
__v: number;
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Use `Responsible` or `Responsible[]` on Action.responsible
|
|
50
|
-
*/
|
|
51
|
-
export declare class ActionResponsible extends Responsible {
|
|
52
|
-
}
|
|
53
|
-
export declare const ActionResponsibleSchema: MongooseSchema<ActionResponsible, import("mongoose").Model<ActionResponsible, any, any, any, import("mongoose").Document<unknown, any, ActionResponsible, any, {}> & ActionResponsible & {
|
|
54
|
-
_id: Types.ObjectId;
|
|
55
|
-
} & {
|
|
56
|
-
__v: number;
|
|
57
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ActionResponsible, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ActionResponsible>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ActionResponsible> & {
|
|
58
|
-
_id: Types.ObjectId;
|
|
59
|
-
} & {
|
|
60
|
-
__v: number;
|
|
61
|
-
}>;
|
|
62
|
-
export { ActionResponsible as Responsibles, ActionResponsibleSchema as ResponsiblesSchema };
|
|
63
35
|
export declare const ACTION_BUSINESS_UNIT_VALUES: readonly ["service", "comercial", "squad_a", "squad_b"];
|
|
64
36
|
export type ActionBusinessUnit = (typeof ACTION_BUSINESS_UNIT_VALUES)[number];
|
|
65
37
|
export declare class ActionPromptConfig {
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ActionModel = exports.ActionSchema = exports.Action = exports.ACTION_STATUS_VALUES = exports.ActionPromptConfigSchema = exports.ActionPromptConfig = exports.ACTION_BUSINESS_UNIT_VALUES =
|
|
12
|
+
exports.ActionModel = exports.ActionSchema = exports.Action = exports.ACTION_STATUS_VALUES = exports.ActionPromptConfigSchema = exports.ActionPromptConfig = exports.ACTION_BUSINESS_UNIT_VALUES = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const swagger_1 = require("@nestjs/swagger");
|
|
15
15
|
const mongoose_2 = require("mongoose");
|
|
@@ -19,37 +19,7 @@ const client_schema_1 = require("./client.schema");
|
|
|
19
19
|
const sale_schema_1 = require("./sale.schema");
|
|
20
20
|
const campaign_schema_1 = require("./campaign.schema");
|
|
21
21
|
const note_schema_1 = require("./note.schema");
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, swagger_1.ApiProperty)({ example: 'Maria Oliveira' }),
|
|
26
|
-
(0, mongoose_1.Prop)(),
|
|
27
|
-
__metadata("design:type", String)
|
|
28
|
-
], Responsible.prototype, "name", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, swagger_1.ApiProperty)({ example: 'Comercial' }),
|
|
31
|
-
(0, mongoose_1.Prop)(),
|
|
32
|
-
__metadata("design:type", String)
|
|
33
|
-
], Responsible.prototype, "team", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, swagger_1.ApiProperty)({ example: 'maria@empresa.com' }),
|
|
36
|
-
(0, mongoose_1.Prop)(),
|
|
37
|
-
__metadata("design:type", String)
|
|
38
|
-
], Responsible.prototype, "email", void 0);
|
|
39
|
-
Responsible = __decorate([
|
|
40
|
-
(0, mongoose_1.Schema)({ _id: false })
|
|
41
|
-
], Responsible);
|
|
42
|
-
exports.Responsible = Responsible;
|
|
43
|
-
exports.ResponsibleSchema = mongoose_1.SchemaFactory.createForClass(Responsible);
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Use `Responsible` or `Responsible[]` on Action.responsible
|
|
46
|
-
*/
|
|
47
|
-
class ActionResponsible extends Responsible {
|
|
48
|
-
}
|
|
49
|
-
exports.ActionResponsible = ActionResponsible;
|
|
50
|
-
exports.Responsibles = ActionResponsible;
|
|
51
|
-
exports.ActionResponsibleSchema = mongoose_1.SchemaFactory.createForClass(ActionResponsible);
|
|
52
|
-
exports.ResponsiblesSchema = exports.ActionResponsibleSchema;
|
|
22
|
+
const responsible_schema_1 = require("./responsible.schema");
|
|
53
23
|
exports.ACTION_BUSINESS_UNIT_VALUES = [
|
|
54
24
|
'service',
|
|
55
25
|
'comercial',
|
|
@@ -234,8 +204,8 @@ __decorate([
|
|
|
234
204
|
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
235
205
|
], Action.prototype, "organization", void 0);
|
|
236
206
|
__decorate([
|
|
237
|
-
(0, swagger_1.ApiProperty)({ type: () => [Responsible] }),
|
|
238
|
-
(0, mongoose_1.Prop)({ type: [
|
|
207
|
+
(0, swagger_1.ApiProperty)({ type: () => [responsible_schema_1.Responsible] }),
|
|
208
|
+
(0, mongoose_1.Prop)({ type: [responsible_schema_1.ResponsibleSchema], required: true }),
|
|
239
209
|
__metadata("design:type", Array)
|
|
240
210
|
], Action.prototype, "responsible", void 0);
|
|
241
211
|
__decorate([
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
26
|
import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
27
|
import { Action } from './action.schema';
|
|
28
|
+
import { Responsible } from './responsible.schema';
|
|
28
29
|
export type AssignmentDocument = HydratedDocument<Assignment>;
|
|
29
30
|
export declare const ASSIGNMENT_TYPE_VALUES: readonly ["report", "curation", "opt-in", "metrics-monitoring", "data-update", "study"];
|
|
30
31
|
export type AssignmentType = (typeof ASSIGNMENT_TYPE_VALUES)[number];
|
|
@@ -54,7 +55,7 @@ export declare class Assignment {
|
|
|
54
55
|
organization: Types.ObjectId;
|
|
55
56
|
type: AssignmentType;
|
|
56
57
|
title: string;
|
|
57
|
-
responsible?:
|
|
58
|
+
responsible?: Responsible[];
|
|
58
59
|
startDate?: Date | null;
|
|
59
60
|
dueDate?: Date | null;
|
|
60
61
|
status: AssignmentStatus;
|
|
@@ -13,6 +13,7 @@ exports.AssignmentModel = exports.AssignmentSchema = exports.Assignment = export
|
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const swagger_1 = require("@nestjs/swagger");
|
|
15
15
|
const mongoose_2 = require("mongoose");
|
|
16
|
+
const responsible_schema_1 = require("./responsible.schema");
|
|
16
17
|
exports.ASSIGNMENT_TYPE_VALUES = [
|
|
17
18
|
'report',
|
|
18
19
|
'curation',
|
|
@@ -105,9 +106,9 @@ __decorate([
|
|
|
105
106
|
__metadata("design:type", String)
|
|
106
107
|
], Assignment.prototype, "title", void 0);
|
|
107
108
|
__decorate([
|
|
108
|
-
(0, swagger_1.ApiProperty)({
|
|
109
|
-
(0, mongoose_1.Prop)({ type:
|
|
110
|
-
__metadata("design:type",
|
|
109
|
+
(0, swagger_1.ApiProperty)({ type: () => [responsible_schema_1.Responsible], required: false }),
|
|
110
|
+
(0, mongoose_1.Prop)({ type: [responsible_schema_1.ResponsibleSchema], required: false, default: [] }),
|
|
111
|
+
__metadata("design:type", Array)
|
|
111
112
|
], Assignment.prototype, "responsible", void 0);
|
|
112
113
|
__decorate([
|
|
113
114
|
(0, swagger_1.ApiProperty)({ example: '2026-08-25T00:00:00.000Z', required: false }),
|
|
@@ -163,5 +164,5 @@ exports.AssignmentSchema.index({ action: 1 });
|
|
|
163
164
|
exports.AssignmentSchema.index({ organization: 1, status: 1 });
|
|
164
165
|
exports.AssignmentSchema.index({ organization: 1, dueDate: 1 });
|
|
165
166
|
exports.AssignmentSchema.index({ seriesId: 1 });
|
|
166
|
-
exports.AssignmentSchema.index({ responsible: 1, dueDate: 1 });
|
|
167
|
+
exports.AssignmentSchema.index({ 'responsible.email': 1, dueDate: 1 });
|
|
167
168
|
exports.AssignmentModel = (0, mongoose_2.model)('Assignment', exports.AssignmentSchema);
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
27
|
import { Party } from './party.schema';
|
|
28
28
|
import { Profile } from './profile.schema';
|
|
29
|
+
import { Responsible } from './responsible.schema';
|
|
29
30
|
export type ClientDocument = HydratedDocument<Client>;
|
|
30
31
|
/**
|
|
31
32
|
* Personalizações de cliente: ligam telas e regras que valem só para ele.
|
|
@@ -33,6 +34,17 @@ export type ClientDocument = HydratedDocument<Client>;
|
|
|
33
34
|
*/
|
|
34
35
|
export declare const CLIENT_CUSTOMIZATION_VALUES: readonly ["samsung"];
|
|
35
36
|
export type ClientCustomization = (typeof CLIENT_CUSTOMIZATION_VALUES)[number];
|
|
37
|
+
/**
|
|
38
|
+
* Catálogo de métricas que podem virar meta no Tier ou na Meta anual do
|
|
39
|
+
* cliente. Quem cadastra escolhe a métrica e o valor; nada fica fixo.
|
|
40
|
+
* `viralReachEngagementRate` é o limite de viral e só vale no Tier.
|
|
41
|
+
* Ver GD-687.
|
|
42
|
+
*/
|
|
43
|
+
export declare const CLIENT_GOAL_METRIC_VALUES: readonly ["potentialReach", "reachCount", "impressionCount", "engagementCount", "engagementRate", "reachEngagementRate", "qualifiedEngagementRate", "effectiveReach", "emv", "score", "cpmi", "cpi", "cpe", "viralReachEngagementRate"];
|
|
44
|
+
export type ClientGoalMetric = (typeof CLIENT_GOAL_METRIC_VALUES)[number];
|
|
45
|
+
export type ClientGoalMetricUnit = 'count' | 'rate' | 'currency';
|
|
46
|
+
/** Unidade de cada métrica. `rate` é guardado como fração (0,10 = 10%). */
|
|
47
|
+
export declare const CLIENT_GOAL_METRIC_UNITS: Record<ClientGoalMetric, ClientGoalMetricUnit>;
|
|
36
48
|
export declare class Cluster {
|
|
37
49
|
key: string;
|
|
38
50
|
label: string;
|
|
@@ -73,6 +85,56 @@ export declare const CommissionRangeSchema: MongooseSchema<CommissionRange, impo
|
|
|
73
85
|
} & {
|
|
74
86
|
__v: number;
|
|
75
87
|
}>;
|
|
88
|
+
export declare class ClientMetricGoal {
|
|
89
|
+
metric: ClientGoalMetric;
|
|
90
|
+
/** Na unidade da métrica (`CLIENT_GOAL_METRIC_UNITS`); `rate` em fração. */
|
|
91
|
+
value: number;
|
|
92
|
+
}
|
|
93
|
+
export declare const ClientMetricGoalSchema: MongooseSchema<ClientMetricGoal, import("mongoose").Model<ClientMetricGoal, any, any, any, import("mongoose").Document<unknown, any, ClientMetricGoal, any, {}> & ClientMetricGoal & {
|
|
94
|
+
_id: Types.ObjectId;
|
|
95
|
+
} & {
|
|
96
|
+
__v: number;
|
|
97
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ClientMetricGoal, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ClientMetricGoal>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ClientMetricGoal> & {
|
|
98
|
+
_id: Types.ObjectId;
|
|
99
|
+
} & {
|
|
100
|
+
__v: number;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* Faixa de seguidores do cliente com as metas dela (ex.: Micro, Macro, Hero,
|
|
104
|
+
* Icon da Samsung). O Tier é do cliente, não do Influenciador: para mudar a
|
|
105
|
+
* meta, edita o Tier. Faixas inclusivas nas duas pontas, contínuas e sem
|
|
106
|
+
* sobreposição (validado na api-entities). Ver GD-687.
|
|
107
|
+
*/
|
|
108
|
+
export declare class ClientTier {
|
|
109
|
+
name: string;
|
|
110
|
+
minFollowers: number;
|
|
111
|
+
/** `null` = sem teto (só o último Tier). */
|
|
112
|
+
maxFollowers?: number | null;
|
|
113
|
+
goals: ClientMetricGoal[];
|
|
114
|
+
}
|
|
115
|
+
export declare const ClientTierSchema: MongooseSchema<ClientTier, import("mongoose").Model<ClientTier, any, any, any, import("mongoose").Document<unknown, any, ClientTier, any, {}> & ClientTier & {
|
|
116
|
+
_id: Types.ObjectId;
|
|
117
|
+
} & {
|
|
118
|
+
__v: number;
|
|
119
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ClientTier, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ClientTier>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ClientTier> & {
|
|
120
|
+
_id: Types.ObjectId;
|
|
121
|
+
} & {
|
|
122
|
+
__v: number;
|
|
123
|
+
}>;
|
|
124
|
+
/** Metas do cliente num ano (alimentam os cards do gen_ia). Ver GD-687. */
|
|
125
|
+
export declare class ClientAnnualGoal {
|
|
126
|
+
year: number;
|
|
127
|
+
goals: ClientMetricGoal[];
|
|
128
|
+
}
|
|
129
|
+
export declare const ClientAnnualGoalSchema: MongooseSchema<ClientAnnualGoal, import("mongoose").Model<ClientAnnualGoal, any, any, any, import("mongoose").Document<unknown, any, ClientAnnualGoal, any, {}> & ClientAnnualGoal & {
|
|
130
|
+
_id: Types.ObjectId;
|
|
131
|
+
} & {
|
|
132
|
+
__v: number;
|
|
133
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ClientAnnualGoal, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ClientAnnualGoal>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ClientAnnualGoal> & {
|
|
134
|
+
_id: Types.ObjectId;
|
|
135
|
+
} & {
|
|
136
|
+
__v: number;
|
|
137
|
+
}>;
|
|
76
138
|
export declare class AgencyCommissionPeriod {
|
|
77
139
|
ranges: CommissionRange[];
|
|
78
140
|
startDate: Date;
|
|
@@ -101,10 +163,13 @@ export declare const NicheItemSchema: MongooseSchema<NicheItem, import("mongoose
|
|
|
101
163
|
} & {
|
|
102
164
|
__v: number;
|
|
103
165
|
}>;
|
|
166
|
+
/**
|
|
167
|
+
* Responsáveis do cliente: `report` são usuários da plataforma que cuidam dos
|
|
168
|
+
* relatórios; `brand` é o contato do lado da marca (texto livre, não é usuário).
|
|
169
|
+
*/
|
|
104
170
|
export declare class ClientResponsible {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
email: string;
|
|
171
|
+
report?: Responsible[];
|
|
172
|
+
brand?: string;
|
|
108
173
|
}
|
|
109
174
|
export declare const ClientResponsibleSchema: MongooseSchema<ClientResponsible, import("mongoose").Model<ClientResponsible, any, any, any, import("mongoose").Document<unknown, any, ClientResponsible, any, {}> & ClientResponsible & {
|
|
110
175
|
_id: Types.ObjectId;
|
|
@@ -145,6 +210,10 @@ export declare class Client extends Party {
|
|
|
145
210
|
* Ver GD-683.
|
|
146
211
|
*/
|
|
147
212
|
customization?: ClientCustomization | null;
|
|
213
|
+
/** Tiers do cliente (só com Personalização Samsung por enquanto). Ver GD-687. */
|
|
214
|
+
tiers: ClientTier[];
|
|
215
|
+
/** Metas anuais do cliente (só com Personalização Samsung por enquanto). Ver GD-687. */
|
|
216
|
+
annualGoals: ClientAnnualGoal[];
|
|
148
217
|
/**
|
|
149
218
|
* Client de organização (ex.: "Oma Creators"): representa a organização
|
|
150
219
|
* inteira, não uma marca. No hub, mostra todas as actions dessa organização
|
|
@@ -153,8 +222,7 @@ export declare class Client extends Party {
|
|
|
153
222
|
* ou `Action.hasGenIAAnalysis`.
|
|
154
223
|
*/
|
|
155
224
|
organization?: Types.ObjectId;
|
|
156
|
-
|
|
157
|
-
brandResponsible?: string;
|
|
225
|
+
responsible?: ClientResponsible;
|
|
158
226
|
profiles?: Types.ObjectId[] | Profile[];
|
|
159
227
|
}
|
|
160
228
|
export declare const ClientSchema: MongooseSchema<Client, import("mongoose").Model<Client, any, any, any, import("mongoose").Document<unknown, any, Client, any, {}> & Client & Required<{
|
|
@@ -9,16 +9,56 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ClientModel = exports.ClientSchema = exports.Client = exports.ClientResponsibleSchema = exports.ClientResponsible = exports.NicheItemSchema = exports.NicheItem = exports.AgencyCommissionPeriodSchema = exports.AgencyCommissionPeriod = exports.CommissionRangeSchema = exports.CommissionRange = exports.CompanySchema = exports.Company = exports.ClusterSchema = exports.Cluster = exports.CLIENT_CUSTOMIZATION_VALUES = void 0;
|
|
12
|
+
exports.ClientModel = exports.ClientSchema = exports.Client = exports.ClientResponsibleSchema = exports.ClientResponsible = exports.NicheItemSchema = exports.NicheItem = exports.AgencyCommissionPeriodSchema = exports.AgencyCommissionPeriod = exports.ClientAnnualGoalSchema = exports.ClientAnnualGoal = exports.ClientTierSchema = exports.ClientTier = exports.ClientMetricGoalSchema = exports.ClientMetricGoal = exports.CommissionRangeSchema = exports.CommissionRange = exports.CompanySchema = exports.Company = exports.ClusterSchema = exports.Cluster = exports.CLIENT_GOAL_METRIC_UNITS = exports.CLIENT_GOAL_METRIC_VALUES = exports.CLIENT_CUSTOMIZATION_VALUES = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const swagger_1 = require("@nestjs/swagger");
|
|
15
15
|
const mongoose_2 = require("mongoose");
|
|
16
16
|
const party_schema_1 = require("./party.schema");
|
|
17
|
+
const responsible_schema_1 = require("./responsible.schema");
|
|
17
18
|
/**
|
|
18
19
|
* Personalizações de cliente: ligam telas e regras que valem só para ele.
|
|
19
20
|
* Ver GD-683.
|
|
20
21
|
*/
|
|
21
22
|
exports.CLIENT_CUSTOMIZATION_VALUES = ['samsung'];
|
|
23
|
+
/**
|
|
24
|
+
* Catálogo de métricas que podem virar meta no Tier ou na Meta anual do
|
|
25
|
+
* cliente. Quem cadastra escolhe a métrica e o valor; nada fica fixo.
|
|
26
|
+
* `viralReachEngagementRate` é o limite de viral e só vale no Tier.
|
|
27
|
+
* Ver GD-687.
|
|
28
|
+
*/
|
|
29
|
+
exports.CLIENT_GOAL_METRIC_VALUES = [
|
|
30
|
+
'potentialReach',
|
|
31
|
+
'reachCount',
|
|
32
|
+
'impressionCount',
|
|
33
|
+
'engagementCount',
|
|
34
|
+
'engagementRate',
|
|
35
|
+
'reachEngagementRate',
|
|
36
|
+
'qualifiedEngagementRate',
|
|
37
|
+
'effectiveReach',
|
|
38
|
+
'emv',
|
|
39
|
+
'score',
|
|
40
|
+
'cpmi',
|
|
41
|
+
'cpi',
|
|
42
|
+
'cpe',
|
|
43
|
+
'viralReachEngagementRate',
|
|
44
|
+
];
|
|
45
|
+
/** Unidade de cada métrica. `rate` é guardado como fração (0,10 = 10%). */
|
|
46
|
+
exports.CLIENT_GOAL_METRIC_UNITS = {
|
|
47
|
+
potentialReach: 'count',
|
|
48
|
+
reachCount: 'count',
|
|
49
|
+
impressionCount: 'count',
|
|
50
|
+
engagementCount: 'count',
|
|
51
|
+
engagementRate: 'rate',
|
|
52
|
+
reachEngagementRate: 'rate',
|
|
53
|
+
qualifiedEngagementRate: 'rate',
|
|
54
|
+
effectiveReach: 'count',
|
|
55
|
+
emv: 'currency',
|
|
56
|
+
score: 'count',
|
|
57
|
+
cpmi: 'currency',
|
|
58
|
+
cpi: 'currency',
|
|
59
|
+
cpe: 'currency',
|
|
60
|
+
viralReachEngagementRate: 'rate',
|
|
61
|
+
};
|
|
22
62
|
let Cluster = class Cluster {
|
|
23
63
|
};
|
|
24
64
|
__decorate([
|
|
@@ -68,6 +108,66 @@ CommissionRange = __decorate([
|
|
|
68
108
|
], CommissionRange);
|
|
69
109
|
exports.CommissionRange = CommissionRange;
|
|
70
110
|
exports.CommissionRangeSchema = mongoose_1.SchemaFactory.createForClass(CommissionRange);
|
|
111
|
+
let ClientMetricGoal = class ClientMetricGoal {
|
|
112
|
+
};
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, mongoose_1.Prop)({ type: String, enum: exports.CLIENT_GOAL_METRIC_VALUES, required: true }),
|
|
115
|
+
__metadata("design:type", String)
|
|
116
|
+
], ClientMetricGoal.prototype, "metric", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
119
|
+
__metadata("design:type", Number)
|
|
120
|
+
], ClientMetricGoal.prototype, "value", void 0);
|
|
121
|
+
ClientMetricGoal = __decorate([
|
|
122
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
123
|
+
], ClientMetricGoal);
|
|
124
|
+
exports.ClientMetricGoal = ClientMetricGoal;
|
|
125
|
+
exports.ClientMetricGoalSchema = mongoose_1.SchemaFactory.createForClass(ClientMetricGoal);
|
|
126
|
+
/**
|
|
127
|
+
* Faixa de seguidores do cliente com as metas dela (ex.: Micro, Macro, Hero,
|
|
128
|
+
* Icon da Samsung). O Tier é do cliente, não do Influenciador: para mudar a
|
|
129
|
+
* meta, edita o Tier. Faixas inclusivas nas duas pontas, contínuas e sem
|
|
130
|
+
* sobreposição (validado na api-entities). Ver GD-687.
|
|
131
|
+
*/
|
|
132
|
+
let ClientTier = class ClientTier {
|
|
133
|
+
};
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], ClientTier.prototype, "name", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
140
|
+
__metadata("design:type", Number)
|
|
141
|
+
], ClientTier.prototype, "minFollowers", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
144
|
+
__metadata("design:type", Object)
|
|
145
|
+
], ClientTier.prototype, "maxFollowers", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, mongoose_1.Prop)({ type: [exports.ClientMetricGoalSchema], default: [] }),
|
|
148
|
+
__metadata("design:type", Array)
|
|
149
|
+
], ClientTier.prototype, "goals", void 0);
|
|
150
|
+
ClientTier = __decorate([
|
|
151
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
152
|
+
], ClientTier);
|
|
153
|
+
exports.ClientTier = ClientTier;
|
|
154
|
+
exports.ClientTierSchema = mongoose_1.SchemaFactory.createForClass(ClientTier);
|
|
155
|
+
/** Metas do cliente num ano (alimentam os cards do gen_ia). Ver GD-687. */
|
|
156
|
+
let ClientAnnualGoal = class ClientAnnualGoal {
|
|
157
|
+
};
|
|
158
|
+
__decorate([
|
|
159
|
+
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
160
|
+
__metadata("design:type", Number)
|
|
161
|
+
], ClientAnnualGoal.prototype, "year", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, mongoose_1.Prop)({ type: [exports.ClientMetricGoalSchema], default: [] }),
|
|
164
|
+
__metadata("design:type", Array)
|
|
165
|
+
], ClientAnnualGoal.prototype, "goals", void 0);
|
|
166
|
+
ClientAnnualGoal = __decorate([
|
|
167
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
168
|
+
], ClientAnnualGoal);
|
|
169
|
+
exports.ClientAnnualGoal = ClientAnnualGoal;
|
|
170
|
+
exports.ClientAnnualGoalSchema = mongoose_1.SchemaFactory.createForClass(ClientAnnualGoal);
|
|
71
171
|
let AgencyCommissionPeriod = class AgencyCommissionPeriod {
|
|
72
172
|
};
|
|
73
173
|
__decorate([
|
|
@@ -106,23 +206,22 @@ NicheItem = __decorate([
|
|
|
106
206
|
], NicheItem);
|
|
107
207
|
exports.NicheItem = NicheItem;
|
|
108
208
|
exports.NicheItemSchema = mongoose_1.SchemaFactory.createForClass(NicheItem);
|
|
209
|
+
/**
|
|
210
|
+
* Responsáveis do cliente: `report` são usuários da plataforma que cuidam dos
|
|
211
|
+
* relatórios; `brand` é o contato do lado da marca (texto livre, não é usuário).
|
|
212
|
+
*/
|
|
109
213
|
let ClientResponsible = class ClientResponsible {
|
|
110
214
|
};
|
|
111
215
|
__decorate([
|
|
112
|
-
(0, swagger_1.ApiProperty)({
|
|
113
|
-
(0, mongoose_1.Prop)(),
|
|
114
|
-
__metadata("design:type",
|
|
115
|
-
], ClientResponsible.prototype, "
|
|
116
|
-
__decorate([
|
|
117
|
-
(0, swagger_1.ApiProperty)({ example: 'Comercial' }),
|
|
118
|
-
(0, mongoose_1.Prop)(),
|
|
119
|
-
__metadata("design:type", String)
|
|
120
|
-
], ClientResponsible.prototype, "team", void 0);
|
|
216
|
+
(0, swagger_1.ApiProperty)({ type: () => [responsible_schema_1.Responsible], required: false }),
|
|
217
|
+
(0, mongoose_1.Prop)({ type: [responsible_schema_1.ResponsibleSchema], required: false, default: [] }),
|
|
218
|
+
__metadata("design:type", Array)
|
|
219
|
+
], ClientResponsible.prototype, "report", void 0);
|
|
121
220
|
__decorate([
|
|
122
|
-
(0, swagger_1.ApiProperty)({ example: '
|
|
123
|
-
(0, mongoose_1.Prop)(),
|
|
221
|
+
(0, swagger_1.ApiProperty)({ example: 'Maite', required: false }),
|
|
222
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
124
223
|
__metadata("design:type", String)
|
|
125
|
-
], ClientResponsible.prototype, "
|
|
224
|
+
], ClientResponsible.prototype, "brand", void 0);
|
|
126
225
|
ClientResponsible = __decorate([
|
|
127
226
|
(0, mongoose_1.Schema)({ _id: false })
|
|
128
227
|
], ClientResponsible);
|
|
@@ -178,6 +277,14 @@ __decorate([
|
|
|
178
277
|
(0, mongoose_1.Prop)({ type: String, enum: exports.CLIENT_CUSTOMIZATION_VALUES, required: false, default: null }),
|
|
179
278
|
__metadata("design:type", Object)
|
|
180
279
|
], Client.prototype, "customization", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
(0, mongoose_1.Prop)({ type: [exports.ClientTierSchema], default: [] }),
|
|
282
|
+
__metadata("design:type", Array)
|
|
283
|
+
], Client.prototype, "tiers", void 0);
|
|
284
|
+
__decorate([
|
|
285
|
+
(0, mongoose_1.Prop)({ type: [exports.ClientAnnualGoalSchema], default: [] }),
|
|
286
|
+
__metadata("design:type", Array)
|
|
287
|
+
], Client.prototype, "annualGoals", void 0);
|
|
181
288
|
__decorate([
|
|
182
289
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Organization', required: false }),
|
|
183
290
|
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
@@ -185,11 +292,7 @@ __decorate([
|
|
|
185
292
|
__decorate([
|
|
186
293
|
(0, mongoose_1.Prop)({ type: exports.ClientResponsibleSchema, required: false }),
|
|
187
294
|
__metadata("design:type", ClientResponsible)
|
|
188
|
-
], Client.prototype, "
|
|
189
|
-
__decorate([
|
|
190
|
-
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
191
|
-
__metadata("design:type", String)
|
|
192
|
-
], Client.prototype, "brandResponsible", void 0);
|
|
295
|
+
], Client.prototype, "responsible", void 0);
|
|
193
296
|
__decorate([
|
|
194
297
|
(0, mongoose_1.Prop)([
|
|
195
298
|
{ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: false },
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
26
|
import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
27
|
import { Action } from './action.schema';
|
|
28
|
+
import { Responsible } from './responsible.schema';
|
|
28
29
|
export type ContentCaptureProcessDocument = HydratedDocument<ContentCaptureProcess>;
|
|
29
30
|
export declare class ContentCaptureProcessMetrics {
|
|
30
31
|
impressionCount?: number | null;
|
|
@@ -94,40 +95,13 @@ export declare const ContentCaptureProcessItemSchema: MongooseSchema<ContentCapt
|
|
|
94
95
|
} & {
|
|
95
96
|
__v: number;
|
|
96
97
|
}>;
|
|
97
|
-
export declare class ContentCaptureProcessResponsibleContact {
|
|
98
|
-
name?: string;
|
|
99
|
-
team?: string;
|
|
100
|
-
email?: string;
|
|
101
|
-
}
|
|
102
|
-
export declare const ContentCaptureProcessResponsibleContactSchema: MongooseSchema<ContentCaptureProcessResponsibleContact, import("mongoose").Model<ContentCaptureProcessResponsibleContact, any, any, any, import("mongoose").Document<unknown, any, ContentCaptureProcessResponsibleContact, any, {}> & ContentCaptureProcessResponsibleContact & {
|
|
103
|
-
_id: Types.ObjectId;
|
|
104
|
-
} & {
|
|
105
|
-
__v: number;
|
|
106
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ContentCaptureProcessResponsibleContact, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ContentCaptureProcessResponsibleContact>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ContentCaptureProcessResponsibleContact> & {
|
|
107
|
-
_id: Types.ObjectId;
|
|
108
|
-
} & {
|
|
109
|
-
__v: number;
|
|
110
|
-
}>;
|
|
111
|
-
export declare class ContentCaptureProcessResponsible {
|
|
112
|
-
service?: ContentCaptureProcessResponsibleContact[];
|
|
113
|
-
}
|
|
114
|
-
export declare const ContentCaptureProcessResponsibleSchema: MongooseSchema<ContentCaptureProcessResponsible, import("mongoose").Model<ContentCaptureProcessResponsible, any, any, any, import("mongoose").Document<unknown, any, ContentCaptureProcessResponsible, any, {}> & ContentCaptureProcessResponsible & {
|
|
115
|
-
_id: Types.ObjectId;
|
|
116
|
-
} & {
|
|
117
|
-
__v: number;
|
|
118
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ContentCaptureProcessResponsible, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ContentCaptureProcessResponsible>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ContentCaptureProcessResponsible> & {
|
|
119
|
-
_id: Types.ObjectId;
|
|
120
|
-
} & {
|
|
121
|
-
__v: number;
|
|
122
|
-
}>;
|
|
123
|
-
export { ContentCaptureProcessResponsible as ContentCaptureProcessResponsibles, ContentCaptureProcessResponsibleSchema as ContentCaptureProcessResponsiblesSchema, };
|
|
124
98
|
export declare class ContentCaptureProcess {
|
|
125
99
|
_id?: Types.ObjectId;
|
|
126
100
|
actionId: Types.ObjectId | Action;
|
|
127
101
|
runId: string;
|
|
128
102
|
actionTitle: string;
|
|
129
103
|
primetagId?: string;
|
|
130
|
-
responsible?:
|
|
104
|
+
responsible?: Responsible[];
|
|
131
105
|
status: 'fetching' | 'awaiting_comments' | 'reported' | 'failed';
|
|
132
106
|
publicationsFetched: number;
|
|
133
107
|
contentsMapped: number;
|
|
@@ -9,9 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ContentCaptureProcessModel = exports.ContentCaptureProcessSchema = exports.ContentCaptureProcess = exports.
|
|
12
|
+
exports.ContentCaptureProcessModel = exports.ContentCaptureProcessSchema = exports.ContentCaptureProcess = exports.ContentCaptureProcessItemSchema = exports.ContentCaptureProcessItem = exports.ContentCaptureProcessCommentCaptureStatusSchema = exports.ContentCaptureProcessCommentCaptureStatus = exports.ContentCaptureProcessInfluencerSchema = exports.ContentCaptureProcessInfluencer = exports.ContentCaptureProcessMetricsSchema = exports.ContentCaptureProcessMetrics = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const mongoose_2 = require("mongoose");
|
|
15
|
+
const responsible_schema_1 = require("./responsible.schema");
|
|
15
16
|
let ContentCaptureProcessMetrics = class ContentCaptureProcessMetrics {
|
|
16
17
|
};
|
|
17
18
|
__decorate([
|
|
@@ -140,38 +141,6 @@ ContentCaptureProcessItem = __decorate([
|
|
|
140
141
|
], ContentCaptureProcessItem);
|
|
141
142
|
exports.ContentCaptureProcessItem = ContentCaptureProcessItem;
|
|
142
143
|
exports.ContentCaptureProcessItemSchema = mongoose_1.SchemaFactory.createForClass(ContentCaptureProcessItem);
|
|
143
|
-
let ContentCaptureProcessResponsibleContact = class ContentCaptureProcessResponsibleContact {
|
|
144
|
-
};
|
|
145
|
-
__decorate([
|
|
146
|
-
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
147
|
-
__metadata("design:type", String)
|
|
148
|
-
], ContentCaptureProcessResponsibleContact.prototype, "name", void 0);
|
|
149
|
-
__decorate([
|
|
150
|
-
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
151
|
-
__metadata("design:type", String)
|
|
152
|
-
], ContentCaptureProcessResponsibleContact.prototype, "team", void 0);
|
|
153
|
-
__decorate([
|
|
154
|
-
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
155
|
-
__metadata("design:type", String)
|
|
156
|
-
], ContentCaptureProcessResponsibleContact.prototype, "email", void 0);
|
|
157
|
-
ContentCaptureProcessResponsibleContact = __decorate([
|
|
158
|
-
(0, mongoose_1.Schema)({ _id: false })
|
|
159
|
-
], ContentCaptureProcessResponsibleContact);
|
|
160
|
-
exports.ContentCaptureProcessResponsibleContact = ContentCaptureProcessResponsibleContact;
|
|
161
|
-
exports.ContentCaptureProcessResponsibleContactSchema = mongoose_1.SchemaFactory.createForClass(ContentCaptureProcessResponsibleContact);
|
|
162
|
-
let ContentCaptureProcessResponsible = class ContentCaptureProcessResponsible {
|
|
163
|
-
};
|
|
164
|
-
__decorate([
|
|
165
|
-
(0, mongoose_1.Prop)({ type: [exports.ContentCaptureProcessResponsibleContactSchema], required: false }),
|
|
166
|
-
__metadata("design:type", Array)
|
|
167
|
-
], ContentCaptureProcessResponsible.prototype, "service", void 0);
|
|
168
|
-
ContentCaptureProcessResponsible = __decorate([
|
|
169
|
-
(0, mongoose_1.Schema)({ _id: false })
|
|
170
|
-
], ContentCaptureProcessResponsible);
|
|
171
|
-
exports.ContentCaptureProcessResponsible = ContentCaptureProcessResponsible;
|
|
172
|
-
exports.ContentCaptureProcessResponsibles = ContentCaptureProcessResponsible;
|
|
173
|
-
exports.ContentCaptureProcessResponsibleSchema = mongoose_1.SchemaFactory.createForClass(ContentCaptureProcessResponsible);
|
|
174
|
-
exports.ContentCaptureProcessResponsiblesSchema = exports.ContentCaptureProcessResponsibleSchema;
|
|
175
144
|
let ContentCaptureProcess = class ContentCaptureProcess {
|
|
176
145
|
};
|
|
177
146
|
__decorate([
|
|
@@ -195,8 +164,8 @@ __decorate([
|
|
|
195
164
|
__metadata("design:type", String)
|
|
196
165
|
], ContentCaptureProcess.prototype, "primetagId", void 0);
|
|
197
166
|
__decorate([
|
|
198
|
-
(0, mongoose_1.Prop)({ type:
|
|
199
|
-
__metadata("design:type",
|
|
167
|
+
(0, mongoose_1.Prop)({ type: [responsible_schema_1.ResponsibleSchema], required: false, default: [] }),
|
|
168
|
+
__metadata("design:type", Array)
|
|
200
169
|
], ContentCaptureProcess.prototype, "responsible", void 0);
|
|
201
170
|
__decorate([
|
|
202
171
|
(0, mongoose_1.Prop)({
|
|
@@ -24,20 +24,8 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
26
|
import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
|
+
import { Responsible } from './responsible.schema';
|
|
27
28
|
export type ProspectDocument = HydratedDocument<Prospect>;
|
|
28
|
-
export declare class ProspectResponsible {
|
|
29
|
-
name: string;
|
|
30
|
-
email: string;
|
|
31
|
-
}
|
|
32
|
-
export declare const ProspectResponsibleSchema: MongooseSchema<ProspectResponsible, import("mongoose").Model<ProspectResponsible, any, any, any, import("mongoose").Document<unknown, any, ProspectResponsible, any, {}> & ProspectResponsible & {
|
|
33
|
-
_id: Types.ObjectId;
|
|
34
|
-
} & {
|
|
35
|
-
__v: number;
|
|
36
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ProspectResponsible, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ProspectResponsible>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ProspectResponsible> & {
|
|
37
|
-
_id: Types.ObjectId;
|
|
38
|
-
} & {
|
|
39
|
-
__v: number;
|
|
40
|
-
}>;
|
|
41
29
|
export declare class ProspectNote {
|
|
42
30
|
text: string;
|
|
43
31
|
author: string;
|
|
@@ -59,7 +47,7 @@ export declare class Prospect {
|
|
|
59
47
|
value?: number;
|
|
60
48
|
status: 'open' | 'won' | 'lost';
|
|
61
49
|
hot: boolean;
|
|
62
|
-
responsible:
|
|
50
|
+
responsible: Responsible[];
|
|
63
51
|
lastContactAt: Date;
|
|
64
52
|
lastReminderAt?: Date;
|
|
65
53
|
notes: ProspectNote[];
|