@grapadigital/shared-schemas 1.0.158 → 1.0.160

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.
@@ -120,6 +120,54 @@ export declare const CollabSchema: MongooseSchema<Collab, import("mongoose").Mod
120
120
  } & {
121
121
  __v: number;
122
122
  }>;
123
+ export declare class ScopeEstimateMetrics {
124
+ impressionCount: number;
125
+ reachCount: number;
126
+ engagementCount: number;
127
+ engagementRate: number;
128
+ }
129
+ export declare const ScopeEstimateMetricsSchema: MongooseSchema<ScopeEstimateMetrics, import("mongoose").Model<ScopeEstimateMetrics, any, any, any, import("mongoose").Document<unknown, any, ScopeEstimateMetrics, any, {}> & ScopeEstimateMetrics & {
130
+ _id: Types.ObjectId;
131
+ } & {
132
+ __v: number;
133
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ScopeEstimateMetrics, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ScopeEstimateMetrics>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ScopeEstimateMetrics> & {
134
+ _id: Types.ObjectId;
135
+ } & {
136
+ __v: number;
137
+ }>;
138
+ export declare class ScopeEstimateBreakdown {
139
+ formatId: string;
140
+ label: string;
141
+ platform: string;
142
+ quantity: number;
143
+ estimates: ScopeEstimateMetrics;
144
+ }
145
+ export declare const ScopeEstimateBreakdownSchema: MongooseSchema<ScopeEstimateBreakdown, import("mongoose").Model<ScopeEstimateBreakdown, any, any, any, import("mongoose").Document<unknown, any, ScopeEstimateBreakdown, any, {}> & ScopeEstimateBreakdown & {
146
+ _id: Types.ObjectId;
147
+ } & {
148
+ __v: number;
149
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ScopeEstimateBreakdown, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ScopeEstimateBreakdown>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ScopeEstimateBreakdown> & {
150
+ _id: Types.ObjectId;
151
+ } & {
152
+ __v: number;
153
+ }>;
154
+ export declare class ScopeEstimates {
155
+ impressionCount: number;
156
+ reachCount: number;
157
+ engagementCount: number;
158
+ engagementRate: number;
159
+ perPost?: ScopeEstimateMetrics | null;
160
+ breakdown: ScopeEstimateBreakdown[];
161
+ }
162
+ export declare const ScopeEstimatesSchema: MongooseSchema<ScopeEstimates, import("mongoose").Model<ScopeEstimates, any, any, any, import("mongoose").Document<unknown, any, ScopeEstimates, any, {}> & ScopeEstimates & {
163
+ _id: Types.ObjectId;
164
+ } & {
165
+ __v: number;
166
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ScopeEstimates, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ScopeEstimates>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ScopeEstimates> & {
167
+ _id: Types.ObjectId;
168
+ } & {
169
+ __v: number;
170
+ }>;
123
171
  export declare class Scope {
124
172
  delivery: Delivery;
125
173
  rights?: Rights;
@@ -128,6 +176,7 @@ export declare class Scope {
128
176
  collab?: Collab;
129
177
  exchange?: Exchange;
130
178
  exclusivity?: boolean;
179
+ estimates?: ScopeEstimates;
131
180
  }
132
181
  export declare const ScopeSchema: MongooseSchema<Scope, import("mongoose").Model<Scope, any, any, any, import("mongoose").Document<unknown, any, Scope, any, {}> & Scope & {
133
182
  _id: Types.ObjectId;
@@ -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.RecruitmentModel = exports.RecruitmentSchema = exports.Recruitment = exports.ScopeSchema = exports.Scope = exports.CollabSchema = exports.Collab = exports.ExchangeSchema = exports.Exchange = exports.InstallmentInfoSchema = exports.InstallmentInfo = exports.RightsSchema = exports.Rights = exports.RightSchema = exports.Right = exports.DeliverySchema = exports.Delivery = void 0;
12
+ exports.RecruitmentModel = exports.RecruitmentSchema = exports.Recruitment = exports.ScopeSchema = exports.Scope = exports.ScopeEstimatesSchema = exports.ScopeEstimates = exports.ScopeEstimateBreakdownSchema = exports.ScopeEstimateBreakdown = exports.ScopeEstimateMetricsSchema = exports.ScopeEstimateMetrics = exports.CollabSchema = exports.Collab = exports.ExchangeSchema = exports.Exchange = exports.InstallmentInfoSchema = exports.InstallmentInfo = exports.RightsSchema = exports.Rights = exports.RightSchema = exports.Right = exports.DeliverySchema = exports.Delivery = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
15
  let Delivery = class Delivery {
@@ -160,6 +160,87 @@ Collab = __decorate([
160
160
  ], Collab);
161
161
  exports.Collab = Collab;
162
162
  exports.CollabSchema = mongoose_1.SchemaFactory.createForClass(Collab);
163
+ let ScopeEstimateMetrics = class ScopeEstimateMetrics {
164
+ };
165
+ __decorate([
166
+ (0, mongoose_1.Prop)(),
167
+ __metadata("design:type", Number)
168
+ ], ScopeEstimateMetrics.prototype, "impressionCount", void 0);
169
+ __decorate([
170
+ (0, mongoose_1.Prop)(),
171
+ __metadata("design:type", Number)
172
+ ], ScopeEstimateMetrics.prototype, "reachCount", void 0);
173
+ __decorate([
174
+ (0, mongoose_1.Prop)(),
175
+ __metadata("design:type", Number)
176
+ ], ScopeEstimateMetrics.prototype, "engagementCount", void 0);
177
+ __decorate([
178
+ (0, mongoose_1.Prop)(),
179
+ __metadata("design:type", Number)
180
+ ], ScopeEstimateMetrics.prototype, "engagementRate", void 0);
181
+ ScopeEstimateMetrics = __decorate([
182
+ (0, mongoose_1.Schema)({ _id: false })
183
+ ], ScopeEstimateMetrics);
184
+ exports.ScopeEstimateMetrics = ScopeEstimateMetrics;
185
+ exports.ScopeEstimateMetricsSchema = mongoose_1.SchemaFactory.createForClass(ScopeEstimateMetrics);
186
+ let ScopeEstimateBreakdown = class ScopeEstimateBreakdown {
187
+ };
188
+ __decorate([
189
+ (0, mongoose_1.Prop)(),
190
+ __metadata("design:type", String)
191
+ ], ScopeEstimateBreakdown.prototype, "formatId", void 0);
192
+ __decorate([
193
+ (0, mongoose_1.Prop)(),
194
+ __metadata("design:type", String)
195
+ ], ScopeEstimateBreakdown.prototype, "label", void 0);
196
+ __decorate([
197
+ (0, mongoose_1.Prop)(),
198
+ __metadata("design:type", String)
199
+ ], ScopeEstimateBreakdown.prototype, "platform", void 0);
200
+ __decorate([
201
+ (0, mongoose_1.Prop)(),
202
+ __metadata("design:type", Number)
203
+ ], ScopeEstimateBreakdown.prototype, "quantity", void 0);
204
+ __decorate([
205
+ (0, mongoose_1.Prop)({ type: exports.ScopeEstimateMetricsSchema }),
206
+ __metadata("design:type", ScopeEstimateMetrics)
207
+ ], ScopeEstimateBreakdown.prototype, "estimates", void 0);
208
+ ScopeEstimateBreakdown = __decorate([
209
+ (0, mongoose_1.Schema)({ _id: false })
210
+ ], ScopeEstimateBreakdown);
211
+ exports.ScopeEstimateBreakdown = ScopeEstimateBreakdown;
212
+ exports.ScopeEstimateBreakdownSchema = mongoose_1.SchemaFactory.createForClass(ScopeEstimateBreakdown);
213
+ let ScopeEstimates = class ScopeEstimates {
214
+ };
215
+ __decorate([
216
+ (0, mongoose_1.Prop)(),
217
+ __metadata("design:type", Number)
218
+ ], ScopeEstimates.prototype, "impressionCount", void 0);
219
+ __decorate([
220
+ (0, mongoose_1.Prop)(),
221
+ __metadata("design:type", Number)
222
+ ], ScopeEstimates.prototype, "reachCount", void 0);
223
+ __decorate([
224
+ (0, mongoose_1.Prop)(),
225
+ __metadata("design:type", Number)
226
+ ], ScopeEstimates.prototype, "engagementCount", void 0);
227
+ __decorate([
228
+ (0, mongoose_1.Prop)(),
229
+ __metadata("design:type", Number)
230
+ ], ScopeEstimates.prototype, "engagementRate", void 0);
231
+ __decorate([
232
+ (0, mongoose_1.Prop)({ type: exports.ScopeEstimateMetricsSchema, required: false }),
233
+ __metadata("design:type", Object)
234
+ ], ScopeEstimates.prototype, "perPost", void 0);
235
+ __decorate([
236
+ (0, mongoose_1.Prop)({ type: [exports.ScopeEstimateBreakdownSchema] }),
237
+ __metadata("design:type", Array)
238
+ ], ScopeEstimates.prototype, "breakdown", void 0);
239
+ ScopeEstimates = __decorate([
240
+ (0, mongoose_1.Schema)({ _id: false })
241
+ ], ScopeEstimates);
242
+ exports.ScopeEstimates = ScopeEstimates;
243
+ exports.ScopeEstimatesSchema = mongoose_1.SchemaFactory.createForClass(ScopeEstimates);
163
244
  let Scope = class Scope {
164
245
  };
165
246
  __decorate([
@@ -190,6 +271,10 @@ __decorate([
190
271
  (0, mongoose_1.Prop)({ required: false }),
191
272
  __metadata("design:type", Boolean)
192
273
  ], Scope.prototype, "exclusivity", void 0);
274
+ __decorate([
275
+ (0, mongoose_1.Prop)({ type: exports.ScopeEstimatesSchema, required: false }),
276
+ __metadata("design:type", ScopeEstimates)
277
+ ], Scope.prototype, "estimates", void 0);
193
278
  Scope = __decorate([
194
279
  (0, mongoose_1.Schema)({ _id: false })
195
280
  ], Scope);
@@ -86,7 +86,7 @@ export declare class Formalization {
86
86
  totalInstallments: number;
87
87
  }
88
88
  export declare class Lost {
89
- reason: 'declined' | 'other';
89
+ reason: 'declined' | 'other' | 'spam' | 'no_response' | 'no_budget' | 'no_profile_fit' | 'invite_exchange';
90
90
  details?: string;
91
91
  }
92
92
  declare class Note {
@@ -94,6 +94,12 @@ declare class Note {
94
94
  owner: string;
95
95
  createdAt: Date;
96
96
  }
97
+ export declare class Activity {
98
+ type: 'email' | 'whatsapp' | 'meeting' | 'call' | 'linkedin' | 'instagram_dm';
99
+ description?: string;
100
+ owner: string;
101
+ createdAt: Date;
102
+ }
97
103
  export declare class TimelineEntry {
98
104
  phase: string;
99
105
  date: Date;
@@ -135,6 +141,7 @@ export declare class Sale {
135
141
  inbox?: Inbox;
136
142
  lost?: Lost;
137
143
  notes?: Note[];
144
+ activities?: Activity[];
138
145
  organization: Types.ObjectId;
139
146
  tags?: string[];
140
147
  timeline?: TimelineEntry[];
@@ -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.SaleModel = exports.SaleSchema = exports.Sale = exports.Inbox = exports.CommissionInfo = exports.CommissionParticipant = exports.TimelineEntry = exports.Lost = exports.Formalization = exports.Negotiation = exports.Proposal = exports.Screening = void 0;
12
+ exports.SaleModel = exports.SaleSchema = exports.Sale = exports.Inbox = exports.CommissionInfo = exports.CommissionParticipant = exports.TimelineEntry = exports.Activity = exports.Lost = exports.Formalization = exports.Negotiation = exports.Proposal = exports.Screening = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
15
  let Screening = class Screening {
@@ -267,6 +267,28 @@ __decorate([
267
267
  Note = __decorate([
268
268
  (0, mongoose_1.Schema)({ _id: false })
269
269
  ], Note);
270
+ let Activity = class Activity {
271
+ };
272
+ __decorate([
273
+ (0, mongoose_1.Prop)({ required: true }),
274
+ __metadata("design:type", String)
275
+ ], Activity.prototype, "type", void 0);
276
+ __decorate([
277
+ (0, mongoose_1.Prop)({ required: false }),
278
+ __metadata("design:type", String)
279
+ ], Activity.prototype, "description", void 0);
280
+ __decorate([
281
+ (0, mongoose_1.Prop)({ required: true }),
282
+ __metadata("design:type", String)
283
+ ], Activity.prototype, "owner", void 0);
284
+ __decorate([
285
+ (0, mongoose_1.Prop)({ required: true }),
286
+ __metadata("design:type", Date)
287
+ ], Activity.prototype, "createdAt", void 0);
288
+ Activity = __decorate([
289
+ (0, mongoose_1.Schema)({ _id: false })
290
+ ], Activity);
291
+ exports.Activity = Activity;
270
292
  let TimelineEntry = class TimelineEntry {
271
293
  };
272
294
  __decorate([
@@ -444,6 +466,10 @@ __decorate([
444
466
  (0, mongoose_1.Prop)([{ type: Note, required: false }]),
445
467
  __metadata("design:type", Array)
446
468
  ], Sale.prototype, "notes", void 0);
469
+ __decorate([
470
+ (0, mongoose_1.Prop)([{ type: Activity, required: false }]),
471
+ __metadata("design:type", Array)
472
+ ], Sale.prototype, "activities", void 0);
447
473
  __decorate([
448
474
  (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId }),
449
475
  __metadata("design:type", mongoose_2.Types.ObjectId)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.158",
3
+ "version": "1.0.160",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -117,6 +117,39 @@ export const CollabSchema = SchemaFactory.createForClass(Collab);
117
117
 
118
118
 
119
119
 
120
+ @Schema({ _id: false })
121
+ export class ScopeEstimateMetrics {
122
+ @Prop() impressionCount: number;
123
+ @Prop() reachCount: number;
124
+ @Prop() engagementCount: number;
125
+ @Prop() engagementRate: number;
126
+ }
127
+
128
+ export const ScopeEstimateMetricsSchema = SchemaFactory.createForClass(ScopeEstimateMetrics);
129
+
130
+ @Schema({ _id: false })
131
+ export class ScopeEstimateBreakdown {
132
+ @Prop() formatId: string;
133
+ @Prop() label: string;
134
+ @Prop() platform: string;
135
+ @Prop() quantity: number;
136
+ @Prop({ type: ScopeEstimateMetricsSchema }) estimates: ScopeEstimateMetrics;
137
+ }
138
+
139
+ export const ScopeEstimateBreakdownSchema = SchemaFactory.createForClass(ScopeEstimateBreakdown);
140
+
141
+ @Schema({ _id: false })
142
+ export class ScopeEstimates {
143
+ @Prop() impressionCount: number;
144
+ @Prop() reachCount: number;
145
+ @Prop() engagementCount: number;
146
+ @Prop() engagementRate: number;
147
+ @Prop({ type: ScopeEstimateMetricsSchema, required: false }) perPost?: ScopeEstimateMetrics | null;
148
+ @Prop({ type: [ScopeEstimateBreakdownSchema] }) breakdown: ScopeEstimateBreakdown[];
149
+ }
150
+
151
+ export const ScopeEstimatesSchema = SchemaFactory.createForClass(ScopeEstimates);
152
+
120
153
  @Schema({ _id: false })
121
154
  export class Scope {
122
155
  @Prop({ type: DeliverySchema })
@@ -140,6 +173,8 @@ export class Scope {
140
173
  @Prop({ required: false })
141
174
  exclusivity?: boolean;
142
175
 
176
+ @Prop({ type: ScopeEstimatesSchema, required: false })
177
+ estimates?: ScopeEstimates;
143
178
  }
144
179
 
145
180
  export const ScopeSchema = SchemaFactory.createForClass(Scope);
@@ -125,7 +125,7 @@ export class Formalization {
125
125
 
126
126
  @Schema({ _id: false })
127
127
  export class Lost {
128
- @Prop({ required: true }) reason: 'declined' | 'other';
128
+ @Prop({ required: true }) reason: 'declined' | 'other' | 'spam' | 'no_response' | 'no_budget' | 'no_profile_fit' | 'invite_exchange';
129
129
  @Prop() details?: string;
130
130
  }
131
131
 
@@ -136,6 +136,14 @@ class Note {
136
136
  @Prop({ required: true }) createdAt: Date;
137
137
  }
138
138
 
139
+ @Schema({ _id: false })
140
+ export class Activity {
141
+ @Prop({ required: true }) type: 'email' | 'whatsapp' | 'meeting' | 'call' | 'linkedin' | 'instagram_dm';
142
+ @Prop({ required: false }) description?: string;
143
+ @Prop({ required: true }) owner: string;
144
+ @Prop({ required: true }) createdAt: Date;
145
+ }
146
+
139
147
  @Schema({ _id: false })
140
148
  export class TimelineEntry {
141
149
  @Prop({ required: true }) phase: string;
@@ -237,6 +245,9 @@ export class Sale {
237
245
  @Prop([{ type: Note, required: false }])
238
246
  notes?: Note[];
239
247
 
248
+ @Prop([{ type: Activity, required: false }])
249
+ activities?: Activity[];
250
+
240
251
  @Prop({ type: MongooseSchema.Types.ObjectId })
241
252
  organization: Types.ObjectId;
242
253