@grapadigital/shared-schemas 1.0.203 → 1.0.204

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.
@@ -131,6 +131,13 @@ export declare class Client extends Party {
131
131
  * (Antigo `hasReport`.)
132
132
  */
133
133
  hasGenIAAnalysis: boolean;
134
+ /**
135
+ * Client de organização (ex.: "Oma Creators"): representa a organização
136
+ * inteira, não uma marca. Com `hasGenIAAnalysis`, liga a análise GenIA pra
137
+ * todas as actions dessa organização e, no hub, mostra todas elas
138
+ * independentemente do client (marca) de cada action.
139
+ */
140
+ organization?: Types.ObjectId;
134
141
  reportResponsable?: Responsable;
135
142
  brandResponsable?: string;
136
143
  profiles?: Types.ObjectId[] | Profile[];
@@ -165,6 +165,10 @@ __decorate([
165
165
  (0, mongoose_1.Prop)({ type: Boolean, default: false }),
166
166
  __metadata("design:type", Boolean)
167
167
  ], Client.prototype, "hasGenIAAnalysis", void 0);
168
+ __decorate([
169
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Organization', required: false }),
170
+ __metadata("design:type", mongoose_2.Types.ObjectId)
171
+ ], Client.prototype, "organization", void 0);
168
172
  __decorate([
169
173
  (0, mongoose_1.Prop)({ type: exports.ResponsableSchema, required: false }),
170
174
  __metadata("design:type", Responsable)
@@ -188,4 +192,5 @@ exports.ClientSchema.index({ name: 1 });
188
192
  exports.ClientSchema.index({ 'company.legalName': 1 });
189
193
  exports.ClientSchema.index({ 'company.document': 1 });
190
194
  exports.ClientSchema.index({ createdAt: -1 });
195
+ exports.ClientSchema.index({ organization: 1 }, { sparse: true });
191
196
  exports.ClientModel = (0, mongoose_2.model)('Client', exports.ClientSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.203",
3
+ "version": "1.0.204",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -137,6 +137,15 @@ export class Client extends Party {
137
137
  @Prop({ type: Boolean, default: false })
138
138
  hasGenIAAnalysis: boolean;
139
139
 
140
+ /**
141
+ * Client de organização (ex.: "Oma Creators"): representa a organização
142
+ * inteira, não uma marca. Com `hasGenIAAnalysis`, liga a análise GenIA pra
143
+ * todas as actions dessa organização e, no hub, mostra todas elas
144
+ * independentemente do client (marca) de cada action.
145
+ */
146
+ @Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Organization', required: false })
147
+ organization?: Types.ObjectId;
148
+
140
149
  @Prop({ type: ResponsableSchema, required: false })
141
150
  reportResponsable?: Responsable;
142
151
 
@@ -157,5 +166,6 @@ ClientSchema.index({ name: 1 });
157
166
  ClientSchema.index({ 'company.legalName': 1 });
158
167
  ClientSchema.index({ 'company.document': 1 });
159
168
  ClientSchema.index({ createdAt: -1 });
169
+ ClientSchema.index({ organization: 1 }, { sparse: true });
160
170
 
161
171
  export const ClientModel = MongooseModel('Client', ClientSchema);