@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.
- package/.output/abstract/abstract.entity.js +1 -1
- package/.output/modules/inventory/products/product.entity.d.ts +1 -0
- package/.output/modules/inventory/products/product.entity.js +1 -1
- package/.output/modules/sales/orders/item/item.entity.d.ts +1 -0
- package/.output/modules/sales/orders/item/item.entity.js +1 -1
- package/.output/modules/sales/orders/item/item.schema.js +3 -0
- package/.output/modules/sales/orders/order.entity.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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));
|
|
@@ -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
|
+
});
|