@grapadigital/shared-schemas 1.0.223 → 1.0.225

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([
@@ -334,6 +334,18 @@ export declare class Content {
334
334
  * junto. Ver GD-699.
335
335
  */
336
336
  linkKey?: string | null;
337
+ /**
338
+ * Quando a edição pediu o recálculo das métricas (api-campaigns). A tela
339
+ * mostra "Recalculando…" enquanto for mais novo que metricsCalculatedAt.
340
+ * Ver GD-705.
341
+ */
342
+ metricsRequestedAt?: Date | null;
343
+ /**
344
+ * metricsRequestedAt que o metrics-generator-worker atendeu, gravado ao
345
+ * terminar o recálculo (não a hora do fim: um pedido que chegou durante o
346
+ * cálculo continua pendente). Ver GD-705.
347
+ */
348
+ metricsCalculatedAt?: Date | null;
337
349
  }
338
350
  export declare const ContentSchema: MongooseSchema<Content, import("mongoose").Model<Content, any, any, any, import("mongoose").Document<unknown, any, Content, any, {}> & Content & Required<{
339
351
  _id: Types.ObjectId;
@@ -651,6 +651,14 @@ __decorate([
651
651
  (0, mongoose_1.Prop)({ type: String, required: false, default: null }),
652
652
  __metadata("design:type", Object)
653
653
  ], Content.prototype, "linkKey", void 0);
654
+ __decorate([
655
+ (0, mongoose_1.Prop)({ type: Date, required: false, default: null }),
656
+ __metadata("design:type", Object)
657
+ ], Content.prototype, "metricsRequestedAt", void 0);
658
+ __decorate([
659
+ (0, mongoose_1.Prop)({ type: Date, required: false, default: null }),
660
+ __metadata("design:type", Object)
661
+ ], Content.prototype, "metricsCalculatedAt", void 0);
654
662
  Content = __decorate([
655
663
  (0, mongoose_1.Schema)({ timestamps: true })
656
664
  ], Content);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.223",
3
+ "version": "1.0.225",
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 })
@@ -573,6 +573,22 @@ export class Content {
573
573
  */
574
574
  @Prop({ type: String, required: false, default: null })
575
575
  linkKey?: string | null;
576
+
577
+ /**
578
+ * Quando a edição pediu o recálculo das métricas (api-campaigns). A tela
579
+ * mostra "Recalculando…" enquanto for mais novo que metricsCalculatedAt.
580
+ * Ver GD-705.
581
+ */
582
+ @Prop({ type: Date, required: false, default: null })
583
+ metricsRequestedAt?: Date | null;
584
+
585
+ /**
586
+ * metricsRequestedAt que o metrics-generator-worker atendeu, gravado ao
587
+ * terminar o recálculo (não a hora do fim: um pedido que chegou durante o
588
+ * cálculo continua pendente). Ver GD-705.
589
+ */
590
+ @Prop({ type: Date, required: false, default: null })
591
+ metricsCalculatedAt?: Date | null;
576
592
  }
577
593
 
578
594
  export const ContentSchema = SchemaFactory.createForClass(Content);