proflores-db-model 0.1.25 → 0.1.27
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/entities/BranchImage.d.ts +6 -0
- package/dist/entities/BranchImage.js +35 -0
- package/dist/entities/Branches.d.ts +2 -0
- package/dist/entities/Branches.js +7 -0
- package/dist/entities/Inventory.d.ts +2 -0
- package/dist/entities/Inventory.js +6 -0
- package/dist/entities/ProductImage.d.ts +1 -1
- package/dist/entities/ProductImage.js +1 -1
- package/dist/entities/SupplierImage.d.ts +6 -0
- package/dist/entities/SupplierImage.js +35 -0
- package/dist/entities/Suppliers.d.ts +7 -0
- package/dist/entities/Suppliers.js +24 -0
- package/package.json +1 -1
- package/src/entities/BranchImage.ts +23 -0
- package/src/entities/Branches.ts +6 -1
- package/src/entities/Inventory.ts +5 -0
- package/src/entities/ProductImage.ts +1 -1
- package/src/entities/SupplierImage.ts +17 -0
- package/src/entities/Suppliers.ts +19 -1
|
@@ -0,0 +1,35 @@
|
|
|
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.BranchImage = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Branches_1 = require("./Branches");
|
|
15
|
+
let BranchImage = class BranchImage {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], BranchImage.prototype, "idBranchImage", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 500 }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], BranchImage.prototype, "imageUrl", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => Branches_1.Branch, (branches) => branches.images, {
|
|
27
|
+
onDelete: "CASCADE",
|
|
28
|
+
}),
|
|
29
|
+
(0, typeorm_1.JoinColumn)({ name: "branchId" }),
|
|
30
|
+
__metadata("design:type", Branches_1.Branch)
|
|
31
|
+
], BranchImage.prototype, "branch", void 0);
|
|
32
|
+
BranchImage = __decorate([
|
|
33
|
+
(0, typeorm_1.Entity)("branch_images")
|
|
34
|
+
], BranchImage);
|
|
35
|
+
exports.BranchImage = BranchImage;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ObjectLiteral } from "typeorm";
|
|
2
2
|
import { Inventory } from "./Inventory";
|
|
3
|
+
import { BranchImage } from "./BranchImage";
|
|
3
4
|
export declare class Branch implements ObjectLiteral {
|
|
4
5
|
idBranch: number;
|
|
5
6
|
name: string;
|
|
@@ -8,4 +9,5 @@ export declare class Branch implements ObjectLiteral {
|
|
|
8
9
|
email: string;
|
|
9
10
|
city: string;
|
|
10
11
|
inventory: Inventory[];
|
|
12
|
+
images: BranchImage[];
|
|
11
13
|
}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.Branch = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const Inventory_1 = require("./Inventory");
|
|
15
|
+
const BranchImage_1 = require("./BranchImage");
|
|
15
16
|
let Branch = class Branch {
|
|
16
17
|
};
|
|
17
18
|
__decorate([
|
|
@@ -42,6 +43,12 @@ __decorate([
|
|
|
42
43
|
(0, typeorm_1.OneToMany)(() => Inventory_1.Inventory, (inventory) => inventory.branch),
|
|
43
44
|
__metadata("design:type", Array)
|
|
44
45
|
], Branch.prototype, "inventory", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.OneToMany)(() => BranchImage_1.BranchImage, (branchImage) => branchImage.branch, {
|
|
48
|
+
cascade: true,
|
|
49
|
+
}),
|
|
50
|
+
__metadata("design:type", Array)
|
|
51
|
+
], Branch.prototype, "images", void 0);
|
|
45
52
|
Branch = __decorate([
|
|
46
53
|
(0, typeorm_1.Entity)("branches")
|
|
47
54
|
], Branch);
|
|
@@ -3,6 +3,7 @@ import { Product } from "./Products";
|
|
|
3
3
|
import { UnitOfMeasure } from "./UnitOfMesure";
|
|
4
4
|
import { Branch } from "./Branches";
|
|
5
5
|
import { ContainerType } from "./ContainerType";
|
|
6
|
+
import { Supplier } from "./Suppliers";
|
|
6
7
|
export declare class Inventory implements ObjectLiteral {
|
|
7
8
|
idInventory: number;
|
|
8
9
|
product: Product;
|
|
@@ -12,4 +13,5 @@ export declare class Inventory implements ObjectLiteral {
|
|
|
12
13
|
retailPrice: number;
|
|
13
14
|
unitOfMeasure: UnitOfMeasure;
|
|
14
15
|
branch: Branch;
|
|
16
|
+
supplier: Supplier;
|
|
15
17
|
}
|
|
@@ -15,6 +15,7 @@ const Products_1 = require("./Products");
|
|
|
15
15
|
const UnitOfMesure_1 = require("./UnitOfMesure");
|
|
16
16
|
const Branches_1 = require("./Branches");
|
|
17
17
|
const ContainerType_1 = require("./ContainerType");
|
|
18
|
+
const Suppliers_1 = require("./Suppliers");
|
|
18
19
|
let Inventory = class Inventory {
|
|
19
20
|
};
|
|
20
21
|
__decorate([
|
|
@@ -53,6 +54,11 @@ __decorate([
|
|
|
53
54
|
(0, typeorm_1.JoinColumn)({ name: "idBranch" }),
|
|
54
55
|
__metadata("design:type", Branches_1.Branch)
|
|
55
56
|
], Inventory.prototype, "branch", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.ManyToOne)(() => Suppliers_1.Supplier),
|
|
59
|
+
(0, typeorm_1.JoinColumn)({ name: "idSupplier" }),
|
|
60
|
+
__metadata("design:type", Suppliers_1.Supplier)
|
|
61
|
+
], Inventory.prototype, "supplier", void 0);
|
|
56
62
|
Inventory = __decorate([
|
|
57
63
|
(0, typeorm_1.Entity)("inventory")
|
|
58
64
|
], Inventory);
|
|
@@ -17,7 +17,7 @@ let ProductImage = class ProductImage {
|
|
|
17
17
|
__decorate([
|
|
18
18
|
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
19
19
|
__metadata("design:type", Number)
|
|
20
|
-
], ProductImage.prototype, "
|
|
20
|
+
], ProductImage.prototype, "idProductImage", void 0);
|
|
21
21
|
__decorate([
|
|
22
22
|
(0, typeorm_1.Column)("varchar", { nullable: false, length: 500 }),
|
|
23
23
|
__metadata("design:type", String)
|
|
@@ -0,0 +1,35 @@
|
|
|
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.SupplierImage = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Suppliers_1 = require("./Suppliers");
|
|
15
|
+
let SupplierImage = class SupplierImage {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], SupplierImage.prototype, "idSupplierImage", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, length: 500 }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], SupplierImage.prototype, "imageUrl", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => Suppliers_1.Supplier, (suppliers) => suppliers.images, {
|
|
27
|
+
onDelete: "CASCADE",
|
|
28
|
+
}),
|
|
29
|
+
(0, typeorm_1.JoinColumn)({ name: "supplierId" }),
|
|
30
|
+
__metadata("design:type", Suppliers_1.Supplier)
|
|
31
|
+
], SupplierImage.prototype, "supplier", void 0);
|
|
32
|
+
SupplierImage = __decorate([
|
|
33
|
+
(0, typeorm_1.Entity)("supplier_images")
|
|
34
|
+
], SupplierImage);
|
|
35
|
+
exports.SupplierImage = SupplierImage;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { ObjectLiteral } from "typeorm";
|
|
2
2
|
import { InventoryItem } from "./InventoryItem";
|
|
3
|
+
import { Inventory } from "./Inventory";
|
|
4
|
+
import { SupplierImage } from "./SupplierImage";
|
|
3
5
|
export declare class Supplier implements ObjectLiteral {
|
|
4
6
|
idSupplier: number;
|
|
5
7
|
name: string;
|
|
6
8
|
contactInfo: string;
|
|
9
|
+
address: string;
|
|
10
|
+
phone: string;
|
|
11
|
+
email: string;
|
|
12
|
+
inventory: Inventory[];
|
|
7
13
|
inventoryItems: InventoryItem[];
|
|
14
|
+
images: SupplierImage[];
|
|
8
15
|
}
|
|
@@ -12,6 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.Supplier = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const InventoryItem_1 = require("./InventoryItem");
|
|
15
|
+
const Inventory_1 = require("./Inventory");
|
|
16
|
+
const SupplierImage_1 = require("./SupplierImage");
|
|
15
17
|
let Supplier = class Supplier {
|
|
16
18
|
};
|
|
17
19
|
__decorate([
|
|
@@ -26,10 +28,32 @@ __decorate([
|
|
|
26
28
|
(0, typeorm_1.Column)("varchar", { nullable: true, length: 255 }),
|
|
27
29
|
__metadata("design:type", String)
|
|
28
30
|
], Supplier.prototype, "contactInfo", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Supplier.prototype, "address", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)("varchar", { nullable: true, length: 255 }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], Supplier.prototype, "phone", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)("varchar", { nullable: true, length: 255 }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], Supplier.prototype, "email", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.OneToMany)(() => Inventory_1.Inventory, (inventory) => inventory.supplier),
|
|
45
|
+
__metadata("design:type", Array)
|
|
46
|
+
], Supplier.prototype, "inventory", void 0);
|
|
29
47
|
__decorate([
|
|
30
48
|
(0, typeorm_1.OneToMany)(() => InventoryItem_1.InventoryItem, (inventoryItem) => inventoryItem.supplier),
|
|
31
49
|
__metadata("design:type", Array)
|
|
32
50
|
], Supplier.prototype, "inventoryItems", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.OneToMany)(() => SupplierImage_1.SupplierImage, (supplierImage) => supplierImage.supplier, {
|
|
53
|
+
cascade: true,
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:type", Array)
|
|
56
|
+
], Supplier.prototype, "images", void 0);
|
|
33
57
|
Supplier = __decorate([
|
|
34
58
|
(0, typeorm_1.Entity)("suppliers")
|
|
35
59
|
], Supplier);
|
package/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
JoinColumn,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { Branch } from "./Branches";
|
|
9
|
+
|
|
10
|
+
@Entity("branch_images")
|
|
11
|
+
export class BranchImage {
|
|
12
|
+
@PrimaryGeneratedColumn("increment")
|
|
13
|
+
idBranchImage!: number;
|
|
14
|
+
|
|
15
|
+
@Column("varchar", { nullable: false, length: 500 })
|
|
16
|
+
imageUrl!: string;
|
|
17
|
+
|
|
18
|
+
@ManyToOne(() => Branch, (branches) => branches.images, {
|
|
19
|
+
onDelete: "CASCADE",
|
|
20
|
+
})
|
|
21
|
+
@JoinColumn({ name: "branchId" })
|
|
22
|
+
branch!: Branch;
|
|
23
|
+
}
|
package/src/entities/Branches.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entity, PrimaryGeneratedColumn, Column, ObjectLiteral, OneToMany } from "typeorm";
|
|
2
2
|
import { Inventory } from "./Inventory";
|
|
3
|
-
|
|
3
|
+
import { BranchImage } from "./BranchImage";
|
|
4
4
|
@Entity("branches")
|
|
5
5
|
export class Branch implements ObjectLiteral {
|
|
6
6
|
@PrimaryGeneratedColumn("increment")
|
|
@@ -24,4 +24,9 @@ export class Branch implements ObjectLiteral {
|
|
|
24
24
|
@OneToMany(() => Inventory, (inventory) => inventory.branch)
|
|
25
25
|
inventory!: Inventory[];
|
|
26
26
|
|
|
27
|
+
@OneToMany(() => BranchImage, (branchImage) => branchImage.branch, {
|
|
28
|
+
cascade: true,
|
|
29
|
+
})
|
|
30
|
+
images!: BranchImage[];
|
|
31
|
+
|
|
27
32
|
}
|
|
@@ -3,6 +3,7 @@ import { Product } from "./Products";
|
|
|
3
3
|
import { UnitOfMeasure } from "./UnitOfMesure";
|
|
4
4
|
import { Branch } from "./Branches";
|
|
5
5
|
import { ContainerType } from "./ContainerType";
|
|
6
|
+
import { Supplier } from "./Suppliers";
|
|
6
7
|
|
|
7
8
|
@Entity("inventory")
|
|
8
9
|
export class Inventory implements ObjectLiteral {
|
|
@@ -33,6 +34,10 @@ export class Inventory implements ObjectLiteral {
|
|
|
33
34
|
@ManyToOne(() => Branch)
|
|
34
35
|
@JoinColumn({ name: "idBranch" })
|
|
35
36
|
branch!: Branch;
|
|
37
|
+
|
|
38
|
+
@ManyToOne(() => Supplier)
|
|
39
|
+
@JoinColumn({ name: "idSupplier" })
|
|
40
|
+
supplier!: Supplier;
|
|
36
41
|
|
|
37
42
|
|
|
38
43
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from "typeorm";
|
|
2
|
+
import { Supplier } from "./Suppliers";
|
|
3
|
+
|
|
4
|
+
@Entity("supplier_images")
|
|
5
|
+
export class SupplierImage {
|
|
6
|
+
@PrimaryGeneratedColumn("increment")
|
|
7
|
+
idSupplierImage!: number;
|
|
8
|
+
|
|
9
|
+
@Column("varchar", { nullable: false, length: 500 })
|
|
10
|
+
imageUrl!: string;
|
|
11
|
+
|
|
12
|
+
@ManyToOne(() => Supplier, (suppliers) => suppliers.images, {
|
|
13
|
+
onDelete: "CASCADE",
|
|
14
|
+
})
|
|
15
|
+
@JoinColumn({ name: "supplierId" })
|
|
16
|
+
supplier!: Supplier;
|
|
17
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Entity, PrimaryGeneratedColumn, Column, ObjectLiteral, OneToMany } from "typeorm";
|
|
2
2
|
import { InventoryItem } from "./InventoryItem";
|
|
3
|
-
|
|
3
|
+
import { Inventory } from "./Inventory";
|
|
4
|
+
import { SupplierImage } from "./SupplierImage";
|
|
4
5
|
@Entity("suppliers")
|
|
5
6
|
export class Supplier implements ObjectLiteral {
|
|
6
7
|
@PrimaryGeneratedColumn("increment")
|
|
@@ -12,6 +13,23 @@ export class Supplier implements ObjectLiteral {
|
|
|
12
13
|
@Column("varchar", { nullable: true, length: 255 })
|
|
13
14
|
contactInfo!: string;
|
|
14
15
|
|
|
16
|
+
@Column("text", { nullable: true })
|
|
17
|
+
address!: string;
|
|
18
|
+
|
|
19
|
+
@Column("varchar", { nullable: true, length: 255 })
|
|
20
|
+
phone!: string;
|
|
21
|
+
|
|
22
|
+
@Column("varchar", { nullable: true, length: 255 })
|
|
23
|
+
email!: string;
|
|
24
|
+
|
|
25
|
+
@OneToMany(() => Inventory, (inventory) => inventory.supplier)
|
|
26
|
+
inventory!: Inventory[];
|
|
27
|
+
|
|
15
28
|
@OneToMany(() => InventoryItem, (inventoryItem) => inventoryItem.supplier)
|
|
16
29
|
inventoryItems!: InventoryItem[];
|
|
30
|
+
|
|
31
|
+
@OneToMany(() => SupplierImage, (supplierImage) => supplierImage.supplier, {
|
|
32
|
+
cascade: true,
|
|
33
|
+
})
|
|
34
|
+
images!: SupplierImage[];
|
|
17
35
|
}
|