proflores-db-model 0.2.52 → 0.2.53
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/ExpenseDetail.d.ts +6 -0
- package/dist/entities/ExpenseDetail.js +19 -1
- package/dist/entities/ExpenseTransaction.d.ts +2 -0
- package/dist/entities/ExpenseTransaction.js +11 -1
- package/dist/entities/Income.d.ts +29 -0
- package/dist/entities/Income.js +121 -0
- package/dist/entities/InventoryMovement.d.ts +2 -0
- package/dist/entities/InventoryMovement.js +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -1
- package/dist/models/apu/Budget.d.ts +4 -0
- package/dist/models/apu/Budget.js +10 -0
- package/dist/models/production/CropActivity.d.ts +20 -0
- package/dist/models/production/CropActivity.js +85 -0
- package/dist/models/production/CropExpense.d.ts +22 -0
- package/dist/models/production/CropExpense.js +93 -0
- package/dist/models/production/CropLot.d.ts +33 -0
- package/dist/models/production/CropLot.js +132 -0
- package/dist/models/production/CropStage.d.ts +13 -0
- package/dist/models/production/CropStage.js +58 -0
- package/dist/models/production/CropStageImage.d.ts +9 -0
- package/dist/models/production/CropStageImage.js +44 -0
- package/dist/models/production/GrowthArea.d.ts +13 -0
- package/dist/models/production/GrowthArea.js +55 -0
- package/dist/models/production/Harvest.d.ts +16 -0
- package/dist/models/production/Harvest.js +70 -0
- package/dist/models/production/ProductionSeason.d.ts +11 -0
- package/dist/models/production/ProductionSeason.js +49 -0
- package/dist/models/production/index.d.ts +8 -0
- package/dist/models/production/index.js +20 -0
- package/dist/types/CropActivityType.d.ts +12 -0
- package/dist/types/CropActivityType.js +16 -0
- package/dist/types/CropLotStatus.d.ts +10 -0
- package/dist/types/CropLotStatus.js +14 -0
- package/dist/types/GrowthStage.d.ts +10 -0
- package/dist/types/GrowthStage.js +14 -0
- package/dist/types/IncomeStatus.d.ts +5 -0
- package/dist/types/IncomeStatus.js +9 -0
- package/dist/types/IncomeType.d.ts +6 -0
- package/dist/types/IncomeType.js +10 -0
- package/dist/types/MovementType.d.ts +2 -1
- package/dist/types/MovementType.js +1 -0
- package/dist/types/QualityGrade.d.ts +6 -0
- package/dist/types/QualityGrade.js +10 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +15 -1
- package/package.json +1 -1
- package/src/entities/ExpenseDetail.ts +16 -1
- package/src/entities/ExpenseTransaction.ts +12 -2
- package/src/entities/Income.ts +99 -0
- package/src/entities/InventoryMovement.ts +7 -1
- package/src/index.ts +2 -0
- package/src/models/apu/Budget.ts +8 -0
- package/src/models/production/CropActivity.ts +68 -0
- package/src/models/production/CropExpense.ts +74 -0
- package/src/models/production/CropLot.ts +106 -0
- package/src/models/production/CropStage.ts +45 -0
- package/src/models/production/CropStageImage.ts +32 -0
- package/src/models/production/GrowthArea.ts +41 -0
- package/src/models/production/Harvest.ts +56 -0
- package/src/models/production/ProductionSeason.ts +34 -0
- package/src/models/production/index.ts +9 -0
- package/src/types/CropActivityType.ts +12 -0
- package/src/types/CropLotStatus.ts +10 -0
- package/src/types/GrowthStage.ts +10 -0
- package/src/types/IncomeStatus.ts +5 -0
- package/src/types/IncomeType.ts +6 -0
- package/src/types/MovementType.ts +5 -4
- package/src/types/QualityGrade.ts +6 -0
- package/src/types/index.ts +11 -1
|
@@ -0,0 +1,132 @@
|
|
|
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.CropLot = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const GrowthArea_1 = require("./GrowthArea");
|
|
15
|
+
const ProductionSeason_1 = require("./ProductionSeason");
|
|
16
|
+
const PlantTechnicalSheet_1 = require("../technical-sheet/PlantTechnicalSheet");
|
|
17
|
+
const CropLotStatus_1 = require("../../types/CropLotStatus");
|
|
18
|
+
const CropStage_1 = require("./CropStage");
|
|
19
|
+
const CropActivity_1 = require("./CropActivity");
|
|
20
|
+
const CropExpense_1 = require("./CropExpense");
|
|
21
|
+
const Harvest_1 = require("./Harvest");
|
|
22
|
+
let CropLot = class CropLot {
|
|
23
|
+
};
|
|
24
|
+
exports.CropLot = CropLot;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], CropLot.prototype, "idCropLot", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)("varchar", { length: 64, nullable: false, unique: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CropLot.prototype, "code", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: false }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CropLot.prototype, "name", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(() => GrowthArea_1.GrowthArea, (area) => area.cropLots, {
|
|
39
|
+
nullable: false,
|
|
40
|
+
onDelete: "RESTRICT",
|
|
41
|
+
}),
|
|
42
|
+
(0, typeorm_1.JoinColumn)({ name: "idGrowthArea" }),
|
|
43
|
+
__metadata("design:type", GrowthArea_1.GrowthArea)
|
|
44
|
+
], CropLot.prototype, "growthArea", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.ManyToOne)(() => ProductionSeason_1.ProductionSeason, (season) => season.cropLots, {
|
|
47
|
+
nullable: false,
|
|
48
|
+
onDelete: "RESTRICT",
|
|
49
|
+
}),
|
|
50
|
+
(0, typeorm_1.JoinColumn)({ name: "idSeason" }),
|
|
51
|
+
__metadata("design:type", ProductionSeason_1.ProductionSeason)
|
|
52
|
+
], CropLot.prototype, "season", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.ManyToOne)(() => PlantTechnicalSheet_1.PlantTechnicalSheet, { nullable: true, onDelete: "SET NULL" }),
|
|
55
|
+
(0, typeorm_1.JoinColumn)({ name: "idPlantTechnicalSheet" }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], CropLot.prototype, "plantTechnicalSheet", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)("decimal", { precision: 12, scale: 2, nullable: false, default: 0 }),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], CropLot.prototype, "quantity", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)("decimal", { precision: 12, scale: 2, nullable: true }),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], CropLot.prototype, "expectedYield", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)("decimal", { precision: 12, scale: 2, nullable: true }),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], CropLot.prototype, "actualYield", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)("decimal", { precision: 14, scale: 4, nullable: true }),
|
|
72
|
+
__metadata("design:type", Object)
|
|
73
|
+
], CropLot.prototype, "unitCost", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.Column)("decimal", { precision: 14, scale: 2, nullable: true }),
|
|
76
|
+
__metadata("design:type", Object)
|
|
77
|
+
], CropLot.prototype, "totalCost", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({
|
|
80
|
+
type: "enum",
|
|
81
|
+
enum: CropLotStatus_1.CropLotStatus,
|
|
82
|
+
default: CropLotStatus_1.CropLotStatus.PLANNED,
|
|
83
|
+
}),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], CropLot.prototype, "status", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
88
|
+
__metadata("design:type", Date)
|
|
89
|
+
], CropLot.prototype, "sowingDate", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, typeorm_1.Column)("date", { nullable: true }),
|
|
92
|
+
__metadata("design:type", Object)
|
|
93
|
+
], CropLot.prototype, "expectedHarvestDate", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, typeorm_1.Column)("date", { nullable: true }),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], CropLot.prototype, "actualHarvestDate", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
100
|
+
__metadata("design:type", Object)
|
|
101
|
+
], CropLot.prototype, "notes", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.CreateDateColumn)({ type: "timestamp" }),
|
|
104
|
+
__metadata("design:type", Date)
|
|
105
|
+
], CropLot.prototype, "createdAt", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.UpdateDateColumn)({ type: "timestamp" }),
|
|
108
|
+
__metadata("design:type", Date)
|
|
109
|
+
], CropLot.prototype, "updatedAt", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, typeorm_1.OneToMany)(() => CropStage_1.CropStage, (stage) => stage.cropLot, { cascade: true }),
|
|
112
|
+
__metadata("design:type", Array)
|
|
113
|
+
], CropLot.prototype, "stages", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.OneToMany)(() => CropActivity_1.CropActivity, (activity) => activity.cropLot, { cascade: true }),
|
|
116
|
+
__metadata("design:type", Array)
|
|
117
|
+
], CropLot.prototype, "activities", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, typeorm_1.OneToMany)(() => CropExpense_1.CropExpense, (expense) => expense.cropLot, { cascade: true }),
|
|
120
|
+
__metadata("design:type", Array)
|
|
121
|
+
], CropLot.prototype, "expenses", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, typeorm_1.OneToMany)(() => Harvest_1.Harvest, (harvest) => harvest.cropLot, { cascade: true }),
|
|
124
|
+
__metadata("design:type", Array)
|
|
125
|
+
], CropLot.prototype, "harvests", void 0);
|
|
126
|
+
exports.CropLot = CropLot = __decorate([
|
|
127
|
+
(0, typeorm_1.Entity)("crop_lots"),
|
|
128
|
+
(0, typeorm_1.Index)(["code"], { unique: true }),
|
|
129
|
+
(0, typeorm_1.Index)(["growthArea"]),
|
|
130
|
+
(0, typeorm_1.Index)(["season"]),
|
|
131
|
+
(0, typeorm_1.Index)(["status"])
|
|
132
|
+
], CropLot);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { CropLot } from "./CropLot";
|
|
3
|
+
import { GrowthStage } from "../../types/GrowthStage";
|
|
4
|
+
import { CropStageImage } from "./CropStageImage";
|
|
5
|
+
export declare class CropStage implements ObjectLiteral {
|
|
6
|
+
idCropStage: number;
|
|
7
|
+
cropLot: CropLot;
|
|
8
|
+
stage: GrowthStage;
|
|
9
|
+
startDate: Date;
|
|
10
|
+
endDate?: Date | null;
|
|
11
|
+
notes?: string | null;
|
|
12
|
+
images?: CropStageImage[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.CropStage = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const CropLot_1 = require("./CropLot");
|
|
15
|
+
const GrowthStage_1 = require("../../types/GrowthStage");
|
|
16
|
+
const CropStageImage_1 = require("./CropStageImage");
|
|
17
|
+
let CropStage = class CropStage {
|
|
18
|
+
};
|
|
19
|
+
exports.CropStage = CropStage;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], CropStage.prototype, "idCropStage", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.ManyToOne)(() => CropLot_1.CropLot, (cropLot) => cropLot.stages, {
|
|
26
|
+
nullable: false,
|
|
27
|
+
onDelete: "CASCADE",
|
|
28
|
+
}),
|
|
29
|
+
(0, typeorm_1.JoinColumn)({ name: "idCropLot" }),
|
|
30
|
+
__metadata("design:type", CropLot_1.CropLot)
|
|
31
|
+
], CropStage.prototype, "cropLot", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({
|
|
34
|
+
type: "enum",
|
|
35
|
+
enum: GrowthStage_1.GrowthStage,
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], CropStage.prototype, "stage", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
41
|
+
__metadata("design:type", Date)
|
|
42
|
+
], CropStage.prototype, "startDate", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)("date", { nullable: true }),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], CropStage.prototype, "endDate", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], CropStage.prototype, "notes", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.OneToMany)(() => CropStageImage_1.CropStageImage, (image) => image.cropStage, { cascade: true }),
|
|
53
|
+
__metadata("design:type", Array)
|
|
54
|
+
], CropStage.prototype, "images", void 0);
|
|
55
|
+
exports.CropStage = CropStage = __decorate([
|
|
56
|
+
(0, typeorm_1.Entity)("crop_stages"),
|
|
57
|
+
(0, typeorm_1.Index)(["cropLot", "stage"])
|
|
58
|
+
], CropStage);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { CropStage } from "./CropStage";
|
|
3
|
+
export declare class CropStageImage implements ObjectLiteral {
|
|
4
|
+
idCropStageImage: number;
|
|
5
|
+
cropStage: CropStage;
|
|
6
|
+
imageUrl: string;
|
|
7
|
+
caption?: string | null;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
}
|
|
@@ -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.CropStageImage = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const CropStage_1 = require("./CropStage");
|
|
15
|
+
let CropStageImage = class CropStageImage {
|
|
16
|
+
};
|
|
17
|
+
exports.CropStageImage = CropStageImage;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], CropStageImage.prototype, "idCropStageImage", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.ManyToOne)(() => CropStage_1.CropStage, (stage) => stage.images, {
|
|
24
|
+
nullable: false,
|
|
25
|
+
onDelete: "CASCADE",
|
|
26
|
+
}),
|
|
27
|
+
(0, typeorm_1.JoinColumn)({ name: "idCropStage" }),
|
|
28
|
+
__metadata("design:type", CropStage_1.CropStage)
|
|
29
|
+
], CropStageImage.prototype, "cropStage", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)("varchar", { length: 512, nullable: false }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CropStageImage.prototype, "imageUrl", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], CropStageImage.prototype, "caption", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.CreateDateColumn)({ type: "timestamp" }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], CropStageImage.prototype, "createdAt", void 0);
|
|
42
|
+
exports.CropStageImage = CropStageImage = __decorate([
|
|
43
|
+
(0, typeorm_1.Entity)("crop_stage_images")
|
|
44
|
+
], CropStageImage);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { Branch } from "../../entities/Branches";
|
|
3
|
+
import { CropLot } from "./CropLot";
|
|
4
|
+
export declare class GrowthArea implements ObjectLiteral {
|
|
5
|
+
idGrowthArea: number;
|
|
6
|
+
name: string;
|
|
7
|
+
code: string;
|
|
8
|
+
description?: string | null;
|
|
9
|
+
capacity?: number | null;
|
|
10
|
+
branch?: Branch | null;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
cropLots?: CropLot[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.GrowthArea = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Branches_1 = require("../../entities/Branches");
|
|
15
|
+
const CropLot_1 = require("./CropLot");
|
|
16
|
+
let GrowthArea = class GrowthArea {
|
|
17
|
+
};
|
|
18
|
+
exports.GrowthArea = GrowthArea;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], GrowthArea.prototype, "idGrowthArea", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: false }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], GrowthArea.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)("varchar", { length: 64, nullable: false, unique: true }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], GrowthArea.prototype, "code", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], GrowthArea.prototype, "description", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)("decimal", { precision: 10, scale: 2, nullable: true }),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], GrowthArea.prototype, "capacity", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.ManyToOne)(() => Branches_1.Branch, { nullable: true, onDelete: "SET NULL" }),
|
|
41
|
+
(0, typeorm_1.JoinColumn)({ name: "idBranch" }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], GrowthArea.prototype, "branch", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)("boolean", { default: true }),
|
|
46
|
+
__metadata("design:type", Boolean)
|
|
47
|
+
], GrowthArea.prototype, "isActive", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.OneToMany)(() => CropLot_1.CropLot, (cropLot) => cropLot.growthArea),
|
|
50
|
+
__metadata("design:type", Array)
|
|
51
|
+
], GrowthArea.prototype, "cropLots", void 0);
|
|
52
|
+
exports.GrowthArea = GrowthArea = __decorate([
|
|
53
|
+
(0, typeorm_1.Entity)("growth_areas"),
|
|
54
|
+
(0, typeorm_1.Index)(["code"], { unique: true })
|
|
55
|
+
], GrowthArea);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { CropLot } from "./CropLot";
|
|
3
|
+
import { UnitOfMeasure } from "../../entities/UnitOfMesure";
|
|
4
|
+
import { QualityGrade } from "../../types/QualityGrade";
|
|
5
|
+
import { InventoryMovement } from "../../entities/InventoryMovement";
|
|
6
|
+
export declare class Harvest implements ObjectLiteral {
|
|
7
|
+
idHarvest: number;
|
|
8
|
+
cropLot: CropLot;
|
|
9
|
+
harvestDate: Date;
|
|
10
|
+
quantity: number;
|
|
11
|
+
unitOfMeasure?: UnitOfMeasure | null;
|
|
12
|
+
qualityGrade?: QualityGrade | null;
|
|
13
|
+
notes?: string | null;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
inventoryMovement?: InventoryMovement | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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.Harvest = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const CropLot_1 = require("./CropLot");
|
|
15
|
+
const UnitOfMesure_1 = require("../../entities/UnitOfMesure");
|
|
16
|
+
const QualityGrade_1 = require("../../types/QualityGrade");
|
|
17
|
+
const InventoryMovement_1 = require("../../entities/InventoryMovement");
|
|
18
|
+
let Harvest = class Harvest {
|
|
19
|
+
};
|
|
20
|
+
exports.Harvest = Harvest;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], Harvest.prototype, "idHarvest", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => CropLot_1.CropLot, (cropLot) => cropLot.harvests, {
|
|
27
|
+
nullable: false,
|
|
28
|
+
onDelete: "CASCADE",
|
|
29
|
+
}),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "idCropLot" }),
|
|
31
|
+
__metadata("design:type", CropLot_1.CropLot)
|
|
32
|
+
], Harvest.prototype, "cropLot", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
35
|
+
__metadata("design:type", Date)
|
|
36
|
+
], Harvest.prototype, "harvestDate", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)("decimal", { precision: 12, scale: 2, nullable: false }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], Harvest.prototype, "quantity", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.ManyToOne)(() => UnitOfMesure_1.UnitOfMeasure, { nullable: true, onDelete: "SET NULL" }),
|
|
43
|
+
(0, typeorm_1.JoinColumn)({ name: "idUnitOfMeasure" }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], Harvest.prototype, "unitOfMeasure", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({
|
|
48
|
+
type: "enum",
|
|
49
|
+
enum: QualityGrade_1.QualityGrade,
|
|
50
|
+
nullable: true,
|
|
51
|
+
}),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], Harvest.prototype, "qualityGrade", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], Harvest.prototype, "notes", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.CreateDateColumn)({ type: "timestamp" }),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], Harvest.prototype, "createdAt", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.OneToOne)(() => InventoryMovement_1.InventoryMovement, { nullable: true, cascade: true }),
|
|
64
|
+
(0, typeorm_1.JoinColumn)({ name: "idInventoryMovement" }),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], Harvest.prototype, "inventoryMovement", void 0);
|
|
67
|
+
exports.Harvest = Harvest = __decorate([
|
|
68
|
+
(0, typeorm_1.Entity)("harvests"),
|
|
69
|
+
(0, typeorm_1.Index)(["cropLot", "harvestDate"])
|
|
70
|
+
], Harvest);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { CropLot } from "./CropLot";
|
|
3
|
+
export declare class ProductionSeason implements ObjectLiteral {
|
|
4
|
+
idSeason: number;
|
|
5
|
+
name: string;
|
|
6
|
+
code: string;
|
|
7
|
+
startDate: Date;
|
|
8
|
+
endDate?: Date | null;
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
cropLots?: CropLot[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.ProductionSeason = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const CropLot_1 = require("./CropLot");
|
|
15
|
+
let ProductionSeason = class ProductionSeason {
|
|
16
|
+
};
|
|
17
|
+
exports.ProductionSeason = ProductionSeason;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], ProductionSeason.prototype, "idSeason", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: false }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], ProductionSeason.prototype, "name", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)("varchar", { length: 64, nullable: false, unique: true }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], ProductionSeason.prototype, "code", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
32
|
+
__metadata("design:type", Date)
|
|
33
|
+
], ProductionSeason.prototype, "startDate", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)("date", { nullable: true }),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], ProductionSeason.prototype, "endDate", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)("boolean", { default: true }),
|
|
40
|
+
__metadata("design:type", Boolean)
|
|
41
|
+
], ProductionSeason.prototype, "isActive", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.OneToMany)(() => CropLot_1.CropLot, (cropLot) => cropLot.season),
|
|
44
|
+
__metadata("design:type", Array)
|
|
45
|
+
], ProductionSeason.prototype, "cropLots", void 0);
|
|
46
|
+
exports.ProductionSeason = ProductionSeason = __decorate([
|
|
47
|
+
(0, typeorm_1.Entity)("production_seasons"),
|
|
48
|
+
(0, typeorm_1.Index)(["code"], { unique: true })
|
|
49
|
+
], ProductionSeason);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { GrowthArea } from "./GrowthArea";
|
|
2
|
+
export { ProductionSeason } from "./ProductionSeason";
|
|
3
|
+
export { CropLot } from "./CropLot";
|
|
4
|
+
export { CropStage } from "./CropStage";
|
|
5
|
+
export { CropStageImage } from "./CropStageImage";
|
|
6
|
+
export { CropActivity } from "./CropActivity";
|
|
7
|
+
export { CropExpense } from "./CropExpense";
|
|
8
|
+
export { Harvest } from "./Harvest";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Harvest = exports.CropExpense = exports.CropActivity = exports.CropStageImage = exports.CropStage = exports.CropLot = exports.ProductionSeason = exports.GrowthArea = void 0;
|
|
4
|
+
// Production entities
|
|
5
|
+
var GrowthArea_1 = require("./GrowthArea");
|
|
6
|
+
Object.defineProperty(exports, "GrowthArea", { enumerable: true, get: function () { return GrowthArea_1.GrowthArea; } });
|
|
7
|
+
var ProductionSeason_1 = require("./ProductionSeason");
|
|
8
|
+
Object.defineProperty(exports, "ProductionSeason", { enumerable: true, get: function () { return ProductionSeason_1.ProductionSeason; } });
|
|
9
|
+
var CropLot_1 = require("./CropLot");
|
|
10
|
+
Object.defineProperty(exports, "CropLot", { enumerable: true, get: function () { return CropLot_1.CropLot; } });
|
|
11
|
+
var CropStage_1 = require("./CropStage");
|
|
12
|
+
Object.defineProperty(exports, "CropStage", { enumerable: true, get: function () { return CropStage_1.CropStage; } });
|
|
13
|
+
var CropStageImage_1 = require("./CropStageImage");
|
|
14
|
+
Object.defineProperty(exports, "CropStageImage", { enumerable: true, get: function () { return CropStageImage_1.CropStageImage; } });
|
|
15
|
+
var CropActivity_1 = require("./CropActivity");
|
|
16
|
+
Object.defineProperty(exports, "CropActivity", { enumerable: true, get: function () { return CropActivity_1.CropActivity; } });
|
|
17
|
+
var CropExpense_1 = require("./CropExpense");
|
|
18
|
+
Object.defineProperty(exports, "CropExpense", { enumerable: true, get: function () { return CropExpense_1.CropExpense; } });
|
|
19
|
+
var Harvest_1 = require("./Harvest");
|
|
20
|
+
Object.defineProperty(exports, "Harvest", { enumerable: true, get: function () { return Harvest_1.Harvest; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum CropActivityType {
|
|
2
|
+
IRRIGATION = "IRRIGATION",
|
|
3
|
+
FERTILIZATION = "FERTILIZATION",
|
|
4
|
+
PRUNING = "PRUNING",
|
|
5
|
+
PEST_CONTROL = "PEST_CONTROL",
|
|
6
|
+
DISEASE_CONTROL = "DISEASE_CONTROL",
|
|
7
|
+
TRANSPLANT = "TRANSPLANT",
|
|
8
|
+
WEEDING = "WEEDING",
|
|
9
|
+
HARVESTING = "HARVESTING",
|
|
10
|
+
QUALITY_CHECK = "QUALITY_CHECK",
|
|
11
|
+
OTHER = "OTHER"
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CropActivityType = void 0;
|
|
4
|
+
var CropActivityType;
|
|
5
|
+
(function (CropActivityType) {
|
|
6
|
+
CropActivityType["IRRIGATION"] = "IRRIGATION";
|
|
7
|
+
CropActivityType["FERTILIZATION"] = "FERTILIZATION";
|
|
8
|
+
CropActivityType["PRUNING"] = "PRUNING";
|
|
9
|
+
CropActivityType["PEST_CONTROL"] = "PEST_CONTROL";
|
|
10
|
+
CropActivityType["DISEASE_CONTROL"] = "DISEASE_CONTROL";
|
|
11
|
+
CropActivityType["TRANSPLANT"] = "TRANSPLANT";
|
|
12
|
+
CropActivityType["WEEDING"] = "WEEDING";
|
|
13
|
+
CropActivityType["HARVESTING"] = "HARVESTING";
|
|
14
|
+
CropActivityType["QUALITY_CHECK"] = "QUALITY_CHECK";
|
|
15
|
+
CropActivityType["OTHER"] = "OTHER";
|
|
16
|
+
})(CropActivityType || (exports.CropActivityType = CropActivityType = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CropLotStatus = void 0;
|
|
4
|
+
var CropLotStatus;
|
|
5
|
+
(function (CropLotStatus) {
|
|
6
|
+
CropLotStatus["PLANNED"] = "PLANNED";
|
|
7
|
+
CropLotStatus["SOWING"] = "SOWING";
|
|
8
|
+
CropLotStatus["GROWING"] = "GROWING";
|
|
9
|
+
CropLotStatus["FLOWERING"] = "FLOWERING";
|
|
10
|
+
CropLotStatus["READY_TO_HARVEST"] = "READY_TO_HARVEST";
|
|
11
|
+
CropLotStatus["HARVESTING"] = "HARVESTING";
|
|
12
|
+
CropLotStatus["COMPLETED"] = "COMPLETED";
|
|
13
|
+
CropLotStatus["CANCELLED"] = "CANCELLED";
|
|
14
|
+
})(CropLotStatus || (exports.CropLotStatus = CropLotStatus = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GrowthStage = void 0;
|
|
4
|
+
var GrowthStage;
|
|
5
|
+
(function (GrowthStage) {
|
|
6
|
+
GrowthStage["SOWING"] = "SOWING";
|
|
7
|
+
GrowthStage["GERMINATION"] = "GERMINATION";
|
|
8
|
+
GrowthStage["SEEDLING"] = "SEEDLING";
|
|
9
|
+
GrowthStage["VEGETATIVE"] = "VEGETATIVE";
|
|
10
|
+
GrowthStage["FLOWERING"] = "FLOWERING";
|
|
11
|
+
GrowthStage["FRUITING"] = "FRUITING";
|
|
12
|
+
GrowthStage["MATURATION"] = "MATURATION";
|
|
13
|
+
GrowthStage["HARVEST"] = "HARVEST";
|
|
14
|
+
})(GrowthStage || (exports.GrowthStage = GrowthStage = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IncomeStatus = void 0;
|
|
4
|
+
var IncomeStatus;
|
|
5
|
+
(function (IncomeStatus) {
|
|
6
|
+
IncomeStatus["PENDING"] = "PENDING";
|
|
7
|
+
IncomeStatus["CONFIRMED"] = "CONFIRMED";
|
|
8
|
+
IncomeStatus["CANCELLED"] = "CANCELLED";
|
|
9
|
+
})(IncomeStatus || (exports.IncomeStatus = IncomeStatus = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IncomeType = void 0;
|
|
4
|
+
var IncomeType;
|
|
5
|
+
(function (IncomeType) {
|
|
6
|
+
IncomeType["BUDGET_PAYMENT"] = "BUDGET_PAYMENT";
|
|
7
|
+
IncomeType["SPOT_SALE"] = "SPOT_SALE";
|
|
8
|
+
IncomeType["HARVEST_SALE"] = "HARVEST_SALE";
|
|
9
|
+
IncomeType["OTHER"] = "OTHER";
|
|
10
|
+
})(IncomeType || (exports.IncomeType = IncomeType = {}));
|