proflores-db-model 0.2.29 → 0.2.31
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 +2 -2
- package/dist/entities/Inventory.js +7 -5
- package/dist/models/inventory-technical-sheet.entity.d.ts +8 -0
- package/dist/models/inventory-technical-sheet.entity.js +44 -0
- package/dist/models/technical-sheet/PlantTechnicalSheet.d.ts +2 -0
- package/dist/models/technical-sheet/PlantTechnicalSheet.js +5 -0
- package/dist/models/technical-sheet/index.d.ts +1 -0
- package/dist/models/technical-sheet/index.js +1 -0
- package/dist/models/technical-sheet/inventory-technical-sheet.entity.d.ts +8 -0
- package/dist/models/technical-sheet/inventory-technical-sheet.entity.js +44 -0
- package/package.json +1 -1
- package/src/entities/Inventory.ts +6 -4
- package/src/models/technical-sheet/PlantTechnicalSheet.ts +7 -0
- package/src/models/technical-sheet/index.ts +1 -1
- package/src/models/technical-sheet/inventory-technical-sheet.entity.ts +35 -0
|
@@ -7,12 +7,13 @@ import { Supplier } from "./Suppliers";
|
|
|
7
7
|
import { InventoryImage } from "./InventoryImage";
|
|
8
8
|
import { InventoryMovement } from "./InventoryMovement";
|
|
9
9
|
import { PlantTechnicalSheet } from "../models/technical-sheet/PlantTechnicalSheet";
|
|
10
|
-
import {
|
|
10
|
+
import { InventoryTechnicalSheet } from "../models/technical-sheet/inventory-technical-sheet.entity";
|
|
11
11
|
export declare class Inventory implements ObjectLiteral {
|
|
12
12
|
idInventory: number;
|
|
13
13
|
product?: Product | null;
|
|
14
14
|
container: ContainerType | null;
|
|
15
15
|
plantTechnicalSheet?: PlantTechnicalSheet;
|
|
16
|
+
technicalSheets?: InventoryTechnicalSheet[];
|
|
16
17
|
quantity: number;
|
|
17
18
|
wholesalePrice: number;
|
|
18
19
|
retailPrice: number;
|
|
@@ -20,7 +21,6 @@ export declare class Inventory implements ObjectLiteral {
|
|
|
20
21
|
unitOfMeasure?: UnitOfMeasure | null;
|
|
21
22
|
branch?: Branch | null;
|
|
22
23
|
supplier?: Supplier | null;
|
|
23
|
-
inventoryItems?: InventoryItem[];
|
|
24
24
|
images: InventoryImage[] | null;
|
|
25
25
|
movements: InventoryMovement[];
|
|
26
26
|
}
|
|
@@ -19,7 +19,7 @@ const Suppliers_1 = require("./Suppliers");
|
|
|
19
19
|
const InventoryImage_1 = require("./InventoryImage");
|
|
20
20
|
const InventoryMovement_1 = require("./InventoryMovement");
|
|
21
21
|
const PlantTechnicalSheet_1 = require("../models/technical-sheet/PlantTechnicalSheet");
|
|
22
|
-
const
|
|
22
|
+
const inventory_technical_sheet_entity_1 = require("../models/technical-sheet/inventory-technical-sheet.entity");
|
|
23
23
|
let Inventory = class Inventory {
|
|
24
24
|
};
|
|
25
25
|
exports.Inventory = Inventory;
|
|
@@ -42,6 +42,12 @@ __decorate([
|
|
|
42
42
|
(0, typeorm_1.JoinColumn)({ name: "idPlantTechnicalSheet" }),
|
|
43
43
|
__metadata("design:type", PlantTechnicalSheet_1.PlantTechnicalSheet)
|
|
44
44
|
], Inventory.prototype, "plantTechnicalSheet", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.OneToMany)(() => inventory_technical_sheet_entity_1.InventoryTechnicalSheet, (its) => its.inventory, {
|
|
47
|
+
cascade: true,
|
|
48
|
+
}),
|
|
49
|
+
__metadata("design:type", Array)
|
|
50
|
+
], Inventory.prototype, "technicalSheets", void 0);
|
|
45
51
|
__decorate([
|
|
46
52
|
(0, typeorm_1.Column)("decimal", { nullable: false, default: 0 }),
|
|
47
53
|
__metadata("design:type", Number)
|
|
@@ -73,10 +79,6 @@ __decorate([
|
|
|
73
79
|
(0, typeorm_1.JoinColumn)({ name: "idSupplier" }),
|
|
74
80
|
__metadata("design:type", Object)
|
|
75
81
|
], Inventory.prototype, "supplier", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
(0, typeorm_1.OneToMany)(() => InventoryItem_1.InventoryItem, (inventoryItem) => inventoryItem.idInventoryItem),
|
|
78
|
-
__metadata("design:type", Array)
|
|
79
|
-
], Inventory.prototype, "inventoryItems", void 0);
|
|
80
82
|
__decorate([
|
|
81
83
|
(0, typeorm_1.OneToMany)(() => InventoryImage_1.InventoryImage, (inventoryImage) => inventoryImage.inventory, {
|
|
82
84
|
cascade: true,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Inventory } from "../entities/Inventory";
|
|
2
|
+
import { PlantTechnicalSheet } from "../models/technical-sheet/PlantTechnicalSheet";
|
|
3
|
+
export declare class InventoryTechnicalSheet {
|
|
4
|
+
id: number;
|
|
5
|
+
inventory: Inventory;
|
|
6
|
+
technicalSheet: PlantTechnicalSheet;
|
|
7
|
+
ratio?: number;
|
|
8
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.InventoryTechnicalSheet = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Inventory_1 = require("../entities/Inventory");
|
|
15
|
+
const PlantTechnicalSheet_1 = require("../models/technical-sheet/PlantTechnicalSheet");
|
|
16
|
+
let InventoryTechnicalSheet = class InventoryTechnicalSheet {
|
|
17
|
+
};
|
|
18
|
+
exports.InventoryTechnicalSheet = InventoryTechnicalSheet;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], InventoryTechnicalSheet.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.ManyToOne)(() => Inventory_1.Inventory, (inv) => inv.plantTechnicalSheet, {
|
|
25
|
+
onDelete: "CASCADE",
|
|
26
|
+
}),
|
|
27
|
+
(0, typeorm_1.JoinColumn)({ name: "inventoryId" }),
|
|
28
|
+
__metadata("design:type", Inventory_1.Inventory)
|
|
29
|
+
], InventoryTechnicalSheet.prototype, "inventory", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.ManyToOne)(() => PlantTechnicalSheet_1.PlantTechnicalSheet, (sheet) => sheet.idPlantTechnicalSheet, {
|
|
32
|
+
eager: true,
|
|
33
|
+
onDelete: "CASCADE",
|
|
34
|
+
}),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: "technicalSheetId" }),
|
|
36
|
+
__metadata("design:type", PlantTechnicalSheet_1.PlantTechnicalSheet)
|
|
37
|
+
], InventoryTechnicalSheet.prototype, "technicalSheet", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)("decimal", { default: 1, nullable: true }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], InventoryTechnicalSheet.prototype, "ratio", void 0);
|
|
42
|
+
exports.InventoryTechnicalSheet = InventoryTechnicalSheet = __decorate([
|
|
43
|
+
(0, typeorm_1.Entity)("inventory_technical_sheets")
|
|
44
|
+
], InventoryTechnicalSheet);
|
|
@@ -11,6 +11,7 @@ import { PropagationMethodInfo } from "./PropagationMethodInfo";
|
|
|
11
11
|
import { PlantSize } from "./PlantSize";
|
|
12
12
|
import { GrowthClassInfo } from "./GrowthClassInfo";
|
|
13
13
|
import { ImageInfo } from "./ImageInfo";
|
|
14
|
+
import { InventoryTechnicalSheet } from "./inventory-technical-sheet.entity";
|
|
14
15
|
export declare class PlantTechnicalSheet implements ObjectLiteral {
|
|
15
16
|
idPlantTechnicalSheet: number;
|
|
16
17
|
commonName: string;
|
|
@@ -28,6 +29,7 @@ export declare class PlantTechnicalSheet implements ObjectLiteral {
|
|
|
28
29
|
size: PlantSize;
|
|
29
30
|
growthClass: GrowthClassInfo;
|
|
30
31
|
images?: ImageInfo[];
|
|
32
|
+
inventoryLinks?: InventoryTechnicalSheet[];
|
|
31
33
|
notes?: string;
|
|
32
34
|
isActive: boolean;
|
|
33
35
|
}
|
|
@@ -23,6 +23,7 @@ const PropagationMethodInfo_1 = require("./PropagationMethodInfo");
|
|
|
23
23
|
const PlantSize_1 = require("./PlantSize");
|
|
24
24
|
const GrowthClassInfo_1 = require("./GrowthClassInfo");
|
|
25
25
|
const ImageInfo_1 = require("./ImageInfo");
|
|
26
|
+
const inventory_technical_sheet_entity_1 = require("./inventory-technical-sheet.entity");
|
|
26
27
|
let PlantTechnicalSheet = class PlantTechnicalSheet {
|
|
27
28
|
};
|
|
28
29
|
exports.PlantTechnicalSheet = PlantTechnicalSheet;
|
|
@@ -104,6 +105,10 @@ __decorate([
|
|
|
104
105
|
}),
|
|
105
106
|
__metadata("design:type", Array)
|
|
106
107
|
], PlantTechnicalSheet.prototype, "images", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.OneToMany)(() => inventory_technical_sheet_entity_1.InventoryTechnicalSheet, (its) => its.technicalSheet),
|
|
110
|
+
__metadata("design:type", Array)
|
|
111
|
+
], PlantTechnicalSheet.prototype, "inventoryLinks", void 0);
|
|
107
112
|
__decorate([
|
|
108
113
|
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
109
114
|
__metadata("design:type", String)
|
|
@@ -27,4 +27,5 @@ __exportStar(require("./SubstrateInfo"), exports);
|
|
|
27
27
|
__exportStar(require("./ClimateIdeal"), exports);
|
|
28
28
|
__exportStar(require("./FertilizationInfo"), exports);
|
|
29
29
|
__exportStar(require("./PropagationMethodInfo"), exports);
|
|
30
|
+
__exportStar(require("./inventory-technical-sheet.entity"), exports);
|
|
30
31
|
__exportStar(require("./catalogs"), exports);
|
|
@@ -0,0 +1,44 @@
|
|
|
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.InventoryTechnicalSheet = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Inventory_1 = require("../../entities/Inventory");
|
|
15
|
+
const PlantTechnicalSheet_1 = require("./PlantTechnicalSheet");
|
|
16
|
+
let InventoryTechnicalSheet = class InventoryTechnicalSheet {
|
|
17
|
+
};
|
|
18
|
+
exports.InventoryTechnicalSheet = InventoryTechnicalSheet;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], InventoryTechnicalSheet.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.ManyToOne)(() => Inventory_1.Inventory, (inv) => inv.plantTechnicalSheet, {
|
|
25
|
+
onDelete: "CASCADE",
|
|
26
|
+
}),
|
|
27
|
+
(0, typeorm_1.JoinColumn)({ name: "inventoryId" }),
|
|
28
|
+
__metadata("design:type", Inventory_1.Inventory)
|
|
29
|
+
], InventoryTechnicalSheet.prototype, "inventory", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.ManyToOne)(() => PlantTechnicalSheet_1.PlantTechnicalSheet, (sheet) => sheet.idPlantTechnicalSheet, {
|
|
32
|
+
eager: true,
|
|
33
|
+
onDelete: "CASCADE",
|
|
34
|
+
}),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: "technicalSheetId" }),
|
|
36
|
+
__metadata("design:type", PlantTechnicalSheet_1.PlantTechnicalSheet)
|
|
37
|
+
], InventoryTechnicalSheet.prototype, "technicalSheet", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)("decimal", { default: 1, nullable: true }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], InventoryTechnicalSheet.prototype, "ratio", void 0);
|
|
42
|
+
exports.InventoryTechnicalSheet = InventoryTechnicalSheet = __decorate([
|
|
43
|
+
(0, typeorm_1.Entity)("inventory_technical_sheets")
|
|
44
|
+
], InventoryTechnicalSheet);
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ import { Supplier } from "./Suppliers";
|
|
|
15
15
|
import { InventoryImage } from "./InventoryImage";
|
|
16
16
|
import { InventoryMovement } from "./InventoryMovement";
|
|
17
17
|
import { PlantTechnicalSheet } from "../models/technical-sheet/PlantTechnicalSheet";
|
|
18
|
-
import {
|
|
18
|
+
import { InventoryTechnicalSheet } from "../models/technical-sheet/inventory-technical-sheet.entity";
|
|
19
19
|
|
|
20
20
|
@Entity("inventory")
|
|
21
21
|
export class Inventory implements ObjectLiteral {
|
|
@@ -34,6 +34,11 @@ export class Inventory implements ObjectLiteral {
|
|
|
34
34
|
@JoinColumn({ name: "idPlantTechnicalSheet" })
|
|
35
35
|
plantTechnicalSheet?: PlantTechnicalSheet;
|
|
36
36
|
|
|
37
|
+
@OneToMany(() => InventoryTechnicalSheet, (its) => its.inventory, {
|
|
38
|
+
cascade: true,
|
|
39
|
+
})
|
|
40
|
+
technicalSheets?: InventoryTechnicalSheet[];
|
|
41
|
+
|
|
37
42
|
@Column("decimal", { nullable: false, default: 0 })
|
|
38
43
|
quantity!: number;
|
|
39
44
|
|
|
@@ -58,9 +63,6 @@ export class Inventory implements ObjectLiteral {
|
|
|
58
63
|
@JoinColumn({ name: "idSupplier" })
|
|
59
64
|
supplier?: Supplier | null;
|
|
60
65
|
|
|
61
|
-
@OneToMany(() => InventoryItem, (inventoryItem) => inventoryItem.idInventoryItem)
|
|
62
|
-
inventoryItems?: InventoryItem[];
|
|
63
|
-
|
|
64
66
|
@OneToMany(
|
|
65
67
|
() => InventoryImage,
|
|
66
68
|
(inventoryImage) => inventoryImage.inventory,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { PlantSize } from "./PlantSize";
|
|
20
20
|
import { GrowthClassInfo } from "./GrowthClassInfo";
|
|
21
21
|
import { ImageInfo } from "./ImageInfo";
|
|
22
|
+
import { InventoryTechnicalSheet } from "./inventory-technical-sheet.entity";
|
|
22
23
|
|
|
23
24
|
@Entity("plant_technical_sheets")
|
|
24
25
|
export class PlantTechnicalSheet implements ObjectLiteral {
|
|
@@ -83,6 +84,12 @@ import {
|
|
|
83
84
|
cascade: true,
|
|
84
85
|
})
|
|
85
86
|
images?: ImageInfo[];
|
|
87
|
+
|
|
88
|
+
@OneToMany(
|
|
89
|
+
() => InventoryTechnicalSheet,
|
|
90
|
+
(its) => its.technicalSheet,
|
|
91
|
+
)
|
|
92
|
+
inventoryLinks?: InventoryTechnicalSheet[];
|
|
86
93
|
|
|
87
94
|
@Column("text", { nullable: true })
|
|
88
95
|
notes?: string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
JoinColumn,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { Inventory } from "../../entities/Inventory";
|
|
9
|
+
import { PlantTechnicalSheet } from "./PlantTechnicalSheet";
|
|
10
|
+
|
|
11
|
+
@Entity("inventory_technical_sheets")
|
|
12
|
+
export class InventoryTechnicalSheet {
|
|
13
|
+
@PrimaryGeneratedColumn("increment")
|
|
14
|
+
id!: number;
|
|
15
|
+
|
|
16
|
+
@ManyToOne(() => Inventory, (inv) => inv.plantTechnicalSheet, {
|
|
17
|
+
onDelete: "CASCADE",
|
|
18
|
+
})
|
|
19
|
+
@JoinColumn({ name: "inventoryId" })
|
|
20
|
+
inventory!: Inventory;
|
|
21
|
+
|
|
22
|
+
@ManyToOne(
|
|
23
|
+
() => PlantTechnicalSheet,
|
|
24
|
+
(sheet) => sheet.idPlantTechnicalSheet,
|
|
25
|
+
{
|
|
26
|
+
eager: true,
|
|
27
|
+
onDelete: "CASCADE",
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
@JoinColumn({ name: "technicalSheetId" })
|
|
31
|
+
technicalSheet!: PlantTechnicalSheet;
|
|
32
|
+
|
|
33
|
+
@Column("decimal", { default: 1, nullable: true })
|
|
34
|
+
ratio?: number;
|
|
35
|
+
}
|