proflores-db-model 0.3.8 → 0.3.10
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/Inventory.d.ts +1 -1
- package/dist/entities/Inventory.js +4 -3
- package/dist/entities/Suppliers.d.ts +0 -1
- package/dist/entities/Suppliers.js +0 -4
- package/dist/entities/UnitOfMesure.d.ts +0 -1
- package/dist/entities/UnitOfMesure.js +0 -4
- package/package.json +1 -1
- package/src/entities/Inventory.ts +4 -2
- package/src/entities/Suppliers.ts +0 -3
- package/src/entities/UnitOfMesure.ts +0 -3
|
@@ -6,7 +6,7 @@ import { InventoryMovement } from "./InventoryMovement";
|
|
|
6
6
|
import { InventoryExpenseDistribution } from "./InventoryExpenseDistribution";
|
|
7
7
|
export declare class Inventory implements ObjectLiteral {
|
|
8
8
|
idInventory: number;
|
|
9
|
-
product
|
|
9
|
+
product: Product;
|
|
10
10
|
quantity: number;
|
|
11
11
|
wholesalePrice: number;
|
|
12
12
|
retailPrice: number;
|
|
@@ -24,9 +24,9 @@ __decorate([
|
|
|
24
24
|
__metadata("design:type", Number)
|
|
25
25
|
], Inventory.prototype, "idInventory", void 0);
|
|
26
26
|
__decorate([
|
|
27
|
-
(0, typeorm_1.ManyToOne)(() => Products_1.Product, { nullable:
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => Products_1.Product, { nullable: false }),
|
|
28
28
|
(0, typeorm_1.JoinColumn)({ name: "idProduct" }),
|
|
29
|
-
__metadata("design:type",
|
|
29
|
+
__metadata("design:type", Products_1.Product)
|
|
30
30
|
], Inventory.prototype, "product", void 0);
|
|
31
31
|
__decorate([
|
|
32
32
|
(0, typeorm_1.Column)("decimal", { nullable: false, default: 0 }),
|
|
@@ -63,5 +63,6 @@ __decorate([
|
|
|
63
63
|
__metadata("design:type", Array)
|
|
64
64
|
], Inventory.prototype, "expenseDistributions", void 0);
|
|
65
65
|
exports.Inventory = Inventory = __decorate([
|
|
66
|
-
(0, typeorm_1.Entity)("inventory")
|
|
66
|
+
(0, typeorm_1.Entity)("inventory"),
|
|
67
|
+
(0, typeorm_1.Index)(["product"], { unique: true })
|
|
67
68
|
], Inventory);
|
|
@@ -25,10 +25,6 @@ __decorate([
|
|
|
25
25
|
(0, typeorm_1.Column)("varchar", { nullable: false, length: 255 }),
|
|
26
26
|
__metadata("design:type", String)
|
|
27
27
|
], Supplier.prototype, "name", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], Supplier.prototype, "name_norm", void 0);
|
|
32
28
|
__decorate([
|
|
33
29
|
(0, typeorm_1.Column)("varchar", { nullable: true, length: 255 }),
|
|
34
30
|
__metadata("design:type", String)
|
|
@@ -23,10 +23,6 @@ __decorate([
|
|
|
23
23
|
(0, typeorm_1.Column)("varchar", { nullable: false, length: 50 }),
|
|
24
24
|
__metadata("design:type", String)
|
|
25
25
|
], UnitOfMeasure.prototype, "name", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], UnitOfMeasure.prototype, "name_norm", void 0);
|
|
30
26
|
__decorate([
|
|
31
27
|
(0, typeorm_1.OneToMany)(() => InventoryItem_1.InventoryItem, (inventoryItem) => inventoryItem.unitOfMeasure),
|
|
32
28
|
__metadata("design:type", Array)
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ManyToOne,
|
|
7
7
|
JoinColumn,
|
|
8
8
|
OneToMany,
|
|
9
|
+
Index,
|
|
9
10
|
} from "typeorm";
|
|
10
11
|
import { Product } from "./Products";
|
|
11
12
|
import { Branch } from "./Branches";
|
|
@@ -14,13 +15,14 @@ import { InventoryMovement } from "./InventoryMovement";
|
|
|
14
15
|
import { InventoryExpenseDistribution } from "./InventoryExpenseDistribution";
|
|
15
16
|
|
|
16
17
|
@Entity("inventory")
|
|
18
|
+
@Index(["product"], { unique: true })
|
|
17
19
|
export class Inventory implements ObjectLiteral {
|
|
18
20
|
@PrimaryGeneratedColumn("increment")
|
|
19
21
|
idInventory!: number;
|
|
20
22
|
|
|
21
|
-
@ManyToOne(() => Product, { nullable:
|
|
23
|
+
@ManyToOne(() => Product, { nullable: false })
|
|
22
24
|
@JoinColumn({ name: "idProduct" })
|
|
23
|
-
product
|
|
25
|
+
product!: Product;
|
|
24
26
|
|
|
25
27
|
@Column("decimal", { nullable: false, default: 0 })
|
|
26
28
|
quantity!: number;
|
|
@@ -10,9 +10,6 @@ export class Supplier implements ObjectLiteral {
|
|
|
10
10
|
@Column("varchar", { nullable: false, length: 255 })
|
|
11
11
|
name!: string;
|
|
12
12
|
|
|
13
|
-
@Column("text", { nullable: true })
|
|
14
|
-
name_norm!: string;
|
|
15
|
-
|
|
16
13
|
@Column("varchar", { nullable: true, length: 255 })
|
|
17
14
|
contactInfo!: string;
|
|
18
15
|
|
|
@@ -15,9 +15,6 @@ export class UnitOfMeasure implements ObjectLiteral {
|
|
|
15
15
|
@Column("varchar", { nullable: false, length: 50 })
|
|
16
16
|
name!: string;
|
|
17
17
|
|
|
18
|
-
@Column("text", { nullable: true })
|
|
19
|
-
name_norm!: string;
|
|
20
|
-
|
|
21
18
|
@OneToMany(
|
|
22
19
|
() => InventoryItem,
|
|
23
20
|
(inventoryItem) => inventoryItem.unitOfMeasure
|