@grapadigital/shared-schemas 1.0.224 → 1.0.226

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.
@@ -54,6 +54,16 @@ export declare const ActionPromptConfigSchema: MongooseSchema<ActionPromptConfig
54
54
  }>;
55
55
  export declare const ACTION_STATUS_VALUES: readonly ["config", "inProgress", "finished", "archived", "cancelled"];
56
56
  export type ActionStatus = (typeof ACTION_STATUS_VALUES)[number];
57
+ /**
58
+ * Tipo da Ação (Action.type). O nome evita confusão com o ACTION_TYPE_VALUES
59
+ * do shared-app-modules, que é partnership. Ver GD-711.
60
+ * - influency: Influência (antes "creator", "Creators Pago");
61
+ * - organic: Orgânicos do mês da Samsung (GD-699/GD-711);
62
+ * - annual: Ação anual da Samsung, fora da captura diária, atualizada só pelo
63
+ * modo metrics-only do content-capture-worker.
64
+ */
65
+ export declare const ACTION_KIND_VALUES: readonly ["seeding", "ugc", "influency", "organic", "annual"];
66
+ export type ActionKind = (typeof ACTION_KIND_VALUES)[number];
57
67
  /**
58
68
  * Fase da Ação (antigo briefing do genc). Com `_id` porque o Conteúdo aponta
59
69
  * para ela (`Content.phase`). Período e hashtags opcionais fazem a captura
@@ -91,8 +101,8 @@ export declare class Action {
91
101
  nps?: number;
92
102
  status: ActionStatus;
93
103
  partnership: 'partner' | 'exclusive';
94
- /** organic = Orgânicos do mês: post aprovado numa Ação de produto sai dela. Ver GD-699. */
95
- type: 'seeding' | 'ugc' | 'creator' | 'organic';
104
+ /** Ver ACTION_KIND_VALUES. organic: post aprovado numa Ação de produto sai dela (GD-699). */
105
+ type: ActionKind;
96
106
  socialnetworks?: string[];
97
107
  recruitedInfluencers?: number;
98
108
  hiredInfluencers?: number;
@@ -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.ActionPhaseSchema = exports.ActionPhase = exports.ACTION_STATUS_VALUES = exports.ActionPromptConfigSchema = exports.ActionPromptConfig = exports.ACTION_BUSINESS_UNIT_VALUES = void 0;
12
+ exports.ActionModel = exports.ActionSchema = exports.Action = exports.ActionPhaseSchema = exports.ActionPhase = exports.ACTION_KIND_VALUES = 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");
@@ -75,6 +75,15 @@ exports.ACTION_STATUS_VALUES = [
75
75
  'archived',
76
76
  'cancelled',
77
77
  ];
78
+ /**
79
+ * Tipo da Ação (Action.type). O nome evita confusão com o ACTION_TYPE_VALUES
80
+ * do shared-app-modules, que é partnership. Ver GD-711.
81
+ * - influency: Influência (antes "creator", "Creators Pago");
82
+ * - organic: Orgânicos do mês da Samsung (GD-699/GD-711);
83
+ * - annual: Ação anual da Samsung, fora da captura diária, atualizada só pelo
84
+ * modo metrics-only do content-capture-worker.
85
+ */
86
+ exports.ACTION_KIND_VALUES = ['seeding', 'ugc', 'influency', 'organic', 'annual'];
78
87
  /**
79
88
  * Fase da Ação (antigo briefing do genc). Com `_id` porque o Conteúdo aponta
80
89
  * para ela (`Content.phase`). Período e hashtags opcionais fazem a captura
@@ -170,8 +179,8 @@ __decorate([
170
179
  __metadata("design:type", String)
171
180
  ], Action.prototype, "partnership", void 0);
172
181
  __decorate([
173
- (0, swagger_1.ApiProperty)({ enum: ['seeding', 'ugc', 'creator', 'organic'], example: 'seeding' }),
174
- (0, mongoose_1.Prop)({ type: String, enum: ['seeding', 'ugc', 'creator', 'organic'], required: true }),
182
+ (0, swagger_1.ApiProperty)({ enum: exports.ACTION_KIND_VALUES, example: 'seeding' }),
183
+ (0, mongoose_1.Prop)({ type: String, enum: exports.ACTION_KIND_VALUES, required: true }),
175
184
  __metadata("design:type", String)
176
185
  ], Action.prototype, "type", void 0);
177
186
  __decorate([
@@ -25,7 +25,14 @@
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
- export type BenchmarkMetric = 'reach' | 'er' | 'cpi' | 'cpe';
28
+ /**
29
+ * Métrica do benchmark. Nomes por extenso (GD-751); os antigos (`er`, `cpi`,
30
+ * `cpe`) ficam aceitos só durante a virada e saem na fase de remoção.
31
+ */
32
+ export declare const BENCHMARK_METRIC_VALUES: readonly ["reach", "engagementRate", "costPerThousandImpressions", "costPerEngagement"];
33
+ export type BenchmarkMetric = (typeof BENCHMARK_METRIC_VALUES)[number];
34
+ /** @deprecated Nomes antigos aceitos só na virada (GD-751). */
35
+ export declare const LEGACY_BENCHMARK_METRIC_VALUES: readonly ["er", "cpi", "cpe", "costPerImpression"];
29
36
  export type BenchmarkMode = 'organic' | 'paid';
