proflores-db-model 0.1.25 → 0.1.26

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.
@@ -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);
@@ -1,8 +1,13 @@
1
1
  import { ObjectLiteral } from "typeorm";
2
2
  import { InventoryItem } from "./InventoryItem";
3
+ import { Inventory } from "./Inventory";
3
4
  export declare class Supplier implements ObjectLiteral {
4
5
  idSupplier: number;
5
6
  name: string;
6
7
  contactInfo: string;
8
+ address: string;
9
+ phone: string;
10
+ email: string;
11
+ inventory: Inventory[];
7
12
  inventoryItems: InventoryItem[];
8
13
  }
@@ -12,6 +12,7 @@ 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");
15
16
  let Supplier = class Supplier {
16
17
  };
17
18
  __decorate([
@@ -26,6 +27,22 @@ __decorate([
26
27
  (0, typeorm_1.Column)("varchar", { nullable: true, length: 255 }),
27
28
  __metadata("design:type", String)
28
29
  ], Supplier.prototype, "contactInfo", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)("text", { nullable: true }),
32
+ __metadata("design:type", String)
33
+ ], Supplier.prototype, "address", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)("varchar", { nullable: true, length: 255 }),
36
+ __metadata("design:type", String)
37
+ ], Supplier.prototype, "phone", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)("varchar", { nullable: true, length: 255 }),
40
+ __metadata("design:type", String)
41
+ ], Supplier.prototype, "email", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.OneToMany)(() => Inventory_1.Inventory, (inventory) => inventory.supplier),
44
+ __metadata("design:type", Array)
45
+ ], Supplier.prototype, "inventory", void 0);
29
46
  __decorate([
30
47
  (0, typeorm_1.OneToMany)(() => InventoryItem_1.InventoryItem, (inventoryItem) => inventoryItem.supplier),
31
48
  __metadata("design:type", Array)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proflores-db-model",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "Data model for managing expenses and transactions for Proflores nursery business",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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
  }
@@ -1,5 +1,6 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, ObjectLiteral, OneToMany } from "typeorm";
2
2
  import { InventoryItem } from "./InventoryItem";
3
+ import { Inventory } from "./Inventory";
3
4
 
4
5
  @Entity("suppliers")
5
6
  export class Supplier implements ObjectLiteral {
@@ -12,6 +13,18 @@ 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[];
17
30
  }