proflores-db-model 0.1.23 → 0.1.24
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/ReadMe.txt +2 -0
- package/dist/entities/Branches.d.ts +9 -0
- package/dist/entities/Branches.js +43 -0
- package/dist/entities/Inventory.d.ts +13 -0
- package/dist/entities/Inventory.js +53 -0
- package/dist/entities/ProductImage.d.ts +6 -0
- package/dist/entities/ProductImage.js +33 -0
- package/dist/entities/Products.d.ts +14 -0
- package/dist/entities/Products.js +56 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -1
- package/package.json +1 -1
- package/src/entities/Branches.ts +23 -0
- package/src/entities/Inventory.ts +33 -0
- package/src/entities/ProductImage.ts +18 -0
- package/src/entities/Products.ts +35 -0
- package/src/index.ts +4 -1
- package/dist/entities/Transaction.d.ts +0 -0
- package/dist/entities/Transaction.js +0 -1
package/ReadMe.txt
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
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.Branch = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let Branch = class Branch {
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
18
|
+
__metadata("design:type", Number)
|
|
19
|
+
], Branch.prototype, "idBranch", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 255 }),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], Branch.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 255 }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], Branch.prototype, "address", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 255 }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], Branch.prototype, "phone", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 255 }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Branch.prototype, "email", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 255 }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], Branch.prototype, "city", void 0);
|
|
40
|
+
Branch = __decorate([
|
|
41
|
+
(0, typeorm_1.Entity)("branches")
|
|
42
|
+
], Branch);
|
|
43
|
+
exports.Branch = Branch;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { Product } from "./Products";
|
|
3
|
+
import { UnitOfMeasure } from "./UnitOfMesure";
|
|
4
|
+
import { Branch } from "./Branches";
|
|
5
|
+
export declare class Inventory implements ObjectLiteral {
|
|
6
|
+
idInventory: number;
|
|
7
|
+
product: Product;
|
|
8
|
+
quantity: number;
|
|
9
|
+
wholesalePrice: number;
|
|
10
|
+
retailPrice: number;
|
|
11
|
+
unitOfMeasure: UnitOfMeasure;
|
|
12
|
+
branch: Branch;
|
|
13
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.Inventory = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Products_1 = require("./Products");
|
|
15
|
+
const UnitOfMesure_1 = require("./UnitOfMesure");
|
|
16
|
+
const Branches_1 = require("./Branches");
|
|
17
|
+
let Inventory = class Inventory {
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], Inventory.prototype, "idInventory", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.ManyToOne)(() => Products_1.Product),
|
|
25
|
+
(0, typeorm_1.JoinColumn)({ name: "idProduct" }),
|
|
26
|
+
__metadata("design:type", Products_1.Product)
|
|
27
|
+
], Inventory.prototype, "product", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)("decimal", { nullable: false }),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], Inventory.prototype, "quantity", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)("decimal", { nullable: false }),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], Inventory.prototype, "wholesalePrice", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)("decimal", { nullable: false }),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], Inventory.prototype, "retailPrice", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.ManyToOne)(() => UnitOfMesure_1.UnitOfMeasure),
|
|
42
|
+
(0, typeorm_1.JoinColumn)({ name: "idUnitOfMeasure" }),
|
|
43
|
+
__metadata("design:type", UnitOfMesure_1.UnitOfMeasure)
|
|
44
|
+
], Inventory.prototype, "unitOfMeasure", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.ManyToOne)(() => Branches_1.Branch),
|
|
47
|
+
(0, typeorm_1.JoinColumn)({ name: "idBranch" }),
|
|
48
|
+
__metadata("design:type", Branches_1.Branch)
|
|
49
|
+
], Inventory.prototype, "branch", void 0);
|
|
50
|
+
Inventory = __decorate([
|
|
51
|
+
(0, typeorm_1.Entity)("inventory")
|
|
52
|
+
], Inventory);
|
|
53
|
+
exports.Inventory = Inventory;
|
|
@@ -0,0 +1,33 @@
|
|
|
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.ProductImage = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Products_1 = require("./Products");
|
|
15
|
+
let ProductImage = class ProductImage {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], ProductImage.prototype, "id", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 500 }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], ProductImage.prototype, "imageUrl", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => Products_1.Product, (products) => products.images, { onDelete: "CASCADE" }),
|
|
27
|
+
(0, typeorm_1.JoinColumn)({ name: "productId" }),
|
|
28
|
+
__metadata("design:type", Products_1.Product)
|
|
29
|
+
], ProductImage.prototype, "product", void 0);
|
|
30
|
+
ProductImage = __decorate([
|
|
31
|
+
(0, typeorm_1.Entity)("product_images")
|
|
32
|
+
], ProductImage);
|
|
33
|
+
exports.ProductImage = ProductImage;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { ContainerType } from "./ContainerType";
|
|
3
|
+
import { CategoryForPlantType } from "./CategoryForPlantType";
|
|
4
|
+
import { ProductImage } from "./ProductImage";
|
|
5
|
+
export declare class Product implements ObjectLiteral {
|
|
6
|
+
idProduct: number;
|
|
7
|
+
name: string;
|
|
8
|
+
secondaryName: string;
|
|
9
|
+
description: string;
|
|
10
|
+
container: ContainerType;
|
|
11
|
+
categoryForPlantType: CategoryForPlantType;
|
|
12
|
+
images: ProductImage[];
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 typeorm_1 = require("typeorm");
|
|
14
|
+
const ContainerType_1 = require("./ContainerType");
|
|
15
|
+
const CategoryForPlantType_1 = require("./CategoryForPlantType");
|
|
16
|
+
const ProductImage_1 = require("./ProductImage");
|
|
17
|
+
let Product = class Product {
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], Product.prototype, "idProduct", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 255 }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Product.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 255 }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], Product.prototype, "secondaryName", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 255 }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Product.prototype, "description", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => ContainerType_1.ContainerType, { nullable: false }),
|
|
37
|
+
(0, typeorm_1.JoinColumn)({ name: "containerId" }),
|
|
38
|
+
__metadata("design:type", ContainerType_1.ContainerType)
|
|
39
|
+
], Product.prototype, "container", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.ManyToOne)(() => CategoryForPlantType_1.CategoryForPlantType),
|
|
42
|
+
(0, typeorm_1.JoinColumn)({ name: "categoryForPlantTypeId" }),
|
|
43
|
+
__metadata("design:type", CategoryForPlantType_1.CategoryForPlantType)
|
|
44
|
+
], Product.prototype, "categoryForPlantType", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.OneToMany)(() => ProductImage_1.ProductImage, (productImage) => productImage.product, { cascade: true }),
|
|
47
|
+
__metadata("design:type", Array)
|
|
48
|
+
], Product.prototype, "images", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)("boolean", { default: true }),
|
|
51
|
+
__metadata("design:type", Boolean)
|
|
52
|
+
], Product.prototype, "isActive", void 0);
|
|
53
|
+
Product = __decorate([
|
|
54
|
+
(0, typeorm_1.Entity)("products")
|
|
55
|
+
], Product);
|
|
56
|
+
exports.Product = Product;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,4 +11,8 @@ export { CategoryForPlantType } from "./entities/CategoryForPlantType";
|
|
|
11
11
|
export { UnitOfMeasure } from "./entities/UnitOfMesure";
|
|
12
12
|
export { BankAccount } from "./entities/Bank/BankAccount";
|
|
13
13
|
export { TransactionBank } from "./entities/Bank/TransactionBank";
|
|
14
|
+
export { ProductImage } from "./entities/ProductImage";
|
|
15
|
+
export { Product } from "./entities/Products";
|
|
16
|
+
export { Inventory } from "./entities/Inventory";
|
|
17
|
+
export { Branch } from "./entities/Branches";
|
|
14
18
|
export * from "./types";
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.TransactionBank = exports.BankAccount = exports.UnitOfMeasure = exports.CategoryForPlantType = exports.CategoryForCosting = exports.Supplier = exports.ContainerType = exports.InventoryItem = exports.ExpenseTransaction = exports.User = exports.ProjectOrder = exports.ExpenseType = exports.ExpenseDetail = void 0;
|
|
17
|
+
exports.Branch = exports.Inventory = exports.Product = exports.ProductImage = exports.TransactionBank = exports.BankAccount = exports.UnitOfMeasure = exports.CategoryForPlantType = exports.CategoryForCosting = exports.Supplier = exports.ContainerType = exports.InventoryItem = exports.ExpenseTransaction = exports.User = exports.ProjectOrder = exports.ExpenseType = exports.ExpenseDetail = void 0;
|
|
18
18
|
var ExpenseDetail_1 = require("./entities/ExpenseDetail");
|
|
19
19
|
Object.defineProperty(exports, "ExpenseDetail", { enumerable: true, get: function () { return ExpenseDetail_1.ExpenseDetail; } });
|
|
20
20
|
var ExpenseType_1 = require("./entities/ExpenseType");
|
|
@@ -41,4 +41,12 @@ var BankAccount_1 = require("./entities/Bank/BankAccount");
|
|
|
41
41
|
Object.defineProperty(exports, "BankAccount", { enumerable: true, get: function () { return BankAccount_1.BankAccount; } });
|
|
42
42
|
var TransactionBank_1 = require("./entities/Bank/TransactionBank");
|
|
43
43
|
Object.defineProperty(exports, "TransactionBank", { enumerable: true, get: function () { return TransactionBank_1.TransactionBank; } });
|
|
44
|
+
var ProductImage_1 = require("./entities/ProductImage");
|
|
45
|
+
Object.defineProperty(exports, "ProductImage", { enumerable: true, get: function () { return ProductImage_1.ProductImage; } });
|
|
46
|
+
var Products_1 = require("./entities/Products");
|
|
47
|
+
Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return Products_1.Product; } });
|
|
48
|
+
var Inventory_1 = require("./entities/Inventory");
|
|
49
|
+
Object.defineProperty(exports, "Inventory", { enumerable: true, get: function () { return Inventory_1.Inventory; } });
|
|
50
|
+
var Branches_1 = require("./entities/Branches");
|
|
51
|
+
Object.defineProperty(exports, "Branch", { enumerable: true, get: function () { return Branches_1.Branch; } });
|
|
44
52
|
__exportStar(require("./types"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Entity, PrimaryGeneratedColumn, Column, ObjectLiteral } from "typeorm";
|
|
2
|
+
|
|
3
|
+
@Entity("branches")
|
|
4
|
+
export class Branch implements ObjectLiteral {
|
|
5
|
+
@PrimaryGeneratedColumn("increment")
|
|
6
|
+
idBranch!: number;
|
|
7
|
+
|
|
8
|
+
@Column("varchar", { nullable: false, length: 255 })
|
|
9
|
+
name!: string;
|
|
10
|
+
|
|
11
|
+
@Column("varchar", { nullable: false, length: 255 })
|
|
12
|
+
address!: string;
|
|
13
|
+
|
|
14
|
+
@Column("varchar", { nullable: false, length: 255 })
|
|
15
|
+
phone!: string;
|
|
16
|
+
|
|
17
|
+
@Column("varchar", { nullable: false, length: 255 })
|
|
18
|
+
email!: string;
|
|
19
|
+
|
|
20
|
+
@Column("varchar", { nullable: false, length: 255 })
|
|
21
|
+
city!: string;
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Entity, PrimaryGeneratedColumn, Column, ObjectLiteral, ManyToOne, JoinColumn } from "typeorm";
|
|
2
|
+
import { Product } from "./Products";
|
|
3
|
+
import { UnitOfMeasure } from "./UnitOfMesure";
|
|
4
|
+
import { Branch } from "./Branches";
|
|
5
|
+
|
|
6
|
+
@Entity("inventory")
|
|
7
|
+
export class Inventory implements ObjectLiteral {
|
|
8
|
+
@PrimaryGeneratedColumn("increment")
|
|
9
|
+
idInventory!: number;
|
|
10
|
+
|
|
11
|
+
@ManyToOne(() => Product)
|
|
12
|
+
@JoinColumn({ name: "idProduct" })
|
|
13
|
+
product!: Product;
|
|
14
|
+
|
|
15
|
+
@Column("decimal", { nullable: false })
|
|
16
|
+
quantity!: number;
|
|
17
|
+
|
|
18
|
+
@Column("decimal", { nullable: false })
|
|
19
|
+
wholesalePrice!: number;
|
|
20
|
+
|
|
21
|
+
@Column("decimal", { nullable: false })
|
|
22
|
+
retailPrice!: number;
|
|
23
|
+
|
|
24
|
+
@ManyToOne(() => UnitOfMeasure)
|
|
25
|
+
@JoinColumn({ name: "idUnitOfMeasure" })
|
|
26
|
+
unitOfMeasure!: UnitOfMeasure;
|
|
27
|
+
|
|
28
|
+
@ManyToOne(() => Branch)
|
|
29
|
+
@JoinColumn({ name: "idBranch" })
|
|
30
|
+
branch!: Branch;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn
|
|
3
|
+
} from "typeorm";
|
|
4
|
+
import { Product } from "./Products";
|
|
5
|
+
|
|
6
|
+
@Entity("product_images")
|
|
7
|
+
export class ProductImage {
|
|
8
|
+
@PrimaryGeneratedColumn("increment")
|
|
9
|
+
id!: number;
|
|
10
|
+
|
|
11
|
+
@Column("varchar", { nullable: false, length: 500 })
|
|
12
|
+
imageUrl!: string;
|
|
13
|
+
|
|
14
|
+
@ManyToOne(() => Product, (products) => products.images, { onDelete: "CASCADE" })
|
|
15
|
+
@JoinColumn({ name: "productId" })
|
|
16
|
+
product!: Product;
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Entity, PrimaryGeneratedColumn, Column, ObjectLiteral, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
|
2
|
+
import { ContainerType } from "./ContainerType";
|
|
3
|
+
import { CategoryForPlantType } from "./CategoryForPlantType";
|
|
4
|
+
import { ProductImage } from "./ProductImage";
|
|
5
|
+
|
|
6
|
+
@Entity("products")
|
|
7
|
+
export class Product implements ObjectLiteral {
|
|
8
|
+
@PrimaryGeneratedColumn("increment")
|
|
9
|
+
idProduct!: number;
|
|
10
|
+
|
|
11
|
+
@Column("varchar", { nullable: false, length: 255 })
|
|
12
|
+
name!: string;
|
|
13
|
+
|
|
14
|
+
@Column("varchar", { nullable: false, length: 255 })
|
|
15
|
+
secondaryName!: string;
|
|
16
|
+
|
|
17
|
+
@Column("varchar", { nullable: false, length: 255 })
|
|
18
|
+
description!: string;
|
|
19
|
+
|
|
20
|
+
@ManyToOne(() => ContainerType, { nullable: false })
|
|
21
|
+
@JoinColumn({ name: "containerId" })
|
|
22
|
+
container!: ContainerType;
|
|
23
|
+
|
|
24
|
+
@ManyToOne(() => CategoryForPlantType)
|
|
25
|
+
@JoinColumn({ name: "categoryForPlantTypeId" })
|
|
26
|
+
categoryForPlantType!: CategoryForPlantType;
|
|
27
|
+
|
|
28
|
+
@OneToMany(() => ProductImage, (productImage) => productImage.product, { cascade: true })
|
|
29
|
+
images!: ProductImage[];
|
|
30
|
+
|
|
31
|
+
@Column("boolean", { default: true })
|
|
32
|
+
isActive!: boolean;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -11,6 +11,9 @@ export { CategoryForPlantType } from "./entities/CategoryForPlantType";
|
|
|
11
11
|
export { UnitOfMeasure } from "./entities/UnitOfMesure";
|
|
12
12
|
export { BankAccount } from "./entities/Bank/BankAccount";
|
|
13
13
|
export { TransactionBank } from "./entities/Bank/TransactionBank";
|
|
14
|
-
|
|
14
|
+
export { ProductImage } from "./entities/ProductImage";
|
|
15
|
+
export { Product } from "./entities/Products";
|
|
16
|
+
export { Inventory } from "./entities/Inventory";
|
|
17
|
+
export { Branch } from "./entities/Branches";
|
|
15
18
|
|
|
16
19
|
export * from "./types";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|