30
37
  export type BenchmarkDocument = HydratedDocument<Benchmark>;
31
38
  export declare class Benchmark {
@@ -9,9 +9,16 @@ 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.LEGACY_BENCHMARK_METRIC_VALUES = exports.BENCHMARK_METRIC_VALUES = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
+ /**
16
+ * Métrica do benchmark. Nomes por extenso (GD-751); os antigos (`er`, `cpi`,
17
+ * `cpe`) ficam aceitos só durante a virada e saem na fase de remoção.
18
+ */
19
+ exports.BENCHMARK_METRIC_VALUES = ['reach', 'engagementRate', 'costPerThousandImpressions', 'costPerEngagement'];
20
+ /** @deprecated Nomes antigos aceitos só na virada (GD-751). */
21
+ exports.LEGACY_BENCHMARK_METRIC_VALUES = ['er', 'cpi', 'cpe', 'costPerImpression'];
15
22
  let Benchmark = class Benchmark {
16
23
  };
17
24
  __decorate([
@@ -27,7 +34,7 @@ __decorate([
27
34
  __metadata("design:type", String)
28
35
  ], Benchmark.prototype, "mode", void 0);
29
36
  __decorate([
30
- (0, mongoose_1.Prop)({ type: String, enum: ['reach', 'er', 'cpi', 'cpe'], required: true }),
37
+ (0, mongoose_1.Prop)({ type: String, enum: [...exports.BENCHMARK_METRIC_VALUES, ...exports.LEGACY_BENCHMARK_METRIC_VALUES], required: true }),
31
38
  __metadata("design:type", String)
32
39
  ], Benchmark.prototype, "metric", void 0);
33
40
  __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", "emv", "score", "cpmi", "cpi", "cpe", "savedCount", "sharesCount", "vcr", "viralReachEngagementRate"];
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
- 'emv',
38
+ 'earnedMediaValue',
39
39
  'score',
40
- 'cpmi',
41
- 'cpi',
42
- 'cpe',
40
+ 'costPerInfluency',
41
+ 'costPerImpact',
42
+ 'costPerEngagement',
43
43
  'savedCount',
44
- 'sharesCount',
45
- 'vcr',
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
- emv: 'currency',
58
+ earnedMediaValue: 'currency',
59
59
  score: 'count',
60
- cpmi: 'currency',
61
- cpi: 'currency',
62
- cpe: 'currency',
60
+ costPerInfluency: 'currency',
61
+ costPerImpact: 'currency',
62
+ costPerEngagement: 'currency',
63
63
  savedCount: 'count',
64
- sharesCount: 'count',
65
- vcr: 'rate',
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
- emv?: number | null;
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, "emv", void 0);
49
+ ], ContentCaptureProcessMetrics.prototype, "earnedMediaValue", void 0);
50
50
  ContentCaptureProcessMetrics = __decorate([
51
51
  (0, mongoose_1.Schema)({ _id: false })
52
52
  ], ContentCaptureProcessMetrics);
