@grapadigital/shared-schemas 1.0.64 → 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,7 +63,7 @@ export declare class Invoice {
59
63
  invoiced?: Invoiced;
60
64
  received?: Received;
61
65
  canceled?: Canceled;
62
- notes?: string[];
66
+ notes?: Note[];
63
67
  createdAt?: Date;
64
68
  updatedAt?: Date;
65
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([
@@ -138,7 +151,7 @@ __decorate([
138
151
  __metadata("design:type", Canceled)
139
152
  ], Invoice.prototype, "canceled", void 0);
140
153
  __decorate([
141
- (0, mongoose_1.Prop)([{ type: String, required: false }]),
154
+ (0, mongoose_1.Prop)([{ type: Note, required: false }]),
142
155
  __metadata("design:type", Array)
143
156
  ], Invoice.prototype, "notes", void 0);
144
157
  __decorate([
@@ -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,7 +105,7 @@ export declare class Sale {
101
105
  negotiation?: Negotiation;
102
106
  formalization?: Formalization;
103
107
  lost?: Lost;
104
- notes?: string[];
108
+ notes?: Note[];
105
109
  profiles?: Types.ObjectId[] | Profile[];
106
110
  invoices?: Types.ObjectId[] | Invoice[];
107
111
  actions?: Types.ObjectId[] | Action[];
@@ -131,3 +135,4 @@ export declare const SaleModel: import("mongoose").Model<Sale, {}, {}, {}, impor
131
135
  }> & {
132
136
  __v: number;
133
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([
@@ -285,7 +298,7 @@ __decorate([
285
298
  __metadata("design:type", Lost)
286
299
  ], Sale.prototype, "lost", void 0);
287
300
  __decorate([
288
- (0, mongoose_1.Prop)([{ type: String, required: false }]),
301
+ (0, mongoose_1.Prop)([{ type: Note, required: false }]),
289
302
  __metadata("design:type", Array)
290
303
  ], Sale.prototype, "notes", void 0);
291
304
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.64",
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,8 +84,8 @@ export class Invoice {
78
84
 
79
85
  @Prop({ type: Canceled }) canceled?: Canceled;
80
86
 
81
- @Prop([{ type: String, required: false }])
82
- notes?: string[];
87
+ @Prop([{ type: Note, required: false }])
88
+ notes?: Note[];
83
89
 
84
90
  @Prop({ default: Date.now, required: false })
85
91
  createdAt?: Date;
@@ -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,8 +129,8 @@ export class Sale {
123
129
  @Prop({ type: Formalization }) formalization?: Formalization;
124
130
  @Prop({ type: Lost }) lost?: Lost;
125
131
 
126
- @Prop([{ type: String, required: false }])
127
- notes?: string[];
132
+ @Prop([{ type: Note, required: false }])
133
+ notes?: Note[];
128
134
 
129
135
  @Prop([
130
136
  {