@grapadigital/shared-schemas 1.0.239 → 1.0.240

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.
@@ -58,6 +58,24 @@ export declare const ClusterSchema: MongooseSchema<Cluster, import("mongoose").M
58
58
  } & {
59
59
  __v: number;
60
60
  }>;
61
+ /**
62
+ * Squad do cliente (ex.: { key: 'alto_padrao', label: 'Alto Padrão' }). A chave
63
+ * é gravada no Recrutamento (`scope.squad`) e no Contrato (`squad`); o label é
64
+ * o texto da tela. Ver GD-770.
65
+ */
66
+ export declare class ClientSquad {
67
+ key: string;
68
+ label: string;
69
+ }
70
+ export declare const ClientSquadSchema: MongooseSchema<ClientSquad, import("mongoose").Model<ClientSquad, any, any, any, import("mongoose").Document<unknown, any, ClientSquad, any, {}> & ClientSquad & {
71
+ _id: Types.ObjectId;
72
+ } & {
73
+ __v: number;
74
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ClientSquad, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ClientSquad>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ClientSquad> & {
75
+ _id: Types.ObjectId;
76
+ } & {
77
+ __v: number;
78
+ }>;
61
79
  export declare class Company {
62
80
  legalName: string;
63
81
  document: string;
@@ -214,6 +232,8 @@ export declare class Client extends Party {
214
232
  tiers: ClientTier[];
215
233
  /** Metas anuais do cliente (só com Personalização Samsung por enquanto). Ver GD-687. */
216
234
  annualGoals: ClientAnnualGoal[];
235
+ /** Squads do cliente, para qualquer cliente. Ver `ClientSquad` e GD-770. */
236
+ squads: ClientSquad[];
217
237
  /**
218
238
  * Client de organização (ex.: "Oma Creators"): representa a organização
219
239
  * inteira, não uma marca. No hub, mostra todas as actions dessa organização
@@ -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.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;
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.ClientSquadSchema = exports.ClientSquad = 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");
@@ -82,6 +82,26 @@ Cluster = __decorate([
82
82
  ], Cluster);
83
83
  exports.Cluster = Cluster;
84
84
  exports.ClusterSchema = mongoose_1.SchemaFactory.createForClass(Cluster);
85
+ /**
86
+ * Squad do cliente (ex.: { key: 'alto_padrao', label: 'Alto Padrão' }). A chave
87
+ * é gravada no Recrutamento (`scope.squad`) e no Contrato (`squad`); o label é
88
+ * o texto da tela. Ver GD-770.
89
+ */
90
+ let ClientSquad = class ClientSquad {
91
+ };
92
+ __decorate([
93
+ (0, mongoose_1.Prop)({ required: true }),
94
+ __metadata("design:type", String)
95
+ ], ClientSquad.prototype, "key", void 0);
96
+ __decorate([
97
+ (0, mongoose_1.Prop)({ required: true }),
98
+ __metadata("design:type", String)
99
+ ], ClientSquad.prototype, "label", void 0);
100
+ ClientSquad = __decorate([
101
+ (0, mongoose_1.Schema)({ _id: false })
102
+ ], ClientSquad);
103
+ exports.ClientSquad = ClientSquad;
104
+ exports.ClientSquadSchema = mongoose_1.SchemaFactory.createForClass(ClientSquad);
85
105
  let Company = class Company {
86
106
  };
87
107
  __decorate([
@@ -295,6 +315,10 @@ __decorate([
295
315
  (0, mongoose_1.Prop)({ type: [exports.ClientAnnualGoalSchema], default: [] }),
296
316
  __metadata("design:type", Array)
297
317
  ], Client.prototype, "annualGoals", void 0);
318
+ __decorate([
319
+ (0, mongoose_1.Prop)({ type: [exports.ClientSquadSchema], default: [] }),
320
+ __metadata("design:type", Array)
321
+ ], Client.prototype, "squads", void 0);
298
322
  __decorate([
299
323
  (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Organization', required: false }),
300
324
  __metadata("design:type", mongoose_2.Types.ObjectId)
@@ -110,7 +110,7 @@ export declare class InfluencerContract {
110
110
  contractedCostPerImpact?: number | null;
111
111
  /** E/R contratual, em fração (0,02 = 2%). */
112
112
  contractedEngagementRate?: number | null;
113
- /** Ex.: "Team Galaxy", "Content Creator", "Tech". */
113
+ /** Chave de `Client.squads` do cliente do Contrato (ex.: `team_galaxy`). Ver GD-770. */
114
114
  squad?: string | null;
115
115
  /** Ex.: "Technology", "Camera", "Fashion". */
116
116
  passionPoint?: string | null;
@@ -191,9 +191,9 @@ export declare class Scope {
191
191
  exchange?: Exchange;
192
192
  exclusivity?: boolean;
193
193
  /**
194
- * Squad do Influenciador nesta Ação (ex.: "Team Galaxy", "Content Creator",
195
- * "Tech"). Nasce com o Squad do Contrato e é editável no escopo; os filtros de
196
- * Squad da Samsung no Hub usam este valor.
194
+ * Squad do Influenciador nesta Ação: chave de `Client.squads` (ex.:
195
+ * `team_galaxy`). Nasce com o Squad do Contrato e é editável no escopo; a aba
196
+ * Squads do Hub e os filtros de Squad da Samsung usam este valor. Ver GD-770.
197
197
  */
198
198
  squad?: string | null;
199
199
  estimates?: ScopeEstimates;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.239",
3
+ "version": "1.0.240",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -82,6 +82,22 @@ export class Cluster {
82
82
 
83
83
  export const ClusterSchema = SchemaFactory.createForClass(Cluster);
84
84
 
85
+ /**
86
+ * Squad do cliente (ex.: { key: 'alto_padrao', label: 'Alto Padrão' }). A chave
87
+ * é gravada no Recrutamento (`scope.squad`) e no Contrato (`squad`); o label é
88
+ * o texto da tela. Ver GD-770.
89
+ */
90
+ @Schema({ _id: false })
91
+ export class ClientSquad {
92
+ @Prop({ required: true })
93
+ key: string;
94
+
95
+ @Prop({ required: true })
96
+ label: string;
97
+ }
98
+
99
+ export const ClientSquadSchema = SchemaFactory.createForClass(ClientSquad);
100
+
85
101
  @Schema({ _id: false })
86
102
  export class Company {
87
103
  @Prop()
@@ -267,6 +283,10 @@ export class Client extends Party {
267
283
  @Prop({ type: [ClientAnnualGoalSchema], default: [] })
268
284
  annualGoals: ClientAnnualGoal[];
269
285
 
286
+ /** Squads do cliente, para qualquer cliente. Ver `ClientSquad` e GD-770. */
287
+ @Prop({ type: [ClientSquadSchema], default: [] })
288
+ squads: ClientSquad[];
289
+
270
290
  /**
271
291
  * Client de organização (ex.: "Oma Creators"): representa a organização
272
292
  * inteira, não uma marca. No hub, mostra todas as actions dessa organização
@@ -140,7 +140,7 @@ export class InfluencerContract {
140
140
  @Prop({ type: Number, required: false, default: null })
141
141
  contractedEngagementRate?: number | null;
142
142
 
143
- /** Ex.: "Team Galaxy", "Content Creator", "Tech". */
143
+ /** Chave de `Client.squads` do cliente do Contrato (ex.: `team_galaxy`). Ver GD-770. */
144
144
  @Prop({ type: String, required: false, default: null })
145
145
  squad?: string | null;
146
146
 
@@ -185,9 +185,9 @@ export class Scope {
185
185
  exclusivity?: boolean;
186
186
 
187
187
  /**
188
- * Squad do Influenciador nesta Ação (ex.: "Team Galaxy", "Content Creator",
189
- * "Tech"). Nasce com o Squad do Contrato e é editável no escopo; os filtros de
190
- * Squad da Samsung no Hub usam este valor.
188
+ * Squad do Influenciador nesta Ação: chave de `Client.squads` (ex.:
189
+ * `team_galaxy`). Nasce com o Squad do Contrato e é editável no escopo; a aba
190
+ * Squads do Hub e os filtros de Squad da Samsung usam este valor. Ver GD-770.
191
191
  */
192
192
  @Prop({ type: String, required: false, default: null })
193
193
  squad?: string | null;