@@ -92,6 +92,8 @@ export declare class Metrics {
92
92
  likeCount?: number | null;
93
93
  commentCount?: number | null;
94
94
  savedCount?: number | null;
95
+ shareCount?: number | null;
96
+ /** @deprecated Usar `shareCount` (GD-751). Sai na fase de remoção. */
95
97
  sharesCount?: number | null;
96
98
  storyCount?: number | null;
97
99
  tapBackCount?: number | null;
@@ -102,6 +104,9 @@ export declare class Metrics {
102
104
  exitCount?: number | null;
103
105
  favoriteCount?: number | null;
104
106
  dislikeCount?: number | null;
107
+ /** Valor de Mídia Estimado (EMV), da Primetag. Ver GD-751. */
108
+ earnedMediaValue?: number | null;
109
+ /** @deprecated Usar `earnedMediaValue` (GD-751). Sai na fase de remoção. */
105
110
  emv?: number | null;
106
111
  engagementCount?: number | null;
107
112
  engagementRate?: number | null;
@@ -110,8 +115,17 @@ export declare class Metrics {
110
115
  qualifiedEngagementRate?: number | null;
111
116
  score?: number | null;
112
117
  allocatedBudgetAmount?: number | null;
118
+ /** Custo por Influência (CPMI): investimento ÷ (alcance × Score) × 1000. Ver GD-751. */
119
+ costPerInfluency?: number | null;
120
+ /** @deprecated Usar `costPerInfluency` (GD-751). Sai na fase de remoção. */
113
121
  cpmi?: number | null;
122
+ /** Custo por Mil Impressões (CPM): investimento ÷ impressões × 1000. Ver GD-751. */
123
+ costPerThousandImpressions?: number | null;
124
+ /** @deprecated Usar `costPerThousandImpressions` (GD-751). Sai na fase de remoção. */
114
125
  cpi?: number | null;
126
+ /** Custo por Engajamento (CPE): investimento ÷ engajamento. Ver GD-751. */
127
+ costPerEngagement?: number | null;
128
+ /** @deprecated Usar `costPerEngagement` (GD-751). Sai na fase de remoção. */
115
129
  cpe?: number | null;
116
130
  /**
117
131
  * Alcance Potencial (o antigo PO Reach): seguidores no momento do post. Em
@@ -154,7 +168,7 @@ export declare const ContentCollabSchema: MongooseSchema<ContentCollab, import("
154
168
  __v: number;
155
169
  }>;
156
170
  /** 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", "sharesCount", "storyCount", "tapBackCount", "clickCount", "replyCount", "tapForwardCount", "swipeForwardCount", "exitCount", "favoriteCount", "dislikeCount", "emv"];
171
+ 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
172
  export type ContentBaseMetricKey = (typeof CONTENT_BASE_METRIC_KEYS)[number];
159
173
  export declare class ContentBaseMetrics {
160
174
  impressionCount?: number | null;
@@ -162,6 +176,8 @@ export declare class ContentBaseMetrics {
162
176
  likeCount?: number | null;
163
177
  commentCount?: number | null;
164
178
  savedCount?: number | null;
179
+ shareCount?: number | null;
180
+ /** @deprecated Usar `shareCount` (GD-751). Sai na fase de remoção. */
165
181
  sharesCount?: number | null;
166
182
  storyCount?: number | null;
167
183
  tapBackCount?: number | null;
@@ -172,6 +188,9 @@ export declare class ContentBaseMetrics {
172
188
  exitCount?: number | null;
173
189
  favoriteCount?: number | null;
174
190
  dislikeCount?: number | null;
191
+ /** Valor de Mídia Estimado (EMV), da Primetag. Ver GD-751. */
192
+ earnedMediaValue?: number | null;
193
+ /** @deprecated Usar `earnedMediaValue` (GD-751). Sai na fase de remoção. */
175
194
  emv?: number | null;
176
195
  }
177
196
  export declare const ContentBaseMetricsSchema: MongooseSchema<ContentBaseMetrics, import("mongoose").Model<ContentBaseMetrics, any, any, any, import("mongoose").Document<unknown, any, ContentBaseMetrics, any, {}> & ContentBaseMetrics & {
@@ -206,7 +225,9 @@ export declare class ContentVideo {
206
225
  duration?: number | null;
207
226
  /** Tempo total assistido, somando todas as visualizações, em segundos. */
208
227
  watchTime?: number | null;
209
- /** (watchTime ÷ duration) ÷ impressionCount, sem teto. */
228
+ /** Taxa de Conclusão do Vídeo (VCR): (watchTime ÷ duration) ÷ impressionCount, sem teto. Ver GD-751. */
229
+ videoCompletionRate?: number | null;
230
+ /** @deprecated Usar `videoCompletionRate` (GD-751). Sai na fase de remoção. */
210
231
  vcr?: number | null;
211
232
  }
212
233
  export declare const ContentVideoSchema: MongooseSchema<ContentVideo, import("mongoose").Model<ContentVideo, any, any, any, import("mongoose").Document<unknown, any, ContentVideo, any, {}> & ContentVideo & {
@@ -231,17 +252,31 @@ export declare const ContentMetricsHistoryEntrySchema: MongooseSchema<ContentMet
231
252
  } & {
232
253
  __v: number;
233
254
  }>;
234
- export declare class Estimates {
255
+ /** Métricas estimadas pelo porte do perfil, para quando a rede não informa. Ver GD-751. */
256
+ export declare class EstimatedMetrics {
235
257
  impressionCount?: number | null;
236
258
  reachCount?: number | null;
237
259
  engagementCount?: number | null;
238
260
  engagementRate?: number | null;
239
261
  }
240
- export declare const EstimatesSchema: MongooseSchema<Estimates, import("mongoose").Model<Estimates, any, any, any, import("mongoose").Document<unknown, any, Estimates, any, {}> & Estimates & {
262
+ export declare const EstimatedMetricsSchema: MongooseSchema<EstimatedMetrics, import("mongoose").Model<EstimatedMetrics, any, any, any, import("mongoose").Document<unknown, any, EstimatedMetrics, any, {}> & EstimatedMetrics & {
241
263
  _id: Types.ObjectId;
242
264
  } & {
243
265
  __v: number;
244
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Estimates, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Estimates>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Estimates> & {
266
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EstimatedMetrics, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<EstimatedMetrics>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EstimatedMetrics> & {
267
+ _id: Types.ObjectId;
268
+ } & {
269
+ __v: number;
270
+ }>;
271
+ /** @deprecated Usar `EstimatedMetrics` (GD-751). */
272
+ export declare class Estimates extends EstimatedMetrics {
273
+ }
274
+ /** @deprecated Usar `EstimatedMetricsSchema` (GD-751). */
275
+ export declare const EstimatesSchema: MongooseSchema<EstimatedMetrics, import("mongoose").Model<EstimatedMetrics, any, any, any, import("mongoose").Document<unknown, any, EstimatedMetrics, any, {}> & EstimatedMetrics & {
276
+ _id: Types.ObjectId;
277
+ } & {
278
+ __v: number;
279
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EstimatedMetrics, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<EstimatedMetrics>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EstimatedMetrics> & {
245
280
  _id: Types.ObjectId;
246
281
  } & {
247
282
  __v: number;
@@ -301,7 +336,9 @@ export declare class Content {
301
336
  */
302
337
  manualMetrics?: string[];
303
338
  video?: ContentVideo | null;
304
- estimates: Estimates;
339
+ estimatedMetrics?: EstimatedMetrics | null;
340
+ /** @deprecated Usar `estimatedMetrics` (GD-751). Sai na fase de remoção. */
341
+ estimates?: Estimates;
305
342
  googleSheetRow?: string;
306
343
  createdAt?: Date;
307
344
  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.EstimatesSchema = exports.Estimates = 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;
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.EstimatesSchema = exports.Estimates = 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");
@@ -123,6 +123,10 @@ __decorate([
123
123
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
124
124
  __metadata("design:type", Object)
125
125
  ], Metrics.prototype, "savedCount", void 0);
126
+ __decorate([
127
+ (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
128
+ __metadata("design:type", Object)
129
+ ], Metrics.prototype, "shareCount", void 0);
126
130
  __decorate([
127
131
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
128
132
  __metadata("design:type", Object)
@@ -163,6 +167,10 @@ __decorate([
163
167
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
164
168
  __metadata("design:type", Object)
165
169
  ], Metrics.prototype, "dislikeCount", void 0);
170
+ __decorate([
171
+ (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
172
+ __metadata("design:type", Object)
173
+ ], Metrics.prototype, "earnedMediaValue", void 0);
166
174
  __decorate([
167
175
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
168
176
  __metadata("design:type", Object)
@@ -195,14 +203,26 @@ __decorate([
195
203
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
196
204
  __metadata("design:type", Object)
197
205
  ], Metrics.prototype, "allocatedBudgetAmount", void 0);
206
+ __decorate([
207
+ (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
208
+ __metadata("design:type", Object)
209
+ ], Metrics.prototype, "costPerInfluency", void 0);
198
210
  __decorate([
199
211
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
200
212
  __metadata("design:type", Object)
201
213
  ], Metrics.prototype, "cpmi", void 0);
214
+ __decorate([
215
+ (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
216
+ __metadata("design:type", Object)
217
+ ], Metrics.prototype, "costPerThousandImpressions", void 0);
202
218
  __decorate([
203
219
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
204
220
  __metadata("design:type", Object)
205
221
  ], Metrics.prototype, "cpi", void 0);
222
+ __decorate([
223
+ (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
224
+ __metadata("design:type", Object)
225
+ ], Metrics.prototype, "costPerEngagement", void 0);
206
226
  __decorate([
207
227
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
208
228
  __metadata("design:type", Object)
@@ -255,7 +275,7 @@ exports.CONTENT_BASE_METRIC_KEYS = [
255
275
  'likeCount',
256
276
  'commentCount',
257
277
  'savedCount',
258
- 'sharesCount',
278
+ 'shareCount',
259
279
  'storyCount',
260
280
  'tapBackCount',
261
281
  'clickCount',
@@ -265,7 +285,7 @@ exports.CONTENT_BASE_METRIC_KEYS = [
265
285
  'exitCount',
266
286
  'favoriteCount',
267
287
  'dislikeCount',
268
- 'emv',
288
+ 'earnedMediaValue',
269
289
  ];
270
290
  let ContentBaseMetrics = class ContentBaseMetrics {
271
291
  };
@@ -289,6 +309,10 @@ __decorate([
289
309
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
290
310
  __metadata("design:type", Object)
291
311
  ], ContentBaseMetrics.prototype, "savedCount", void 0);
312
+ __decorate([
313
+ (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
314
+ __metadata("design:type", Object)
315
+ ], ContentBaseMetrics.prototype, "shareCount", void 0);
292
316
  __decorate([
293
317
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
294
318
  __metadata("design:type", Object)
@@ -329,6 +353,10 @@ __decorate([
329
353
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
330
354
  __metadata("design:type", Object)
331
355
  ], ContentBaseMetrics.prototype, "dislikeCount", void 0);
356
+ __decorate([
357
+ (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
358
+ __metadata("design:type", Object)
359
+ ], ContentBaseMetrics.prototype, "earnedMediaValue", void 0);
332
360
  __decorate([
333
361
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
334
362
  __metadata("design:type", Object)
@@ -368,6 +396,10 @@ __decorate([
368
396
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
369
397
  __metadata("design:type", Object)
370
398
  ], ContentVideo.prototype, "watchTime", void 0);
399
+ __decorate([
400
+ (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
401
+ __metadata("design:type", Object)
402
+ ], ContentVideo.prototype, "videoCompletionRate", void 0);
371
403
  __decorate([
372
404
  (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
373
405
  __metadata("design:type", Object)
@@ -392,29 +424,36 @@ ContentMetricsHistoryEntry = __decorate([
392
424
  ], ContentMetricsHistoryEntry);
393
425
  exports.ContentMetricsHistoryEntry = ContentMetricsHistoryEntry;
394
426
  exports.ContentMetricsHistoryEntrySchema = mongoose_1.SchemaFactory.createForClass(ContentMetricsHistoryEntry);
395
- let Estimates = class Estimates {
427
+ /** Métricas estimadas pelo porte do perfil, para quando a rede não informa. Ver GD-751. */
428
+ let EstimatedMetrics = class EstimatedMetrics {
396
429
  };
397
430
  __decorate([
398
431
  (0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
399
432
  __metadata("design:type", Object)
400
- ], Estimates.prototype, "impressionCount", void 0);
433
+ ], EstimatedMetrics.prototype, "impressionCount", void 0);
401
434
  __decorate([
402
435
  (0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
403
436
  __metadata("design:type", Object)
404
- ], Estimates.prototype, "reachCount", void 0);
437
+ ], EstimatedMetrics.prototype, "reachCount", void 0);
405
438
  __decorate([
406
439
  (0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
407
440
  __metadata("design:type", Object)
408
- ], Estimates.prototype, "engagementCount", void 0);
441
+ ], EstimatedMetrics.prototype, "engagementCount", void 0);
409
442
  __decorate([
410
443
  (0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
411
444
  __metadata("design:type", Object)
412
- ], Estimates.prototype, "engagementRate", void 0);
413
- Estimates = __decorate([
445
+ ], EstimatedMetrics.prototype, "engagementRate", void 0);
446
+ EstimatedMetrics = __decorate([
414
447
  (0, mongoose_1.Schema)({ _id: false })
415
- ], Estimates);
448
+ ], EstimatedMetrics);
449
+ exports.EstimatedMetrics = EstimatedMetrics;
450
+ exports.EstimatedMetricsSchema = mongoose_1.SchemaFactory.createForClass(EstimatedMetrics);
451
+ /** @deprecated Usar `EstimatedMetrics` (GD-751). */
452
+ class Estimates extends EstimatedMetrics {
453
+ }
416
454
  exports.Estimates = Estimates;
417
- exports.EstimatesSchema = mongoose_1.SchemaFactory.createForClass(Estimates);
455
+ /** @deprecated Usar `EstimatedMetricsSchema` (GD-751). */
456
+ exports.EstimatesSchema = exports.EstimatedMetricsSchema;
418
457
  // error: captura de comentários falhou ou a classificação falhou por inteiro.
419
458
  // partial_error: parte dos comentários não foi classificada. Nenhum dos dois
420
459
  // volta sozinho pro pipeline — só por reenvio manual (aprovação).
@@ -576,7 +615,11 @@ __decorate([
576
615
  __metadata("design:type", Object)
577
616
  ], Content.prototype, "video", void 0);
578
617
  __decorate([
579
- (0, mongoose_1.Prop)({ type: exports.MetricsSchema, required: true }),
618
+ (0, mongoose_1.Prop)({ type: exports.EstimatedMetricsSchema, required: false, default: null }),
619
+ __metadata("design:type", Object)
620
+ ], Content.prototype, "estimatedMetrics", void 0);
621
+ __decorate([
622
+ (0, mongoose_1.Prop)({ type: exports.MetricsSchema, required: false }),
580
623
  __metadata("design:type", Estimates)
581
624
  ], Content.prototype, "estimates", void 0);
582
625
  __decorate([
@@ -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', 'sharesCount', 'savedCount'];
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.224",
3
+ "version": "1.0.226",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -68,6 +68,17 @@ export const ACTION_STATUS_VALUES = [
68
68
  ] as const;
69
69
  export type ActionStatus = (typeof ACTION_STATUS_VALUES)[number];
70
70
 
71
+ /**
72
+ * Tipo da Ação (Action.type). O nome evita confusão com o ACTION_TYPE_VALUES
73
+ * do shared-app-modules, que é partnership. Ver GD-711.
74
+ * - influency: Influência (antes "creator", "Creators Pago");
75
+ * - organic: Orgânicos do mês da Samsung (GD-699/GD-711);
76
+ * - annual: Ação anual da Samsung, fora da captura diária, atualizada só pelo
77
+ * modo metrics-only do content-capture-worker.
78
+ */
79
+ export const ACTION_KIND_VALUES = ['seeding', 'ugc', 'influency', 'organic', 'annual'] as const;
80
+ export type ActionKind = (typeof ACTION_KIND_VALUES)[number];
81
+
71
82
  /**
72
83
  * Fase da Ação (antigo briefing do genc). Com `_id` porque o Conteúdo aponta
73
84
  * para ela (`Content.phase`). Período e hashtags opcionais fazem a captura
@@ -149,10 +160,10 @@ export class Action {
149
160
  @Prop({ type: String, enum: ['partner', 'exclusive'], required: true })
150
161
  partnership: 'partner' | 'exclusive';
151
162
 
152
- /** organic = Orgânicos do mês: post aprovado numa Ação de produto sai dela. Ver GD-699. */
153
- @ApiProperty({ enum: ['seeding', 'ugc', 'creator', 'organic'], example: 'seeding' })
154
- @Prop({ type: String, enum: ['seeding', 'ugc', 'creator', 'organic'], required: true })
155
- type: 'seeding' | 'ugc' | 'creator' | 'organic';
163
+ /** Ver ACTION_KIND_VALUES. organic: post aprovado numa Ação de produto sai dela (GD-699). */
164
+ @ApiProperty({ enum: ACTION_KIND_VALUES, example: 'seeding' })
165
+ @Prop({ type: String, enum: ACTION_KIND_VALUES, required: true })
166
+ type: ActionKind;
156
167
 
157
168
  @ApiProperty({ example: ['instagram', 'tiktok'], required: false })
158
169
  @Prop({ type: [String], required: false })
@@ -2,7 +2,14 @@ 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
- export type BenchmarkMetric = 'reach' | 'er' | 'cpi' | 'cpe';
5
+ /**
6
+ * Métrica do benchmark. Nomes por extenso (GD-751); os antigos (`er`, `cpi`,
7
+ * `cpe`) ficam aceitos só durante a virada e saem na fase de remoção.
8
+ */
9
+ export const BENCHMARK_METRIC_VALUES = ['reach', 'engagementRate', 'costPerThousandImpressions', 'costPerEngagement'] as const;
10
+ export type BenchmarkMetric = (typeof BENCHMARK_METRIC_VALUES)[number];
11
+ /** @deprecated Nomes antigos aceitos só na virada (GD-751). */
12
+ export const LEGACY_BENCHMARK_METRIC_VALUES = ['er', 'cpi', 'cpe', 'costPerImpression'] as const;
6
13
  export type BenchmarkMode = 'organic' | 'paid';
7
14
  export type BenchmarkDocument = HydratedDocument<Benchmark>;
8
15
 
@@ -17,7 +24,7 @@ export class Benchmark {
17
24
  @Prop({ type: String, enum: ['organic', 'paid'], required: true })
18
25
  mode: BenchmarkMode;
19
26
 
20
- @Prop({ type: String, enum: ['reach', 'er', 'cpi', 'cpe'], required: true })
27
+ @Prop({ type: String, enum: [...BENCHMARK_METRIC_VALUES, ...LEGACY_BENCHMARK_METRIC_VALUES], required: true })
21
28
  metric: BenchmarkMetric;
22
29
 
23
30
  @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
- 'emv',
37
+ 'earnedMediaValue',
38
38
  'score',
39
- 'cpmi',
40
- 'cpi',
41
- 'cpe',
39
+ 'costPerInfluency',
40
+ 'costPerImpact',
41
+ 'costPerEngagement',
42
42
  'savedCount',
43
- 'sharesCount',
44
- 'vcr',
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
- emv: 'currency',
61
+ earnedMediaValue: 'currency',
62
62
  score: 'count',
63
- cpmi: 'currency',
64
- cpi: 'currency',
65
- cpe: 'currency',
63
+ costPerInfluency: 'currency',
64
+ costPerImpact: 'currency',
65
+ costPerEngagement: 'currency',
66
66
  savedCount: 'count',
67
- sharesCount: 'count',
68
- vcr: 'rate',
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
- emv?: number | null;
37
+ earnedMediaValue?: number | null;
38
38
  }
39
39
 
40
40
  export const ContentCaptureProcessMetricsSchema = SchemaFactory.createForClass(
@@ -93,6 +93,10 @@ export class Metrics {
93
93
  @Prop({ type: Number, required: false, default: null })
94
94
  savedCount?: number | null;
95
95
 
96
+ @Prop({ type: Number, required: false, default: null })
97
+ shareCount?: number | null;
98
+
99
+ /** @deprecated Usar `shareCount` (GD-751). Sai na fase de remoção. */
96
100
  @Prop({ type: Number, required: false, default: null })
97
101
  sharesCount?: number | null;
98
102
 
@@ -123,6 +127,11 @@ export class Metrics {
123
127
  @Prop({ type: Number, required: false, default: null })
124
128
  dislikeCount?: number | null;
125
129
 
130
+ /** Valor de Mídia Estimado (EMV), da Primetag. Ver GD-751. */
131
+ @Prop({ type: Number, required: false, default: null })
132
+ earnedMediaValue?: number | null;
133
+
134
+ /** @deprecated Usar `earnedMediaValue` (GD-751). Sai na fase de remoção. */
126
135
  @Prop({ type: Number, required: false, default: null })
127
136
  emv?: number | null;
128
137
 
@@ -149,12 +158,27 @@ export class Metrics {
149
158
  @Prop({ type: Number, required: false, default: null })
150
159
  allocatedBudgetAmount?: number | null;
151
160
 
161
+ /** Custo por Influência (CPMI): investimento ÷ (alcance × Score) × 1000. Ver GD-751. */
162
+ @Prop({ type: Number, required: false, default: null })
163
+ costPerInfluency?: number | null;
164
+
165
+ /** @deprecated Usar `costPerInfluency` (GD-751). Sai na fase de remoção. */
152
166
  @Prop({ type: Number, required: false, default: null })
153
167
  cpmi?: number | null;
154
168
 
169
+ /** Custo por Mil Impressões (CPM): investimento ÷ impressões × 1000. Ver GD-751. */
170
+ @Prop({ type: Number, required: false, default: null })
171
+ costPerThousandImpressions?: number | null;
172
+
173
+ /** @deprecated Usar `costPerThousandImpressions` (GD-751). Sai na fase de remoção. */
155
174
  @Prop({ type: Number, required: false, default: null })
156
175
  cpi?: number | null;
157
176
 
177
+ /** Custo por Engajamento (CPE): investimento ÷ engajamento. Ver GD-751. */
178
+ @Prop({ type: Number, required: false, default: null })
179
+ costPerEngagement?: number | null;
180
+
181
+ /** @deprecated Usar `costPerEngagement` (GD-751). Sai na fase de remoção. */
158
182
  @Prop({ type: Number, required: false, default: null })
159
183
  cpe?: number | null;
160
184
 
@@ -206,7 +230,7 @@ export const CONTENT_BASE_METRIC_KEYS = [
206
230
  'likeCount',
207
231
  'commentCount',
208
232
  'savedCount',
209
- 'sharesCount',
233
+ 'shareCount',
210
234
  'storyCount',
211
235
  'tapBackCount',
212
236
  'clickCount',
@@ -216,7 +240,7 @@ export const CONTENT_BASE_METRIC_KEYS = [
216
240
  'exitCount',
217
241
  'favoriteCount',
218
242
  'dislikeCount',
219
- 'emv',
243
+ 'earnedMediaValue',
220
244
  ] as const;
221
245
  export type ContentBaseMetricKey = (typeof CONTENT_BASE_METRIC_KEYS)[number];
222
246
 
@@ -237,6 +261,10 @@ export class ContentBaseMetrics {
237
261
  @Prop({ type: Number, required: false, default: null })
238
262
  savedCount?: number | null;
239
263
 
264
+ @Prop({ type: Number, required: false, default: null })
265
+ shareCount?: number | null;
266
+
267
+ /** @deprecated Usar `shareCount` (GD-751). Sai na fase de remoção. */
240
268
  @Prop({ type: Number, required: false, default: null })
241
269
  sharesCount?: number | null;
242
270
 
@@ -267,6 +295,11 @@ export class ContentBaseMetrics {
267
295
  @Prop({ type: Number, required: false, default: null })
268
296
  dislikeCount?: number | null;
269
297
 
298
+ /** Valor de Mídia Estimado (EMV), da Primetag. Ver GD-751. */
299
+ @Prop({ type: Number, required: false, default: null })
300
+ earnedMediaValue?: number | null;
301
+
302
+ /** @deprecated Usar `earnedMediaValue` (GD-751). Sai na fase de remoção. */
270
303
  @Prop({ type: Number, required: false, default: null })
271
304
  emv?: number | null;
272
305
  }
@@ -299,7 +332,11 @@ export class ContentVideo {
299
332
  @Prop({ type: Number, required: false, default: null })
300
333
  watchTime?: number | null;
301
334
 
302
- /** (watchTime ÷ duration) ÷ impressionCount, sem teto. */
335
+ /** Taxa de Conclusão do Vídeo (VCR): (watchTime ÷ duration) ÷ impressionCount, sem teto. Ver GD-751. */
336
+ @Prop({ type: Number, required: false, default: null })
337
+ videoCompletionRate?: number | null;
338
+
339
+ /** @deprecated Usar `videoCompletionRate` (GD-751). Sai na fase de remoção. */
303
340
  @Prop({ type: Number, required: false, default: null })
304
341
  vcr?: number | null;
305
342
  }
@@ -317,8 +354,9 @@ export class ContentMetricsHistoryEntry {
317
354
 
318
355
  export const ContentMetricsHistoryEntrySchema = SchemaFactory.createForClass(ContentMetricsHistoryEntry);
319
356
 
357
+ /** Métricas estimadas pelo porte do perfil, para quando a rede não informa. Ver GD-751. */
320
358
  @Schema({ _id: false })
321
- export class Estimates {
359
+ export class EstimatedMetrics {
322
360
  @Prop({ type: Number, required: true, default: null })
323
361
  impressionCount?: number | null;
324
362
 
@@ -332,7 +370,12 @@ export class Estimates {
332
370
  engagementRate?: number | null;
333
371
  }
334
372
 
335
- export const EstimatesSchema = SchemaFactory.createForClass(Estimates);
373
+ export const EstimatedMetricsSchema = SchemaFactory.createForClass(EstimatedMetrics);
374
+
375
+ /** @deprecated Usar `EstimatedMetrics` (GD-751). */
376
+ export class Estimates extends EstimatedMetrics {}
377
+ /** @deprecated Usar `EstimatedMetricsSchema` (GD-751). */
378
+ export const EstimatesSchema = EstimatedMetricsSchema;
336
379
 
337
380
  // error: captura de comentários falhou ou a classificação falhou por inteiro.
338
381
  // partial_error: parte dos comentários não foi classificada. Nenhum dos dois
@@ -496,8 +539,12 @@ export class Content {
496
539
  @Prop({ type: ContentVideoSchema, required: false, default: null })
497
540
  video?: ContentVideo | null;
498
541
 
499
- @Prop({ type: MetricsSchema, required: true })
500
- estimates: Estimates;
542
+ @Prop({ type: EstimatedMetricsSchema, required: false, default: null })
543
+ estimatedMetrics?: EstimatedMetrics | null;
544
+
545
+ /** @deprecated Usar `estimatedMetrics` (GD-751). Sai na fase de remoção. */
546
+ @Prop({ type: MetricsSchema, required: false })
547
+ estimates?: Estimates;
501
548
 
502
549
  @Prop({ type: String, required: false })
503
550
  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', 'sharesCount', 'savedCount'];
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);