@grapadigital/shared-schemas 1.0.63 → 1.0.65

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.
@@ -49,6 +49,10 @@ declare class Canceled {
49
49
  reason: string;
50
50
  details: string;
51
51
  }
52
+ declare class Note {
53
+ text: string;
54
+ owner: string;
55
+ }
52
56
  export declare class Invoice {
53
57
  _id?: Types.ObjectId;
54
58
  title: string;
@@ -59,6 +63,7 @@ export declare class Invoice {
59
63
  invoiced?: Invoiced;
60
64
  received?: Received;
61
65
  canceled?: Canceled;
66
+ notes?: Note[];
62
67
  createdAt?: Date;
63
68
  updatedAt?: Date;
64
69
  }
@@ -89,6 +89,19 @@ __decorate([
89
89
  Canceled = __decorate([
90
90
  (0, mongoose_1.Schema)({ _id: false })
91
91
  ], Canceled);
92
+ let Note = class Note {
93
+ };
94
+ __decorate([
95
+ (0, mongoose_1.Prop)({ required: true }),
96
+ __metadata("design:type", String)
97
+ ], Note.prototype, "text", void 0);
98
+ __decorate([
99
+ (0, mongoose_1.Prop)({ required: true }),
100
+ __metadata("design:type", String)
101
+ ], Note.prototype, "owner", void 0);
102
+ Note = __decorate([
103
+ (0, mongoose_1.Schema)({ _id: false })
104
+ ], Note);
92
105
  let Invoice = class Invoice {
93
106
  };
94
107
  __decorate([
@@ -137,6 +150,10 @@ __decorate([
137
150
  (0, mongoose_1.Prop)({ type: Canceled }),
138
151
  __metadata("design:type", Canceled)
139
152
  ], Invoice.prototype, "canceled", void 0);
153
+ __decorate([
154
+ (0, mongoose_1.Prop)([{ type: Note, required: false }]),
155
+ __metadata("design:type", Array)
156
+ ], Invoice.prototype, "notes", void 0);
140
157
  __decorate([
141
158
  (0, mongoose_1.Prop)({ default: Date.now, required: false }),
142
159
  __metadata("design:type", Date)
@@ -92,6 +92,10 @@ export declare class Lost {
92
92
  reason: 'declined' | 'other';
93
93
  details?: string;
94
94
  }
95
+ declare class Note {
96
+ text: string;
97
+ owner: string;
98
+ }
95
99
  export declare class Sale {
96
100
  _id?: Types.ObjectId;
97
101
  title: string;
@@ -101,6 +105,7 @@ export declare class Sale {
101
105
  negotiation?: Negotiation;
102
106
  formalization?: Formalization;
103
107
  lost?: Lost;
108
+ notes?: Note[];
104
109
  profiles?: Types.ObjectId[] | Profile[];
105
110
  invoices?: Types.ObjectId[] | Invoice[];
106
111
  actions?: Types.ObjectId[] | Action[];
@@ -130,3 +135,4 @@ export declare const SaleModel: import("mongoose").Model<Sale, {}, {}, {}, impor
130
135
  }> & {
131
136
  __v: number;
132
137
  }>>;
138
+ export {};
@@ -240,6 +240,19 @@ Lost = __decorate([
240
240
  (0, mongoose_1.Schema)({ _id: false })
241
241
  ], Lost);
242
242
  exports.Lost = Lost;
243
+ let Note = class Note {
244
+ };
245
+ __decorate([
246
+ (0, mongoose_1.Prop)({ required: true }),
247
+ __metadata("design:type", String)
248
+ ], Note.prototype, "text", void 0);
249
+ __decorate([
250
+ (0, mongoose_1.Prop)({ required: true }),
251
+ __metadata("design:type", String)
252
+ ], Note.prototype, "owner", void 0);
253
+ Note = __decorate([
254
+ (0, mongoose_1.Schema)({ _id: false })
255
+ ], Note);
243
256
  let Sale = class Sale {
244
257
  };
245
258
  __decorate([
@@ -284,6 +297,10 @@ __decorate([
284
297
  (0, mongoose_1.Prop)({ type: Lost }),
285
298
  __metadata("design:type", Lost)
286
299
  ], Sale.prototype, "lost", void 0);
300
+ __decorate([
301
+ (0, mongoose_1.Prop)([{ type: Note, required: false }]),
302
+ __metadata("design:type", Array)
303
+ ], Sale.prototype, "notes", void 0);
287
304
  __decorate([
288
305
  (0, mongoose_1.Prop)([
289
306
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -45,6 +45,12 @@ class Canceled {
45
45
  @Prop({ required: true }) details: string;
46
46
  }
47
47
 
48
+ @Schema({ _id: false })
49
+ class Note {
50
+ @Prop({ required: true }) text: string;
51
+ @Prop({ required: true }) owner: string;
52
+ }
53
+
48
54
  @Schema({ timestamps: true })
49
55
  export class Invoice {
50
56
  @Prop({ type: MongooseSchema.Types.ObjectId, auto: true, required: false })
@@ -78,6 +84,9 @@ export class Invoice {
78
84
 
79
85
  @Prop({ type: Canceled }) canceled?: Canceled;
80
86
 
87
+ @Prop([{ type: Note, required: false }])
88
+ notes?: Note[];
89
+
81
90
  @Prop({ default: Date.now, required: false })
82
91
  createdAt?: Date;
83
92
 
@@ -97,6 +97,12 @@ export class Lost {
97
97
  @Prop() details?: string;
98
98
  }
99
99
 
100
+ @Schema({ _id: false })
101
+ class Note {
102
+ @Prop({ required: true }) text: string;
103
+ @Prop({ required: true }) owner: string;
104
+ }
105
+
100
106
  @Schema({ timestamps: true })
101
107
  export class Sale {
102
108
  @Prop({ type: MongooseSchema.Types.ObjectId, auto: true, required: false })
@@ -123,6 +129,9 @@ export class Sale {
123
129
  @Prop({ type: Formalization }) formalization?: Formalization;
124
130
  @Prop({ type: Lost }) lost?: Lost;
125
131
 
132
+ @Prop([{ type: Note, required: false }])
133
+ notes?: Note[];
134
+
126
135
  @Prop([
127
136
  {
128
137
  type: MongooseSchema.Types.ObjectId,