@grapadigital/shared-schemas 1.0.149 → 1.0.151

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.
@@ -110,16 +110,27 @@ export declare class CommissionInfo {
110
110
  totalCommissionValue: number;
111
111
  participants: CommissionParticipant[];
112
112
  }
113
+ export declare class Inbox {
114
+ gmailMessageId: string;
115
+ gmailThreadId: string;
116
+ from: string;
117
+ to: string;
118
+ subject: string;
119
+ bodyText: string;
120
+ bodyHtml?: string;
121
+ receivedAt: Date;
122
+ }
113
123
  export declare class Sale {
114
124
  _id?: Types.ObjectId;
115
125
  title: string;
116
- phase: 'screening' | 'proposal' | 'negotiation' | 'commission' | 'formalization' | 'closed' | 'lost';
126
+ phase: 'inbox' | 'screening' | 'proposal' | 'negotiation' | 'commission' | 'formalization' | 'closed' | 'lost';
117
127
  type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
118
128
  screening?: Screening;
119
129
  proposal?: Proposal;
120
130
  negotiation?: Negotiation;
121
131
  formalization?: Formalization;
122
132
  commission?: CommissionInfo;
133
+ inbox?: Inbox;
123
134
  lost?: Lost;
124
135
  notes?: Note[];
125
136
  organization: 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.SaleModel = exports.SaleSchema = exports.Sale = 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.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 {
@@ -325,6 +325,44 @@ CommissionInfo = __decorate([
325
325
  (0, mongoose_1.Schema)({ _id: false })
326
326
  ], CommissionInfo);
327
327
  exports.CommissionInfo = CommissionInfo;
328
+ let Inbox = class Inbox {
329
+ };
330
+ __decorate([
331
+ (0, mongoose_1.Prop)({ required: true, unique: true, sparse: true }),
332
+ __metadata("design:type", String)
333
+ ], Inbox.prototype, "gmailMessageId", void 0);
334
+ __decorate([
335
+ (0, mongoose_1.Prop)({ required: true }),
336
+ __metadata("design:type", String)
337
+ ], Inbox.prototype, "gmailThreadId", void 0);
338
+ __decorate([
339
+ (0, mongoose_1.Prop)({ required: true }),
340
+ __metadata("design:type", String)
341
+ ], Inbox.prototype, "from", void 0);
342
+ __decorate([
343
+ (0, mongoose_1.Prop)({ required: true }),
344
+ __metadata("design:type", String)
345
+ ], Inbox.prototype, "to", void 0);
346
+ __decorate([
347
+ (0, mongoose_1.Prop)({ required: true }),
348
+ __metadata("design:type", String)
349
+ ], Inbox.prototype, "subject", void 0);
350
+ __decorate([
351
+ (0, mongoose_1.Prop)({ required: true }),
352
+ __metadata("design:type", String)
353
+ ], Inbox.prototype, "bodyText", void 0);
354
+ __decorate([
355
+ (0, mongoose_1.Prop)({ required: false }),
356
+ __metadata("design:type", String)
357
+ ], Inbox.prototype, "bodyHtml", void 0);
358
+ __decorate([
359
+ (0, mongoose_1.Prop)({ required: true }),
360
+ __metadata("design:type", Date)
361
+ ], Inbox.prototype, "receivedAt", void 0);
362
+ Inbox = __decorate([
363
+ (0, mongoose_1.Schema)({ _id: false })
364
+ ], Inbox);
365
+ exports.Inbox = Inbox;
328
366
  let Sale = class Sale {
329
367
  };
330
368
  __decorate([
@@ -339,6 +377,7 @@ __decorate([
339
377
  (0, mongoose_1.Prop)({
340
378
  required: true,
341
379
  enum: [
380
+ 'inbox',
342
381
  'screening',
343
382
  'proposal',
344
383
  'negotiation',
@@ -378,6 +417,10 @@ __decorate([
378
417
  (0, mongoose_1.Prop)({ type: CommissionInfo, required: false }),
379
418
  __metadata("design:type", CommissionInfo)
380
419
  ], Sale.prototype, "commission", void 0);
420
+ __decorate([
421
+ (0, mongoose_1.Prop)({ type: Inbox }),
422
+ __metadata("design:type", Inbox)
423
+ ], Sale.prototype, "inbox", void 0);
381
424
  __decorate([
382
425
  (0, mongoose_1.Prop)({ type: Lost }),
383
426
  __metadata("design:type", Lost)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.149",
3
+ "version": "1.0.151",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -154,6 +154,18 @@ export class CommissionInfo {
154
154
  participants: CommissionParticipant[];
155
155
  }
156
156
 
157
+ @Schema({ _id: false })
158
+ export class Inbox {
159
+ @Prop({ required: true, unique: true, sparse: true }) gmailMessageId: string;
160
+ @Prop({ required: true }) gmailThreadId: string;
161
+ @Prop({ required: true }) from: string;
162
+ @Prop({ required: true }) to: string;
163
+ @Prop({ required: true }) subject: string;
164
+ @Prop({ required: true }) bodyText: string;
165
+ @Prop({ required: false }) bodyHtml?: string;
166
+ @Prop({ required: true }) receivedAt: Date;
167
+ }
168
+
157
169
  @Schema({ timestamps: true })
158
170
  export class Sale {
159
171
  @Prop({ type: MongooseSchema.Types.ObjectId, auto: true, required: false })
@@ -164,6 +176,7 @@ export class Sale {
164
176
  @Prop({
165
177
  required: true,
166
178
  enum: [
179
+ 'inbox',
167
180
  'screening',
168
181
  'proposal',
169
182
  'negotiation',
@@ -174,6 +187,7 @@ export class Sale {
174
187
  ],
175
188
  })
176
189
  phase:
190
+ | 'inbox'
177
191
  | 'screening'
178
192
  | 'proposal'
179
193
  | 'negotiation'
@@ -195,6 +209,8 @@ export class Sale {
195
209
  @Prop({ type: Formalization }) formalization?: Formalization;
196
210
  @Prop({ type: CommissionInfo, required: false }) commission?: CommissionInfo;
197
211
 
212
+ @Prop({ type: Inbox }) inbox?: Inbox;
213
+
198
214
  @Prop({ type: Lost }) lost?: Lost;
199
215
 
200
216
  @Prop([{ type: Note, required: false }])