@merkaly/api 0.2.2 → 0.2.3-0

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.
@@ -46,7 +46,7 @@ var AbstractEntity = (function (_super) {
46
46
  __metadata("design:type", Date)
47
47
  ], AbstractEntity.prototype, "updatedAt", void 0);
48
48
  __decorate([
49
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
49
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date, default: null }),
50
50
  __metadata("design:type", Date)
51
51
  ], AbstractEntity.prototype, "deletedAt", void 0);
52
52
  return AbstractEntity;
@@ -20,4 +20,5 @@ export declare class ProductEntity extends AbstractEntity {
20
20
  code: CodeEntity;
21
21
  dimension: DimensionEntity;
22
22
  seo: SeoEntity;
23
+ readonly picture: string;
23
24
  }
@@ -94,7 +94,7 @@ var ProductEntity = (function (_super) {
94
94
  __metadata("design:type", seo_entity_1.SeoEntity)
95
95
  ], ProductEntity.prototype, "seo", void 0);
96
96
  ProductEntity = __decorate([
97
- (0, mongoose_1.Schema)({ timestamps: true })
97
+ (0, mongoose_1.Schema)({ timestamps: true, toJSON: { virtuals: true } })
98
98
  ], ProductEntity);
99
99
  return ProductEntity;
100
100
  }(abstract_entity_1.AbstractEntity));
@@ -4,4 +4,5 @@ export declare class ItemEntity extends AbstractEntity {
4
4
  quantity: number;
5
5
  price: number;
6
6
  product: ProductEntity;
7
+ readonly total: number;
7
8
  }
@@ -47,7 +47,7 @@ var ItemEntity = (function (_super) {
47
47
  __metadata("design:type", product_entity_1.ProductEntity)
48
48
  ], ItemEntity.prototype, "product", void 0);
49
49
  ItemEntity = __decorate([
50
- (0, mongoose_1.Schema)({ timestamps: true })
50
+ (0, mongoose_1.Schema)({ timestamps: true, toJSON: { virtuals: true } })
51
51
  ], ItemEntity);
52
52
  return ItemEntity;
53
53
  }(abstract_entity_1.AbstractEntity));
@@ -4,3 +4,6 @@ exports.ItemSchema = void 0;
4
4
  var mongoose_1 = require("@nestjs/mongoose");
5
5
  var item_entity_1 = require("./item.entity");
6
6
  exports.ItemSchema = mongoose_1.SchemaFactory.createForClass(item_entity_1.ItemEntity);
7
+ exports.ItemSchema.virtual('total').get(function () {
8
+ return this.price * this.quantity;
9
+ });
@@ -16,4 +16,5 @@ export declare class OrderEntity extends AbstractEntity {
16
16
  readonly fullNumber: string;
17
17
  readonly total: number;
18
18
  readonly client: any;
19
+ readonly currentStatus: StatusEntity;
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.2.2",
3
+ "version": "0.2.3-0",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "repository": {
6
6
  "type": "git",