tt-entities 0.0.15 → 0.0.16
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/dist/libs/tatayab-entities-library/src/entities/brand.entity.d.ts +12 -0
- package/dist/libs/tatayab-entities-library/src/entities/brand.entity.js +56 -0
- package/dist/libs/tatayab-entities-library/src/entities/brand.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/category.entity.d.ts +14 -0
- package/dist/libs/tatayab-entities-library/src/entities/category.entity.js +65 -0
- package/dist/libs/tatayab-entities-library/src/entities/category.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory-stock.entity.d.ts +16 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory-stock.entity.js +66 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory-stock.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory.entity.d.ts +15 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory.entity.js +63 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-media.entity.d.ts +16 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-media.entity.js +62 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-media.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-store.entity.d.ts +8 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-store.entity.js +44 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-store.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant-option.entity.d.ts +5 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant-option.entity.js +32 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant-option.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant.entity.d.ts +15 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant.entity.js +64 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product.entity.d.ts +27 -0
- package/dist/libs/tatayab-entities-library/src/entities/product.entity.js +104 -0
- package/dist/libs/tatayab-entities-library/src/entities/product.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order-item.entity.d.ts +25 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order-item.entity.js +88 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order-item.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order.entity.d.ts +27 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order.entity.js +108 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/stock-movement.entity.d.ts +23 -0
- package/dist/libs/tatayab-entities-library/src/entities/stock-movement.entity.js +92 -0
- package/dist/libs/tatayab-entities-library/src/entities/stock-movement.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/store-inventory.entity.d.ts +6 -0
- package/dist/libs/tatayab-entities-library/src/entities/store-inventory.entity.js +36 -0
- package/dist/libs/tatayab-entities-library/src/entities/store-inventory.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/store.entity.d.ts +21 -0
- package/dist/libs/tatayab-entities-library/src/entities/store.entity.js +86 -0
- package/dist/libs/tatayab-entities-library/src/entities/store.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-option.entity.d.ts +11 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-option.entity.js +50 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-option.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-type.entity.d.ts +7 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-type.entity.js +37 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-type.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor-product.entity.d.ts +19 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor-product.entity.js +78 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor-product.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor.entity.d.ts +19 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor.entity.js +82 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/index.d.ts +20 -0
- package/dist/libs/tatayab-entities-library/src/index.js +79 -1
- package/dist/libs/tatayab-entities-library/src/index.js.map +1 -1
- package/dist/libs/tatayab-entities-library/src/utils/enums/purchaseOrderStatus.d.ts +8 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/purchaseOrderStatus.js +13 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/purchaseOrderStatus.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/stockMovementType.d.ts +11 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/stockMovementType.js +16 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/stockMovementType.js.map +1 -0
- package/dist/src/main.js +1437 -1
- package/libs/tatayab-entities-library/src/entities/brand.entity.ts +32 -0
- package/libs/tatayab-entities-library/src/entities/category.entity.ts +47 -0
- package/libs/tatayab-entities-library/src/entities/inventory-stock.entity.ts +55 -0
- package/libs/tatayab-entities-library/src/entities/inventory.entity.ts +47 -0
- package/libs/tatayab-entities-library/src/entities/product-media.entity.ts +45 -0
- package/libs/tatayab-entities-library/src/entities/product-store.entity.ts +31 -0
- package/libs/tatayab-entities-library/src/entities/product-variant-option.entity.ts +19 -0
- package/libs/tatayab-entities-library/src/entities/product-variant.entity.ts +51 -0
- package/libs/tatayab-entities-library/src/entities/product.entity.ts +82 -0
- package/libs/tatayab-entities-library/src/entities/purchase-order-item.entity.ts +73 -0
- package/libs/tatayab-entities-library/src/entities/purchase-order.entity.ts +86 -0
- package/libs/tatayab-entities-library/src/entities/stock-movement.entity.ts +74 -0
- package/libs/tatayab-entities-library/src/entities/store-inventory.entity.ts +24 -0
- package/libs/tatayab-entities-library/src/entities/store.entity.ts +68 -0
- package/libs/tatayab-entities-library/src/entities/variant-option.entity.ts +35 -0
- package/libs/tatayab-entities-library/src/entities/variant-type.entity.ts +18 -0
- package/libs/tatayab-entities-library/src/entities/vendor-product.entity.ts +65 -0
- package/libs/tatayab-entities-library/src/entities/vendor.entity.ts +63 -0
- package/libs/tatayab-entities-library/src/index.ts +95 -2
- package/libs/tatayab-entities-library/src/utils/enums/purchaseOrderStatus.ts +8 -0
- package/libs/tatayab-entities-library/src/utils/enums/stockMovementType.ts +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Product = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const brand_entity_1 = require("./brand.entity");
|
|
15
|
+
const category_entity_1 = require("./category.entity");
|
|
16
|
+
const product_media_entity_1 = require("./product-media.entity");
|
|
17
|
+
const product_variant_entity_1 = require("./product-variant.entity");
|
|
18
|
+
const product_store_entity_1 = require("./product-store.entity");
|
|
19
|
+
const store_entity_1 = require("./store.entity");
|
|
20
|
+
const status_1 = require("../utils/enums/status");
|
|
21
|
+
let Product = class Product extends sequelize_typescript_1.Model {
|
|
22
|
+
};
|
|
23
|
+
exports.Product = Product;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], Product.prototype, "nameEn", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], Product.prototype, "nameAr", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.TEXT, allowNull: true }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Product.prototype, "descriptionEn", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.TEXT, allowNull: true }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], Product.prototype, "descriptionAr", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Product.prototype, "sku", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], Product.prototype, "barcode", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: false, defaultValue: 0 }),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], Product.prototype, "defaultPrice", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, sequelize_typescript_1.ForeignKey)(() => brand_entity_1.Brand),
|
|
54
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
55
|
+
__metadata("design:type", Number)
|
|
56
|
+
], Product.prototype, "brandId", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, sequelize_typescript_1.ForeignKey)(() => category_entity_1.Category),
|
|
59
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], Product.prototype, "categoryId", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, sequelize_typescript_1.Column)({ defaultValue: 0 }),
|
|
64
|
+
__metadata("design:type", Number)
|
|
65
|
+
], Product.prototype, "sortOrder", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, sequelize_typescript_1.Column)({ defaultValue: false }),
|
|
68
|
+
__metadata("design:type", Boolean)
|
|
69
|
+
], Product.prototype, "isFeatured", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, sequelize_typescript_1.Column)({ defaultValue: false }),
|
|
72
|
+
__metadata("design:type", Boolean)
|
|
73
|
+
], Product.prototype, "hasVariants", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, sequelize_typescript_1.Column)({
|
|
76
|
+
type: sequelize_typescript_1.DataType.ENUM(...Object.values(status_1.Status)),
|
|
77
|
+
defaultValue: status_1.Status.ACTIVE,
|
|
78
|
+
}),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], Product.prototype, "status", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, sequelize_typescript_1.BelongsTo)(() => brand_entity_1.Brand),
|
|
83
|
+
__metadata("design:type", brand_entity_1.Brand)
|
|
84
|
+
], Product.prototype, "brand", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, sequelize_typescript_1.BelongsTo)(() => category_entity_1.Category),
|
|
87
|
+
__metadata("design:type", category_entity_1.Category)
|
|
88
|
+
], Product.prototype, "category", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, sequelize_typescript_1.HasMany)(() => product_media_entity_1.ProductMedia),
|
|
91
|
+
__metadata("design:type", Array)
|
|
92
|
+
], Product.prototype, "media", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, sequelize_typescript_1.HasMany)(() => product_variant_entity_1.ProductVariant),
|
|
95
|
+
__metadata("design:type", Array)
|
|
96
|
+
], Product.prototype, "variants", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, sequelize_typescript_1.BelongsToMany)(() => store_entity_1.Store, () => product_store_entity_1.ProductStore),
|
|
99
|
+
__metadata("design:type", Array)
|
|
100
|
+
], Product.prototype, "stores", void 0);
|
|
101
|
+
exports.Product = Product = __decorate([
|
|
102
|
+
sequelize_typescript_1.Table
|
|
103
|
+
], Product);
|
|
104
|
+
//# sourceMappingURL=product.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.entity.js","sourceRoot":"","sources":["../../../../../libs/tatayab-entities-library/src/entities/product.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAS8B;AAC9B,iDAAuC;AACvC,uDAA6C;AAC7C,iEAAsD;AACtD,qEAA0D;AAC1D,iEAAsD;AACtD,iDAAuC;AACvC,kDAA+C;AAGxC,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,4BAAK;CA8DjC,CAAA;AA9DY,0BAAO;AAEV;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;uCACN;AAGf;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;uCACN;AAGf;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;8CAClB;AAGvB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;8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;AAGtB;IADP,IAAA,8BAAO,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;;yCACK;AAG3B;IADP,IAAA,oCAAa,EAAC,GAAG,EAAE,CAAC,oBAAK,EAAE,GAAG,EAAE,CAAC,mCAAY,CAAC;;uCACvB;kBA7Db,OAAO;IADnB,4BAAK;GACO,OAAO,CA8DnB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { PurchaseOrder } from './purchase-order.entity';
|
|
3
|
+
import { Product } from './product.entity';
|
|
4
|
+
import { ProductVariant } from './product-variant.entity';
|
|
5
|
+
export declare enum PurchaseOrderItemStatus {
|
|
6
|
+
PENDING = "pending",
|
|
7
|
+
PARTIALLY_RECEIVED = "partially_received",
|
|
8
|
+
FULLY_RECEIVED = "fully_received",
|
|
9
|
+
CANCELLED = "cancelled"
|
|
10
|
+
}
|
|
11
|
+
export declare class PurchaseOrderItem extends Model {
|
|
12
|
+
purchaseOrderId: number;
|
|
13
|
+
productId: number;
|
|
14
|
+
productVariantId?: number;
|
|
15
|
+
orderedQuantity: number;
|
|
16
|
+
receivedQuantity: number;
|
|
17
|
+
reservedQuantity: number;
|
|
18
|
+
unitCostPrice: number;
|
|
19
|
+
totalCostPrice: number;
|
|
20
|
+
status: PurchaseOrderItemStatus;
|
|
21
|
+
triggerOrderId?: number;
|
|
22
|
+
purchaseOrder: PurchaseOrder;
|
|
23
|
+
product: Product;
|
|
24
|
+
variant?: ProductVariant;
|
|
25
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PurchaseOrderItem = exports.PurchaseOrderItemStatus = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const purchase_order_entity_1 = require("./purchase-order.entity");
|
|
15
|
+
const product_entity_1 = require("./product.entity");
|
|
16
|
+
const product_variant_entity_1 = require("./product-variant.entity");
|
|
17
|
+
var PurchaseOrderItemStatus;
|
|
18
|
+
(function (PurchaseOrderItemStatus) {
|
|
19
|
+
PurchaseOrderItemStatus["PENDING"] = "pending";
|
|
20
|
+
PurchaseOrderItemStatus["PARTIALLY_RECEIVED"] = "partially_received";
|
|
21
|
+
PurchaseOrderItemStatus["FULLY_RECEIVED"] = "fully_received";
|
|
22
|
+
PurchaseOrderItemStatus["CANCELLED"] = "cancelled";
|
|
23
|
+
})(PurchaseOrderItemStatus || (exports.PurchaseOrderItemStatus = PurchaseOrderItemStatus = {}));
|
|
24
|
+
let PurchaseOrderItem = class PurchaseOrderItem extends sequelize_typescript_1.Model {
|
|
25
|
+
};
|
|
26
|
+
exports.PurchaseOrderItem = PurchaseOrderItem;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, sequelize_typescript_1.ForeignKey)(() => purchase_order_entity_1.PurchaseOrder),
|
|
29
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], PurchaseOrderItem.prototype, "purchaseOrderId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, sequelize_typescript_1.ForeignKey)(() => product_entity_1.Product),
|
|
34
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], PurchaseOrderItem.prototype, "productId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, sequelize_typescript_1.ForeignKey)(() => product_variant_entity_1.ProductVariant),
|
|
39
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], PurchaseOrderItem.prototype, "productVariantId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], PurchaseOrderItem.prototype, "orderedQuantity", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, sequelize_typescript_1.Column)({ defaultValue: 0 }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], PurchaseOrderItem.prototype, "receivedQuantity", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, sequelize_typescript_1.Column)({ defaultValue: 0 }),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], PurchaseOrderItem.prototype, "reservedQuantity", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: false }),
|
|
56
|
+
__metadata("design:type", Number)
|
|
57
|
+
], PurchaseOrderItem.prototype, "unitCostPrice", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), defaultValue: 0 }),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], PurchaseOrderItem.prototype, "totalCostPrice", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, sequelize_typescript_1.Column)({
|
|
64
|
+
type: sequelize_typescript_1.DataType.ENUM(...Object.values(PurchaseOrderItemStatus)),
|
|
65
|
+
defaultValue: PurchaseOrderItemStatus.PENDING,
|
|
66
|
+
}),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], PurchaseOrderItem.prototype, "status", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
71
|
+
__metadata("design:type", Number)
|
|
72
|
+
], PurchaseOrderItem.prototype, "triggerOrderId", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, sequelize_typescript_1.BelongsTo)(() => purchase_order_entity_1.PurchaseOrder),
|
|
75
|
+
__metadata("design:type", purchase_order_entity_1.PurchaseOrder)
|
|
76
|
+
], PurchaseOrderItem.prototype, "purchaseOrder", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, sequelize_typescript_1.BelongsTo)(() => product_entity_1.Product),
|
|
79
|
+
__metadata("design:type", product_entity_1.Product)
|
|
80
|
+
], PurchaseOrderItem.prototype, "product", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, sequelize_typescript_1.BelongsTo)(() => product_variant_entity_1.ProductVariant),
|
|
83
|
+
__metadata("design:type", product_variant_entity_1.ProductVariant)
|
|
84
|
+
], PurchaseOrderItem.prototype, "variant", void 0);
|
|
85
|
+
exports.PurchaseOrderItem = PurchaseOrderItem = __decorate([
|
|
86
|
+
sequelize_typescript_1.Table
|
|
87
|
+
], PurchaseOrderItem);
|
|
88
|
+
//# sourceMappingURL=purchase-order-item.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchase-order-item.entity.js","sourceRoot":"","sources":["../../../../../libs/tatayab-entities-library/src/entities/purchase-order-item.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAO8B;AAC9B,mEAAwD;AACxD,qDAA2C;AAC3C,qEAA0D;AAE1D,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,8CAAmB,CAAA;IACnB,oEAAyC,CAAA;IACzC,4DAAiC,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C,OAAO;KAC9C,CAAC;;iDACsC;AAIhC;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;yDACI;AAKxB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,CAAC;8BACR,qCAAa;wDAAC;AAG7B;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;8BACR,wBAAO;kDAAC;AAGjB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;8BACd,uCAAc;kDAAC;4BAnDtB,iBAAiB;IAD7B,4BAAK;GACO,iBAAiB,CAoD7B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Vendor } from './vendor.entity';
|
|
3
|
+
import { Inventory } from './inventory.entity';
|
|
4
|
+
import { SysUser } from './sys.user.entity';
|
|
5
|
+
import { PurchaseOrderItem } from './purchase-order-item.entity';
|
|
6
|
+
import { PurchaseOrderStatus } from '../utils/enums/purchaseOrderStatus';
|
|
7
|
+
export declare class PurchaseOrder extends Model {
|
|
8
|
+
poNumber: string;
|
|
9
|
+
vendorId: number;
|
|
10
|
+
inventoryId: number;
|
|
11
|
+
status: PurchaseOrderStatus;
|
|
12
|
+
totalAmount: number;
|
|
13
|
+
currency: string;
|
|
14
|
+
expectedDeliveryDate?: Date;
|
|
15
|
+
sentAt?: Date;
|
|
16
|
+
closedAt?: Date;
|
|
17
|
+
cancelledAt?: Date;
|
|
18
|
+
cancellationReason?: string;
|
|
19
|
+
notes?: string;
|
|
20
|
+
createdBy?: number;
|
|
21
|
+
sentBy?: number;
|
|
22
|
+
vendor: Vendor;
|
|
23
|
+
inventory: Inventory;
|
|
24
|
+
creator?: SysUser;
|
|
25
|
+
sender?: SysUser;
|
|
26
|
+
items: PurchaseOrderItem[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PurchaseOrder = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const vendor_entity_1 = require("./vendor.entity");
|
|
15
|
+
const inventory_entity_1 = require("./inventory.entity");
|
|
16
|
+
const sys_user_entity_1 = require("./sys.user.entity");
|
|
17
|
+
const purchase_order_item_entity_1 = require("./purchase-order-item.entity");
|
|
18
|
+
const purchaseOrderStatus_1 = require("../utils/enums/purchaseOrderStatus");
|
|
19
|
+
let PurchaseOrder = class PurchaseOrder extends sequelize_typescript_1.Model {
|
|
20
|
+
};
|
|
21
|
+
exports.PurchaseOrder = PurchaseOrder;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, unique: true }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], PurchaseOrder.prototype, "poNumber", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, sequelize_typescript_1.ForeignKey)(() => vendor_entity_1.Vendor),
|
|
28
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], PurchaseOrder.prototype, "vendorId", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, sequelize_typescript_1.ForeignKey)(() => inventory_entity_1.Inventory),
|
|
33
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], PurchaseOrder.prototype, "inventoryId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, sequelize_typescript_1.Column)({
|
|
38
|
+
type: sequelize_typescript_1.DataType.ENUM(...Object.values(purchaseOrderStatus_1.PurchaseOrderStatus)),
|
|
39
|
+
defaultValue: purchaseOrderStatus_1.PurchaseOrderStatus.DRAFT,
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], PurchaseOrder.prototype, "status", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), defaultValue: 0 }),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], PurchaseOrder.prototype, "totalAmount", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: 'USD' }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], PurchaseOrder.prototype, "currency", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], PurchaseOrder.prototype, "expectedDeliveryDate", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
57
|
+
__metadata("design:type", Date)
|
|
58
|
+
], PurchaseOrder.prototype, "sentAt", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
61
|
+
__metadata("design:type", Date)
|
|
62
|
+
], PurchaseOrder.prototype, "closedAt", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
65
|
+
__metadata("design:type", Date)
|
|
66
|
+
], PurchaseOrder.prototype, "cancelledAt", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.TEXT, allowNull: true }),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], PurchaseOrder.prototype, "cancellationReason", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.TEXT, allowNull: true }),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], PurchaseOrder.prototype, "notes", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, sequelize_typescript_1.ForeignKey)(() => sys_user_entity_1.SysUser),
|
|
77
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
78
|
+
__metadata("design:type", Number)
|
|
79
|
+
], PurchaseOrder.prototype, "createdBy", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, sequelize_typescript_1.ForeignKey)(() => sys_user_entity_1.SysUser),
|
|
82
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
83
|
+
__metadata("design:type", Number)
|
|
84
|
+
], PurchaseOrder.prototype, "sentBy", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, sequelize_typescript_1.BelongsTo)(() => vendor_entity_1.Vendor),
|
|
87
|
+
__metadata("design:type", vendor_entity_1.Vendor)
|
|
88
|
+
], PurchaseOrder.prototype, "vendor", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, sequelize_typescript_1.BelongsTo)(() => inventory_entity_1.Inventory),
|
|
91
|
+
__metadata("design:type", inventory_entity_1.Inventory)
|
|
92
|
+
], PurchaseOrder.prototype, "inventory", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, sequelize_typescript_1.BelongsTo)(() => sys_user_entity_1.SysUser, { foreignKey: 'createdBy', as: 'creator' }),
|
|
95
|
+
__metadata("design:type", sys_user_entity_1.SysUser)
|
|
96
|
+
], PurchaseOrder.prototype, "creator", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, sequelize_typescript_1.BelongsTo)(() => sys_user_entity_1.SysUser, { foreignKey: 'sentBy', as: 'sender' }),
|
|
99
|
+
__metadata("design:type", sys_user_entity_1.SysUser)
|
|
100
|
+
], PurchaseOrder.prototype, "sender", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, sequelize_typescript_1.HasMany)(() => purchase_order_item_entity_1.PurchaseOrderItem),
|
|
103
|
+
__metadata("design:type", Array)
|
|
104
|
+
], PurchaseOrder.prototype, "items", void 0);
|
|
105
|
+
exports.PurchaseOrder = PurchaseOrder = __decorate([
|
|
106
|
+
sequelize_typescript_1.Table
|
|
107
|
+
], PurchaseOrder);
|
|
108
|
+
//# sourceMappingURL=purchase-order.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchase-order.entity.js","sourceRoot":"","sources":["../../../../../libs/tatayab-entities-library/src/entities/purchase-order.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAQ8B;AAC9B,mDAAyC;AACzC,yDAA+C;AAC/C,uDAA4C;AAC5C,6EAAiE;AACjE,4EAAyE;AAGlE,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,4BAAK;CAqEvC,CAAA;AArEY,sCAAa;AAGhB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;+CAClB;AAIjB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;IACxB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CACJ;AAKjB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,4BAAS,CAAC;IAC3B,IAAA,6B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E,CAAC,yBAAO,CAAC;IACzB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;6CACJ;AAKhB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;8BACR,sBAAM;6CAAC;AAGf;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,4BAAS,CAAC;8BACR,4BAAS;gDAAC;AAGrB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,yBAAO,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;8BACnD,yBAAO;8CAAC;AAGlB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,yBAAO,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;8BAChD,yBAAO;6CAAC;AAGjB;IADP,IAAA,8BAAO,EAAC,GAAG,EAAE,CAAC,8CAAiB,CAAC;;4CACE;wBApExB,aAAa;IADzB,4BAAK;GACO,aAAa,CAqEzB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Inventory } from './inventory.entity';
|
|
3
|
+
import { Product } from './product.entity';
|
|
4
|
+
import { ProductVariant } from './product-variant.entity';
|
|
5
|
+
import { SysUser } from './sys.user.entity';
|
|
6
|
+
import { StockMovementType } from '../utils/enums/stockMovementType';
|
|
7
|
+
export declare class StockMovement extends Model {
|
|
8
|
+
inventoryId: number;
|
|
9
|
+
productId: number;
|
|
10
|
+
productVariantId?: number;
|
|
11
|
+
movementType: StockMovementType;
|
|
12
|
+
quantity: number;
|
|
13
|
+
quantityBefore: number;
|
|
14
|
+
quantityAfter: number;
|
|
15
|
+
referenceType?: string;
|
|
16
|
+
referenceId?: number;
|
|
17
|
+
notes?: string;
|
|
18
|
+
createdBy?: number;
|
|
19
|
+
inventory: Inventory;
|
|
20
|
+
product: Product;
|
|
21
|
+
variant?: ProductVariant;
|
|
22
|
+
createdByUser?: SysUser;
|
|
23
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StockMovement = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const inventory_entity_1 = require("./inventory.entity");
|
|
15
|
+
const product_entity_1 = require("./product.entity");
|
|
16
|
+
const product_variant_entity_1 = require("./product-variant.entity");
|
|
17
|
+
const sys_user_entity_1 = require("./sys.user.entity");
|
|
18
|
+
const stockMovementType_1 = require("../utils/enums/stockMovementType");
|
|
19
|
+
let StockMovement = class StockMovement extends sequelize_typescript_1.Model {
|
|
20
|
+
};
|
|
21
|
+
exports.StockMovement = StockMovement;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, sequelize_typescript_1.ForeignKey)(() => inventory_entity_1.Inventory),
|
|
24
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], StockMovement.prototype, "inventoryId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, sequelize_typescript_1.ForeignKey)(() => product_entity_1.Product),
|
|
29
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], StockMovement.prototype, "productId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, sequelize_typescript_1.ForeignKey)(() => product_variant_entity_1.ProductVariant),
|
|
34
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], StockMovement.prototype, "productVariantId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, sequelize_typescript_1.Column)({
|
|
39
|
+
type: sequelize_typescript_1.DataType.ENUM(...Object.values(stockMovementType_1.StockMovementType)),
|
|
40
|
+
allowNull: false,
|
|
41
|
+
}),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], StockMovement.prototype, "movementType", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], StockMovement.prototype, "quantity", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], StockMovement.prototype, "quantityBefore", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], StockMovement.prototype, "quantityAfter", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], StockMovement.prototype, "referenceType", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
62
|
+
__metadata("design:type", Number)
|
|
63
|
+
], StockMovement.prototype, "referenceId", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.TEXT, allowNull: true }),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], StockMovement.prototype, "notes", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, sequelize_typescript_1.ForeignKey)(() => sys_user_entity_1.SysUser),
|
|
70
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
71
|
+
__metadata("design:type", Number)
|
|
72
|
+
], StockMovement.prototype, "createdBy", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, sequelize_typescript_1.BelongsTo)(() => inventory_entity_1.Inventory),
|
|
75
|
+
__metadata("design:type", inventory_entity_1.Inventory)
|
|
76
|
+
], StockMovement.prototype, "inventory", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, sequelize_typescript_1.BelongsTo)(() => product_entity_1.Product),
|
|
79
|
+
__metadata("design:type", product_entity_1.Product)
|
|
80
|
+
], StockMovement.prototype, "product", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, sequelize_typescript_1.BelongsTo)(() => product_variant_entity_1.ProductVariant),
|
|
83
|
+
__metadata("design:type", product_variant_entity_1.ProductVariant)
|
|
84
|
+
], StockMovement.prototype, "variant", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, sequelize_typescript_1.BelongsTo)(() => sys_user_entity_1.SysUser),
|
|
87
|
+
__metadata("design:type", sys_user_entity_1.SysUser)
|
|
88
|
+
], StockMovement.prototype, "createdByUser", void 0);
|
|
89
|
+
exports.StockMovement = StockMovement = __decorate([
|
|
90
|
+
sequelize_typescript_1.Table
|
|
91
|
+
], StockMovement);
|
|
92
|
+
//# sourceMappingURL=stock-movement.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stock-movement.entity.js","sourceRoot":"","sources":["../../../../../libs/tatayab-entities-library/src/entities/stock-movement.entity.ts"],"names":[],"mappings":";;;;;;;;;;;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;AAIf;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,yBAAO,CAAC;IACzB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;gDACD;AAKnB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,4BAAS,CAAC;8BACR,4BAAS;gDAAC;AAGrB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;8BACR,wBAAO;8CAAC;AAGjB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;8BACd,uCAAc;8CAAC;AAGzB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,yBAAO,CAAC;8BACD,yBAAO;oDAAC;wBAzDrB,aAAa;IADzB,4BAAK;GACO,aAAa,CA0DzB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StoreInventory = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const store_entity_1 = require("./store.entity");
|
|
15
|
+
const inventory_entity_1 = require("./inventory.entity");
|
|
16
|
+
let StoreInventory = class StoreInventory extends sequelize_typescript_1.Model {
|
|
17
|
+
};
|
|
18
|
+
exports.StoreInventory = StoreInventory;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, sequelize_typescript_1.ForeignKey)(() => store_entity_1.Store),
|
|
21
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], StoreInventory.prototype, "storeId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, sequelize_typescript_1.ForeignKey)(() => inventory_entity_1.Inventory),
|
|
26
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], StoreInventory.prototype, "inventoryId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, sequelize_typescript_1.Column)({ defaultValue: 1 }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], StoreInventory.prototype, "priority", void 0);
|
|
33
|
+
exports.StoreInventory = StoreInventory = __decorate([
|
|
34
|
+
sequelize_typescript_1.Table
|
|
35
|
+
], StoreInventory);
|
|
36
|
+
//# sourceMappingURL=store-inventory.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-inventory.entity.js","sourceRoot":"","sources":["../../../../../libs/tatayab-entities-library/src/entities/store-inventory.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAM8B;AAC9B,iDAAuC;AACvC,yDAA+C;AAGxC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAK;CAYxC,CAAA;AAZY,wCAAc;AAGjB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;IACvB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CACL;AAIhB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,4BAAS,CAAC;IAC3B,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;mDACD;AAIpB;IADP,IAAA,6BAAM,EAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;gDACH;yBAXd,cAAc;IAD1B,4BAAK;GACO,cAAc,CAY1B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Country } from './country.entity';
|
|
3
|
+
import { Product } from './product.entity';
|
|
4
|
+
import { Inventory } from './inventory.entity';
|
|
5
|
+
import { Status } from '../utils/enums/status';
|
|
6
|
+
export declare class Store extends Model {
|
|
7
|
+
nameEn: string;
|
|
8
|
+
nameAr: string;
|
|
9
|
+
descriptionEn?: string;
|
|
10
|
+
descriptionAr?: string;
|
|
11
|
+
logo?: string;
|
|
12
|
+
currency: string;
|
|
13
|
+
currencySymbolEn?: string;
|
|
14
|
+
currencySymbolAr?: string;
|
|
15
|
+
countryId?: number;
|
|
16
|
+
isGlobal: boolean;
|
|
17
|
+
status: Status;
|
|
18
|
+
country: Country;
|
|
19
|
+
products: Product[];
|
|
20
|
+
inventories: Inventory[];
|
|
21
|
+
}
|