@grapadigital/shared-schemas 1.0.225 → 1.0.227
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/schemas/benchmark.schema.d.ts +3 -1
- package/dist/schemas/benchmark.schema.js +4 -2
- package/dist/schemas/client.schema.d.ts +1 -1
- package/dist/schemas/client.schema.js +12 -12
- package/dist/schemas/content-capture-process.schema.d.ts +1 -1
- package/dist/schemas/content-capture-process.schema.js +1 -1
- package/dist/schemas/content.schema.d.ts +20 -14
- package/dist/schemas/content.schema.js +24 -23
- package/dist/utils/merge-metrics-breakdown.util.js +1 -1
- package/package.json +1 -1
- package/src/schemas/benchmark.schema.ts +4 -2
- package/src/schemas/client.schema.ts +12 -12
- package/src/schemas/content-capture-process.schema.ts +1 -1
- package/src/schemas/content.schema.ts +23 -15
- package/src/utils/merge-metrics-breakdown.util.ts +1 -1
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
26
|
import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
27
|
import { Client } from './client.schema';
|
|
28
|
-
|
|
28
|
+
/** Métrica do benchmark, com nomes por extenso (GD-751). */
|
|
29
|
+
export declare const BENCHMARK_METRIC_VALUES: readonly ["reach", "engagementRate", "costPerThousandImpressions", "costPerEngagement"];
|
|
30
|
+
export type BenchmarkMetric = (typeof BENCHMARK_METRIC_VALUES)[number];
|
|
29
31
|
export type BenchmarkMode = 'organic' | 'paid';
|
|
30
32
|
export type BenchmarkDocument = HydratedDocument<Benchmark>;
|
|
31
33
|
export declare class Benchmark {
|
|
@@ -9,9 +9,11 @@ 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.BenchmarkModel = exports.BenchmarkSchema = exports.Benchmark = void 0;
|
|
12
|
+
exports.BenchmarkModel = exports.BenchmarkSchema = exports.Benchmark = exports.BENCHMARK_METRIC_VALUES = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const mongoose_2 = require("mongoose");
|
|
15
|
+
/** Métrica do benchmark, com nomes por extenso (GD-751). */
|
|
16
|
+
exports.BENCHMARK_METRIC_VALUES = ['reach', 'engagementRate', 'costPerThousandImpressions', 'costPerEngagement'];
|
|
15
17
|
let Benchmark = class Benchmark {
|
|
16
18
|
};
|
|
17
19
|
__decorate([
|
|
@@ -27,7 +29,7 @@ __decorate([
|
|
|
27
29
|
__metadata("design:type", String)
|
|
28
30
|
], Benchmark.prototype, "mode", void 0);
|
|
29
31
|
__decorate([
|
|
30
|
-
(0, mongoose_1.Prop)({ type: String, enum:
|
|
32
|
+
(0, mongoose_1.Prop)({ type: String, enum: exports.BENCHMARK_METRIC_VALUES, required: true }),
|
|
31
33
|
__metadata("design:type", String)
|
|
32
34
|
], Benchmark.prototype, "metric", void 0);
|
|
33
35
|
__decorate([
|
|
@@ -40,7 +40,7 @@ export type ClientCustomization = (typeof CLIENT_CUSTOMIZATION_VALUES)[number];
|
|
|
40
40
|
* `viralReachEngagementRate` é o limite de viral e só vale no Tier.
|
|
41
41
|
* Ver GD-687.
|
|
42
42
|
*/
|
|
43
|
-
export declare const CLIENT_GOAL_METRIC_VALUES: readonly ["potentialReach", "reachCount", "impressionCount", "engagementCount", "engagementRate", "reachEngagementRate", "qualifiedEngagementRate", "effectiveReach", "
|
|
43
|
+
export declare const CLIENT_GOAL_METRIC_VALUES: readonly ["potentialReach", "reachCount", "impressionCount", "engagementCount", "engagementRate", "reachEngagementRate", "qualifiedEngagementRate", "effectiveReach", "earnedMediaValue", "score", "costPerInfluency", "costPerImpact", "costPerEngagement", "savedCount", "shareCount", "videoCompletionRate", "viralReachEngagementRate"];
|
|
44
44
|
export type ClientGoalMetric = (typeof CLIENT_GOAL_METRIC_VALUES)[number];
|
|
45
45
|
export type ClientGoalMetricUnit = 'count' | 'rate' | 'currency';
|
|
46
46
|
/** Unidade de cada métrica. `rate` é guardado como fração (0,10 = 10%). */
|
|
@@ -35,14 +35,14 @@ exports.CLIENT_GOAL_METRIC_VALUES = [
|
|
|
35
35
|
'reachEngagementRate',
|
|
36
36
|
'qualifiedEngagementRate',
|
|
37
37
|
'effectiveReach',
|
|
38
|
-
'
|
|
38
|
+
'earnedMediaValue',
|
|
39
39
|
'score',
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
40
|
+
'costPerInfluency',
|
|
41
|
+
'costPerImpact',
|
|
42
|
+
'costPerEngagement',
|
|
43
43
|
'savedCount',
|
|
44
|
-
'
|
|
45
|
-
'
|
|
44
|
+
'shareCount',
|
|
45
|
+
'videoCompletionRate',
|
|
46
46
|
'viralReachEngagementRate',
|
|
47
47
|
];
|
|
48
48
|
/** Unidade de cada métrica. `rate` é guardado como fração (0,10 = 10%). */
|
|
@@ -55,14 +55,14 @@ exports.CLIENT_GOAL_METRIC_UNITS = {
|
|
|
55
55
|
reachEngagementRate: 'rate',
|
|
56
56
|
qualifiedEngagementRate: 'rate',
|
|
57
57
|
effectiveReach: 'count',
|
|
58
|
-
|
|
58
|
+
earnedMediaValue: 'currency',
|
|
59
59
|
score: 'count',
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
costPerInfluency: 'currency',
|
|
61
|
+
costPerImpact: 'currency',
|
|
62
|
+
costPerEngagement: 'currency',
|
|
63
63
|
savedCount: 'count',
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
shareCount: 'count',
|
|
65
|
+
videoCompletionRate: 'rate',
|
|
66
66
|
viralReachEngagementRate: 'rate',
|
|
67
67
|
};
|
|
68
68
|
let Cluster = class Cluster {
|
|
@@ -35,7 +35,7 @@ export declare class ContentCaptureProcessMetrics {
|
|
|
35
35
|
sentimentPositive?: number | null;
|
|
36
36
|
sentimentNegative?: number | null;
|
|
37
37
|
sentimentNeutral?: number | null;
|
|
38
|
-
|
|
38
|
+
earnedMediaValue?: number | null;
|
|
39
39
|
}
|
|
40
40
|
export declare const ContentCaptureProcessMetricsSchema: MongooseSchema<ContentCaptureProcessMetrics, import("mongoose").Model<ContentCaptureProcessMetrics, any, any, any, import("mongoose").Document<unknown, any, ContentCaptureProcessMetrics, any, {}> & ContentCaptureProcessMetrics & {
|
|
41
41
|
_id: Types.ObjectId;
|
|
@@ -46,7 +46,7 @@ __decorate([
|
|
|
46
46
|
__decorate([
|
|
47
47
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
48
48
|
__metadata("design:type", Object)
|
|
49
|
-
], ContentCaptureProcessMetrics.prototype, "
|
|
49
|
+
], ContentCaptureProcessMetrics.prototype, "earnedMediaValue", void 0);
|
|
50
50
|
ContentCaptureProcessMetrics = __decorate([
|
|
51
51
|
(0, mongoose_1.Schema)({ _id: false })
|
|
52
52
|
], ContentCaptureProcessMetrics);
|
|
@@ -92,7 +92,7 @@ export declare class Metrics {
|
|
|
92
92
|
likeCount?: number | null;
|
|
93
93
|
commentCount?: number | null;
|
|
94
94
|
savedCount?: number | null;
|
|
95
|
-
|
|
95
|
+
shareCount?: number | null;
|
|
96
96
|
storyCount?: number | null;
|
|
97
97
|
tapBackCount?: number | null;
|
|
98
98
|
clickCount?: number | null;
|
|
@@ -102,7 +102,8 @@ export declare class Metrics {
|
|
|
102
102
|
exitCount?: number | null;
|
|
103
103
|
favoriteCount?: number | null;
|
|
104
104
|
dislikeCount?: number | null;
|
|
105
|
-
|
|
105
|
+
/** Valor de Mídia Estimado (EMV), da Primetag. Ver GD-751. */
|
|
106
|
+
earnedMediaValue?: number | null;
|
|
106
107
|
engagementCount?: number | null;
|
|
107
108
|
engagementRate?: number | null;
|
|
108
109
|
effectiveReach?: number | null;
|
|
@@ -110,9 +111,12 @@ export declare class Metrics {
|
|
|
110
111
|
qualifiedEngagementRate?: number | null;
|
|
111
112
|
score?: number | null;
|
|
112
113
|
allocatedBudgetAmount?: number | null;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
/** Custo por Influência (CPMI): investimento ÷ (alcance × Score) × 1000. Ver GD-751. */
|
|
115
|
+
costPerInfluency?: number | null;
|
|
116
|
+
/** Custo por Mil Impressões (CPM): investimento ÷ impressões × 1000. Ver GD-751. */
|
|
117
|
+
costPerThousandImpressions?: number | null;
|
|
118
|
+
/** Custo por Engajamento (CPE): investimento ÷ engajamento. Ver GD-751. */
|
|
119
|
+
costPerEngagement?: number | null;
|
|
116
120
|
/**
|
|
117
121
|
* Alcance Potencial (o antigo PO Reach): seguidores no momento do post. Em
|
|
118
122
|
* Content.metrics soma o autor e todos os coautores. Ver GD-703.
|
|
@@ -154,7 +158,7 @@ export declare const ContentCollabSchema: MongooseSchema<ContentCollab, import("
|
|
|
154
158
|
__v: number;
|
|
155
159
|
}>;
|
|
156
160
|
/** Chaves brutas de Metrics que têm parte Orgânica e Impulsionada. Ver GD-707. */
|
|
157
|
-
export declare const CONTENT_BASE_METRIC_KEYS: readonly ["impressionCount", "reachCount", "likeCount", "commentCount", "savedCount", "
|
|
161
|
+
export declare const CONTENT_BASE_METRIC_KEYS: readonly ["impressionCount", "reachCount", "likeCount", "commentCount", "savedCount", "shareCount", "storyCount", "tapBackCount", "clickCount", "replyCount", "tapForwardCount", "swipeForwardCount", "exitCount", "favoriteCount", "dislikeCount", "earnedMediaValue"];
|
|
158
162
|
export type ContentBaseMetricKey = (typeof CONTENT_BASE_METRIC_KEYS)[number];
|
|
159
163
|
export declare class ContentBaseMetrics {
|
|
160
164
|
impressionCount?: number | null;
|
|
@@ -162,7 +166,7 @@ export declare class ContentBaseMetrics {
|
|
|
162
166
|
likeCount?: number | null;
|
|
163
167
|
commentCount?: number | null;
|
|
164
168
|
savedCount?: number | null;
|
|
165
|
-
|
|
169
|
+
shareCount?: number | null;
|
|
166
170
|
storyCount?: number | null;
|
|
167
171
|
tapBackCount?: number | null;
|
|
168
172
|
clickCount?: number | null;
|
|
@@ -172,7 +176,8 @@ export declare class ContentBaseMetrics {
|
|
|
172
176
|
exitCount?: number | null;
|
|
173
177
|
favoriteCount?: number | null;
|
|
174
178
|
dislikeCount?: number | null;
|
|
175
|
-
|
|
179
|
+
/** Valor de Mídia Estimado (EMV), da Primetag. Ver GD-751. */
|
|
180
|
+
earnedMediaValue?: number | null;
|
|
176
181
|
}
|
|
177
182
|
export declare const ContentBaseMetricsSchema: MongooseSchema<ContentBaseMetrics, import("mongoose").Model<ContentBaseMetrics, any, any, any, import("mongoose").Document<unknown, any, ContentBaseMetrics, any, {}> & ContentBaseMetrics & {
|
|
178
183
|
_id: Types.ObjectId;
|
|
@@ -206,8 +211,8 @@ export declare class ContentVideo {
|
|
|
206
211
|
duration?: number | null;
|
|
207
212
|
/** Tempo total assistido, somando todas as visualizações, em segundos. */
|
|
208
213
|
watchTime?: number | null;
|
|
209
|
-
/** (watchTime ÷ duration) ÷ impressionCount, sem teto. */
|
|
210
|
-
|
|
214
|
+
/** Taxa de Conclusão do Vídeo (VCR): (watchTime ÷ duration) ÷ impressionCount, sem teto. Ver GD-751. */
|
|
215
|
+
videoCompletionRate?: number | null;
|
|
211
216
|
}
|
|
212
217
|
export declare const ContentVideoSchema: MongooseSchema<ContentVideo, import("mongoose").Model<ContentVideo, any, any, any, import("mongoose").Document<unknown, any, ContentVideo, any, {}> & ContentVideo & {
|
|
213
218
|
_id: Types.ObjectId;
|
|
@@ -231,17 +236,18 @@ export declare const ContentMetricsHistoryEntrySchema: MongooseSchema<ContentMet
|
|
|
231
236
|
} & {
|
|
232
237
|
__v: number;
|
|
233
238
|
}>;
|
|
234
|
-
|
|
239
|
+
/** Métricas estimadas pelo porte do perfil, para quando a rede não informa. Ver GD-751. */
|
|
240
|
+
export declare class EstimatedMetrics {
|
|
235
241
|
impressionCount?: number | null;
|
|
236
242
|
reachCount?: number | null;
|
|
237
243
|
engagementCount?: number | null;
|
|
238
244
|
engagementRate?: number | null;
|
|
239
245
|
}
|
|
240
|
-
export declare const
|
|
246
|
+
export declare const EstimatedMetricsSchema: MongooseSchema<EstimatedMetrics, import("mongoose").Model<EstimatedMetrics, any, any, any, import("mongoose").Document<unknown, any, EstimatedMetrics, any, {}> & EstimatedMetrics & {
|
|
241
247
|
_id: Types.ObjectId;
|
|
242
248
|
} & {
|
|
243
249
|
__v: number;
|
|
244
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions,
|
|
250
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EstimatedMetrics, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<EstimatedMetrics>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EstimatedMetrics> & {
|
|
245
251
|
_id: Types.ObjectId;
|
|
246
252
|
} & {
|
|
247
253
|
__v: number;
|
|
@@ -301,7 +307,7 @@ export declare class Content {
|
|
|
301
307
|
*/
|
|
302
308
|
manualMetrics?: string[];
|
|
303
309
|
video?: ContentVideo | null;
|
|
304
|
-
|
|
310
|
+
estimatedMetrics?: EstimatedMetrics | null;
|
|
305
311
|
googleSheetRow?: string;
|
|
306
312
|
createdAt?: Date;
|
|
307
313
|
updatedAt?: Date;
|
|
@@ -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.ContentModel = exports.ContentSchema = exports.Content = exports.ContentStatusChangedBySchema = exports.ContentStatusChangedBy = exports.CONTENT_CLASSIFICATION_SOURCE_VALUES = exports.CONTENT_METRICS_SOURCE_VALUES = exports.CONTENT_COMMENT_COUNT_SOURCE_VALUES = exports.CONTENT_REPORTABLE_STATUS_VALUES = exports.CONTENT_STATUS_VALUES = exports.
|
|
12
|
+
exports.ContentModel = exports.ContentSchema = exports.Content = exports.ContentStatusChangedBySchema = exports.ContentStatusChangedBy = exports.CONTENT_CLASSIFICATION_SOURCE_VALUES = exports.CONTENT_METRICS_SOURCE_VALUES = exports.CONTENT_COMMENT_COUNT_SOURCE_VALUES = exports.CONTENT_REPORTABLE_STATUS_VALUES = exports.CONTENT_STATUS_VALUES = exports.EstimatedMetricsSchema = exports.EstimatedMetrics = exports.ContentMetricsHistoryEntrySchema = exports.ContentMetricsHistoryEntry = exports.ContentVideoSchema = exports.ContentVideo = exports.ContentMetricsBreakdownSchema = exports.ContentMetricsBreakdown = exports.ContentBaseMetricsSchema = exports.ContentBaseMetrics = exports.CONTENT_BASE_METRIC_KEYS = exports.ContentCollabSchema = exports.ContentCollab = exports.MetricsSchema = exports.Metrics = exports.SentimentAnalysisSchema = exports.SentimentAnalysis = exports.SentimentScoreSchema = exports.SentimentScore = exports.WordCloudSchema = exports.WordCloud = exports.SentimentCommentSchema = exports.SentimentComment = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const mongoose_2 = require("mongoose");
|
|
15
15
|
const normalize_content_link_util_1 = require("../utils/normalize-content-link.util");
|
|
@@ -126,7 +126,7 @@ __decorate([
|
|
|
126
126
|
__decorate([
|
|
127
127
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
128
128
|
__metadata("design:type", Object)
|
|
129
|
-
], Metrics.prototype, "
|
|
129
|
+
], Metrics.prototype, "shareCount", void 0);
|
|
130
130
|
__decorate([
|
|
131
131
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
132
132
|
__metadata("design:type", Object)
|
|
@@ -166,7 +166,7 @@ __decorate([
|
|
|
166
166
|
__decorate([
|
|
167
167
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
168
168
|
__metadata("design:type", Object)
|
|
169
|
-
], Metrics.prototype, "
|
|
169
|
+
], Metrics.prototype, "earnedMediaValue", void 0);
|
|
170
170
|
__decorate([
|
|
171
171
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
172
172
|
__metadata("design:type", Object)
|
|
@@ -198,15 +198,15 @@ __decorate([
|
|
|
198
198
|
__decorate([
|
|
199
199
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
200
200
|
__metadata("design:type", Object)
|
|
201
|
-
], Metrics.prototype, "
|
|
201
|
+
], Metrics.prototype, "costPerInfluency", void 0);
|
|
202
202
|
__decorate([
|
|
203
203
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
204
204
|
__metadata("design:type", Object)
|
|
205
|
-
], Metrics.prototype, "
|
|
205
|
+
], Metrics.prototype, "costPerThousandImpressions", void 0);
|
|
206
206
|
__decorate([
|
|
207
207
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
208
208
|
__metadata("design:type", Object)
|
|
209
|
-
], Metrics.prototype, "
|
|
209
|
+
], Metrics.prototype, "costPerEngagement", void 0);
|
|
210
210
|
__decorate([
|
|
211
211
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
212
212
|
__metadata("design:type", Object)
|
|
@@ -255,7 +255,7 @@ exports.CONTENT_BASE_METRIC_KEYS = [
|
|
|
255
255
|
'likeCount',
|
|
256
256
|
'commentCount',
|
|
257
257
|
'savedCount',
|
|
258
|
-
'
|
|
258
|
+
'shareCount',
|
|
259
259
|
'storyCount',
|
|
260
260
|
'tapBackCount',
|
|
261
261
|
'clickCount',
|
|
@@ -265,7 +265,7 @@ exports.CONTENT_BASE_METRIC_KEYS = [
|
|
|
265
265
|
'exitCount',
|
|
266
266
|
'favoriteCount',
|
|
267
267
|
'dislikeCount',
|
|
268
|
-
'
|
|
268
|
+
'earnedMediaValue',
|
|
269
269
|
];
|
|
270
270
|
let ContentBaseMetrics = class ContentBaseMetrics {
|
|
271
271
|
};
|
|
@@ -292,7 +292,7 @@ __decorate([
|
|
|
292
292
|
__decorate([
|
|
293
293
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
294
294
|
__metadata("design:type", Object)
|
|
295
|
-
], ContentBaseMetrics.prototype, "
|
|
295
|
+
], ContentBaseMetrics.prototype, "shareCount", void 0);
|
|
296
296
|
__decorate([
|
|
297
297
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
298
298
|
__metadata("design:type", Object)
|
|
@@ -332,7 +332,7 @@ __decorate([
|
|
|
332
332
|
__decorate([
|
|
333
333
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
334
334
|
__metadata("design:type", Object)
|
|
335
|
-
], ContentBaseMetrics.prototype, "
|
|
335
|
+
], ContentBaseMetrics.prototype, "earnedMediaValue", void 0);
|
|
336
336
|
ContentBaseMetrics = __decorate([
|
|
337
337
|
(0, mongoose_1.Schema)({ _id: false })
|
|
338
338
|
], ContentBaseMetrics);
|
|
@@ -371,7 +371,7 @@ __decorate([
|
|
|
371
371
|
__decorate([
|
|
372
372
|
(0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
|
|
373
373
|
__metadata("design:type", Object)
|
|
374
|
-
], ContentVideo.prototype, "
|
|
374
|
+
], ContentVideo.prototype, "videoCompletionRate", void 0);
|
|
375
375
|
ContentVideo = __decorate([
|
|
376
376
|
(0, mongoose_1.Schema)({ _id: false })
|
|
377
377
|
], ContentVideo);
|
|
@@ -392,29 +392,30 @@ ContentMetricsHistoryEntry = __decorate([
|
|
|
392
392
|
], ContentMetricsHistoryEntry);
|
|
393
393
|
exports.ContentMetricsHistoryEntry = ContentMetricsHistoryEntry;
|
|
394
394
|
exports.ContentMetricsHistoryEntrySchema = mongoose_1.SchemaFactory.createForClass(ContentMetricsHistoryEntry);
|
|
395
|
-
|
|
395
|
+
/** Métricas estimadas pelo porte do perfil, para quando a rede não informa. Ver GD-751. */
|
|
396
|
+
let EstimatedMetrics = class EstimatedMetrics {
|
|
396
397
|
};
|
|
397
398
|
__decorate([
|
|
398
399
|
(0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
|
|
399
400
|
__metadata("design:type", Object)
|
|
400
|
-
],
|
|
401
|
+
], EstimatedMetrics.prototype, "impressionCount", void 0);
|
|
401
402
|
__decorate([
|
|
402
403
|
(0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
|
|
403
404
|
__metadata("design:type", Object)
|
|
404
|
-
],
|
|
405
|
+
], EstimatedMetrics.prototype, "reachCount", void 0);
|
|
405
406
|
__decorate([
|
|
406
407
|
(0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
|
|
407
408
|
__metadata("design:type", Object)
|
|
408
|
-
],
|
|
409
|
+
], EstimatedMetrics.prototype, "engagementCount", void 0);
|
|
409
410
|
__decorate([
|
|
410
411
|
(0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
|
|
411
412
|
__metadata("design:type", Object)
|
|
412
|
-
],
|
|
413
|
-
|
|
413
|
+
], EstimatedMetrics.prototype, "engagementRate", void 0);
|
|
414
|
+
EstimatedMetrics = __decorate([
|
|
414
415
|
(0, mongoose_1.Schema)({ _id: false })
|
|
415
|
-
],
|
|
416
|
-
exports.
|
|
417
|
-
exports.
|
|
416
|
+
], EstimatedMetrics);
|
|
417
|
+
exports.EstimatedMetrics = EstimatedMetrics;
|
|
418
|
+
exports.EstimatedMetricsSchema = mongoose_1.SchemaFactory.createForClass(EstimatedMetrics);
|
|
418
419
|
// error: captura de comentários falhou ou a classificação falhou por inteiro.
|
|
419
420
|
// partial_error: parte dos comentários não foi classificada. Nenhum dos dois
|
|
420
421
|
// volta sozinho pro pipeline — só por reenvio manual (aprovação).
|
|
@@ -576,9 +577,9 @@ __decorate([
|
|
|
576
577
|
__metadata("design:type", Object)
|
|
577
578
|
], Content.prototype, "video", void 0);
|
|
578
579
|
__decorate([
|
|
579
|
-
(0, mongoose_1.Prop)({ type: exports.
|
|
580
|
-
__metadata("design:type",
|
|
581
|
-
], Content.prototype, "
|
|
580
|
+
(0, mongoose_1.Prop)({ type: exports.EstimatedMetricsSchema, required: false, default: null }),
|
|
581
|
+
__metadata("design:type", Object)
|
|
582
|
+
], Content.prototype, "estimatedMetrics", void 0);
|
|
582
583
|
__decorate([
|
|
583
584
|
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
584
585
|
__metadata("design:type", String)
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.mergeMetricsBreakdown = void 0;
|
|
4
4
|
const content_schema_1 = require("../schemas/content.schema");
|
|
5
5
|
// Partes que, se digitadas à mão, fazem o engajamento virar a soma.
|
|
6
|
-
const ENGAGEMENT_KEYS = ['likeCount', 'commentCount', '
|
|
6
|
+
const ENGAGEMENT_KEYS = ['likeCount', 'commentCount', 'shareCount', 'savedCount'];
|
|
7
7
|
const sumParts = (organic, boosted) => organic == null && boosted == null ? null : (organic ?? 0) + (boosted ?? 0);
|
|
8
8
|
/**
|
|
9
9
|
* Totais de Content.metrics a partir da divisão Orgânico e Impulsionado. Ver GD-707.
|
package/package.json
CHANGED
|
@@ -2,7 +2,9 @@ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
|
|
2
2
|
import { HydratedDocument, Schema as MongooseSchema, Types, model as MongooseModel } from 'mongoose';
|
|
3
3
|
import { Client } from './client.schema';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/** Métrica do benchmark, com nomes por extenso (GD-751). */
|
|
6
|
+
export const BENCHMARK_METRIC_VALUES = ['reach', 'engagementRate', 'costPerThousandImpressions', 'costPerEngagement'] as const;
|
|
7
|
+
export type BenchmarkMetric = (typeof BENCHMARK_METRIC_VALUES)[number];
|
|
6
8
|
export type BenchmarkMode = 'organic' | 'paid';
|
|
7
9
|
export type BenchmarkDocument = HydratedDocument<Benchmark>;
|
|
8
10
|
|
|
@@ -17,7 +19,7 @@ export class Benchmark {
|
|
|
17
19
|
@Prop({ type: String, enum: ['organic', 'paid'], required: true })
|
|
18
20
|
mode: BenchmarkMode;
|
|
19
21
|
|
|
20
|
-
@Prop({ type: String, enum:
|
|
22
|
+
@Prop({ type: String, enum: BENCHMARK_METRIC_VALUES, required: true })
|
|
21
23
|
metric: BenchmarkMetric;
|
|
22
24
|
|
|
23
25
|
@Prop({ type: Number, required: true })
|
|
@@ -34,14 +34,14 @@ export const CLIENT_GOAL_METRIC_VALUES = [
|
|
|
34
34
|
'reachEngagementRate',
|
|
35
35
|
'qualifiedEngagementRate',
|
|
36
36
|
'effectiveReach',
|
|
37
|
-
'
|
|
37
|
+
'earnedMediaValue',
|
|
38
38
|
'score',
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
39
|
+
'costPerInfluency',
|
|
40
|
+
'costPerImpact',
|
|
41
|
+
'costPerEngagement',
|
|
42
42
|
'savedCount',
|
|
43
|
-
'
|
|
44
|
-
'
|
|
43
|
+
'shareCount',
|
|
44
|
+
'videoCompletionRate',
|
|
45
45
|
'viralReachEngagementRate',
|
|
46
46
|
] as const;
|
|
47
47
|
export type ClientGoalMetric = (typeof CLIENT_GOAL_METRIC_VALUES)[number];
|
|
@@ -58,14 +58,14 @@ export const CLIENT_GOAL_METRIC_UNITS: Record<ClientGoalMetric, ClientGoalMetric
|
|
|
58
58
|
reachEngagementRate: 'rate',
|
|
59
59
|
qualifiedEngagementRate: 'rate',
|
|
60
60
|
effectiveReach: 'count',
|
|
61
|
-
|
|
61
|
+
earnedMediaValue: 'currency',
|
|
62
62
|
score: 'count',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
costPerInfluency: 'currency',
|
|
64
|
+
costPerImpact: 'currency',
|
|
65
|
+
costPerEngagement: 'currency',
|
|
66
66
|
savedCount: 'count',
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
shareCount: 'count',
|
|
68
|
+
videoCompletionRate: 'rate',
|
|
69
69
|
viralReachEngagementRate: 'rate',
|
|
70
70
|
};
|
|
71
71
|
|
|
@@ -34,7 +34,7 @@ export class ContentCaptureProcessMetrics {
|
|
|
34
34
|
sentimentNeutral?: number | null;
|
|
35
35
|
|
|
36
36
|
@Prop({ type: Number, required: false, default: null })
|
|
37
|
-
|
|
37
|
+
earnedMediaValue?: number | null;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export const ContentCaptureProcessMetricsSchema = SchemaFactory.createForClass(
|
|
@@ -94,7 +94,7 @@ export class Metrics {
|
|
|
94
94
|
savedCount?: number | null;
|
|
95
95
|
|
|
96
96
|
@Prop({ type: Number, required: false, default: null })
|
|
97
|
-
|
|
97
|
+
shareCount?: number | null;
|
|
98
98
|
|
|
99
99
|
@Prop({ type: Number, required: false, default: null })
|
|
100
100
|
storyCount?: number | null;
|
|
@@ -123,8 +123,9 @@ export class Metrics {
|
|
|
123
123
|
@Prop({ type: Number, required: false, default: null })
|
|
124
124
|
dislikeCount?: number | null;
|
|
125
125
|
|
|
126
|
+
/** Valor de Mídia Estimado (EMV), da Primetag. Ver GD-751. */
|
|
126
127
|
@Prop({ type: Number, required: false, default: null })
|
|
127
|
-
|
|
128
|
+
earnedMediaValue?: number | null;
|
|
128
129
|
|
|
129
130
|
@Prop({ type: Number, required: false, default: null })
|
|
130
131
|
engagementCount?: number | null;
|
|
@@ -149,14 +150,17 @@ export class Metrics {
|
|
|
149
150
|
@Prop({ type: Number, required: false, default: null })
|
|
150
151
|
allocatedBudgetAmount?: number | null;
|
|
151
152
|
|
|
153
|
+
/** Custo por Influência (CPMI): investimento ÷ (alcance × Score) × 1000. Ver GD-751. */
|
|
152
154
|
@Prop({ type: Number, required: false, default: null })
|
|
153
|
-
|
|
155
|
+
costPerInfluency?: number | null;
|
|
154
156
|
|
|
157
|
+
/** Custo por Mil Impressões (CPM): investimento ÷ impressões × 1000. Ver GD-751. */
|
|
155
158
|
@Prop({ type: Number, required: false, default: null })
|
|
156
|
-
|
|
159
|
+
costPerThousandImpressions?: number | null;
|
|
157
160
|
|
|
161
|
+
/** Custo por Engajamento (CPE): investimento ÷ engajamento. Ver GD-751. */
|
|
158
162
|
@Prop({ type: Number, required: false, default: null })
|
|
159
|
-
|
|
163
|
+
costPerEngagement?: number | null;
|
|
160
164
|
|
|
161
165
|
/**
|
|
162
166
|
* Alcance Potencial (o antigo PO Reach): seguidores no momento do post. Em
|
|
@@ -206,7 +210,7 @@ export const CONTENT_BASE_METRIC_KEYS = [
|
|
|
206
210
|
'likeCount',
|
|
207
211
|
'commentCount',
|
|
208
212
|
'savedCount',
|
|
209
|
-
'
|
|
213
|
+
'shareCount',
|
|
210
214
|
'storyCount',
|
|
211
215
|
'tapBackCount',
|
|
212
216
|
'clickCount',
|
|
@@ -216,7 +220,7 @@ export const CONTENT_BASE_METRIC_KEYS = [
|
|
|
216
220
|
'exitCount',
|
|
217
221
|
'favoriteCount',
|
|
218
222
|
'dislikeCount',
|
|
219
|
-
'
|
|
223
|
+
'earnedMediaValue',
|
|
220
224
|
] as const;
|
|
221
225
|
export type ContentBaseMetricKey = (typeof CONTENT_BASE_METRIC_KEYS)[number];
|
|
222
226
|
|
|
@@ -238,7 +242,7 @@ export class ContentBaseMetrics {
|
|
|
238
242
|
savedCount?: number | null;
|
|
239
243
|
|
|
240
244
|
@Prop({ type: Number, required: false, default: null })
|
|
241
|
-
|
|
245
|
+
shareCount?: number | null;
|
|
242
246
|
|
|
243
247
|
@Prop({ type: Number, required: false, default: null })
|
|
244
248
|
storyCount?: number | null;
|
|
@@ -267,8 +271,10 @@ export class ContentBaseMetrics {
|
|
|
267
271
|
@Prop({ type: Number, required: false, default: null })
|
|
268
272
|
dislikeCount?: number | null;
|
|
269
273
|
|
|
274
|
+
/** Valor de Mídia Estimado (EMV), da Primetag. Ver GD-751. */
|
|
270
275
|
@Prop({ type: Number, required: false, default: null })
|
|
271
|
-
|
|
276
|
+
earnedMediaValue?: number | null;
|
|
277
|
+
|
|
272
278
|
}
|
|
273
279
|
|
|
274
280
|
export const ContentBaseMetricsSchema = SchemaFactory.createForClass(ContentBaseMetrics);
|
|
@@ -299,9 +305,10 @@ export class ContentVideo {
|
|
|
299
305
|
@Prop({ type: Number, required: false, default: null })
|
|
300
306
|
watchTime?: number | null;
|
|
301
307
|
|
|
302
|
-
/** (watchTime ÷ duration) ÷ impressionCount, sem teto. */
|
|
308
|
+
/** Taxa de Conclusão do Vídeo (VCR): (watchTime ÷ duration) ÷ impressionCount, sem teto. Ver GD-751. */
|
|
303
309
|
@Prop({ type: Number, required: false, default: null })
|
|
304
|
-
|
|
310
|
+
videoCompletionRate?: number | null;
|
|
311
|
+
|
|
305
312
|
}
|
|
306
313
|
|
|
307
314
|
export const ContentVideoSchema = SchemaFactory.createForClass(ContentVideo);
|
|
@@ -317,8 +324,9 @@ export class ContentMetricsHistoryEntry {
|
|
|
317
324
|
|
|
318
325
|
export const ContentMetricsHistoryEntrySchema = SchemaFactory.createForClass(ContentMetricsHistoryEntry);
|
|
319
326
|
|
|
327
|
+
/** Métricas estimadas pelo porte do perfil, para quando a rede não informa. Ver GD-751. */
|
|
320
328
|
@Schema({ _id: false })
|
|
321
|
-
export class
|
|
329
|
+
export class EstimatedMetrics {
|
|
322
330
|
@Prop({ type: Number, required: true, default: null })
|
|
323
331
|
impressionCount?: number | null;
|
|
324
332
|
|
|
@@ -332,7 +340,7 @@ export class Estimates {
|
|
|
332
340
|
engagementRate?: number | null;
|
|
333
341
|
}
|
|
334
342
|
|
|
335
|
-
export const
|
|
343
|
+
export const EstimatedMetricsSchema = SchemaFactory.createForClass(EstimatedMetrics);
|
|
336
344
|
|
|
337
345
|
// error: captura de comentários falhou ou a classificação falhou por inteiro.
|
|
338
346
|
// partial_error: parte dos comentários não foi classificada. Nenhum dos dois
|
|
@@ -496,8 +504,8 @@ export class Content {
|
|
|
496
504
|
@Prop({ type: ContentVideoSchema, required: false, default: null })
|
|
497
505
|
video?: ContentVideo | null;
|
|
498
506
|
|
|
499
|
-
@Prop({ type:
|
|
500
|
-
|
|
507
|
+
@Prop({ type: EstimatedMetricsSchema, required: false, default: null })
|
|
508
|
+
estimatedMetrics?: EstimatedMetrics | null;
|
|
501
509
|
|
|
502
510
|
@Prop({ type: String, required: false })
|
|
503
511
|
googleSheetRow?: string;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from '../schemas/content.schema';
|
|
8
8
|
|
|
9
9
|
// Partes que, se digitadas à mão, fazem o engajamento virar a soma.
|
|
10
|
-
const ENGAGEMENT_KEYS: ContentBaseMetricKey[] = ['likeCount', 'commentCount', '
|
|
10
|
+
const ENGAGEMENT_KEYS: ContentBaseMetricKey[] = ['likeCount', 'commentCount', 'shareCount', 'savedCount'];
|
|
11
11
|
|
|
12
12
|
const sumParts = (organic?: number | null, boosted?: number | null): number | null =>
|
|
13
13
|
organic == null && boosted == null ? null : (organic ?? 0) + (boosted ?? 0);
|