proflores-db-model 0.1.33 → 0.2.0
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/Bank/BankAccount.js +2 -2
- package/dist/entities/Bank/TransactionBank.js +2 -2
- package/dist/entities/BranchImage.js +2 -2
- package/dist/entities/Branches.js +2 -2
- package/dist/entities/CategoryForCosting.js +2 -2
- package/dist/entities/CategoryForPlantType.js +2 -2
- package/dist/entities/ContainerType.js +2 -2
- package/dist/entities/ExpenseDetail.js +2 -2
- package/dist/entities/ExpenseTransaction.js +2 -2
- package/dist/entities/ExpenseType.js +2 -2
- package/dist/entities/Inventory.d.ts +2 -0
- package/dist/entities/Inventory.js +7 -2
- package/dist/entities/InventoryImage.js +2 -2
- package/dist/entities/InventoryItem.js +2 -2
- package/dist/entities/InventoryMovement.d.ts +15 -0
- package/dist/entities/InventoryMovement.js +67 -0
- package/dist/entities/ProductImage.js +2 -2
- package/dist/entities/Products.js +2 -2
- package/dist/entities/ProjectOrder.js +2 -2
- package/dist/entities/SupplierImage.js +2 -2
- package/dist/entities/Suppliers.js +2 -2
- package/dist/entities/UnitOfMesure.js +2 -2
- package/dist/entities/User.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -1
- package/dist/models/technical-sheet/CareInstructions.d.ts +16 -0
- package/dist/models/technical-sheet/CareInstructions.js +68 -0
- package/dist/models/technical-sheet/ClimateIdeal.d.ts +11 -0
- package/dist/models/technical-sheet/ClimateIdeal.js +48 -0
- package/dist/models/technical-sheet/FertilizationInfo.d.ts +20 -0
- package/dist/models/technical-sheet/FertilizationInfo.js +64 -0
- package/dist/models/technical-sheet/GrowthClassInfo.d.ts +15 -0
- package/dist/models/technical-sheet/GrowthClassInfo.js +49 -0
- package/dist/models/technical-sheet/HumidityInfo.d.ts +10 -0
- package/dist/models/technical-sheet/HumidityInfo.js +44 -0
- package/dist/models/technical-sheet/ImageInfo.d.ts +29 -0
- package/dist/models/technical-sheet/ImageInfo.js +134 -0
- package/dist/models/technical-sheet/LightInfo.d.ts +10 -0
- package/dist/models/technical-sheet/LightInfo.js +44 -0
- package/dist/models/technical-sheet/PestInfo.d.ts +18 -0
- package/dist/models/technical-sheet/PestInfo.js +76 -0
- package/dist/models/technical-sheet/PlantGrowthType.d.ts +15 -0
- package/dist/models/technical-sheet/PlantGrowthType.js +53 -0
- package/dist/models/technical-sheet/PlantSize.d.ts +14 -0
- package/dist/models/technical-sheet/PlantSize.js +62 -0
- package/dist/models/technical-sheet/PlantTechnicalSheet.d.ts +33 -0
- package/dist/models/technical-sheet/PlantTechnicalSheet.js +117 -0
- package/dist/models/technical-sheet/PropagationMethodInfo.d.ts +12 -0
- package/dist/models/technical-sheet/PropagationMethodInfo.js +52 -0
- package/dist/models/technical-sheet/SubstrateInfo.d.ts +13 -0
- package/dist/models/technical-sheet/SubstrateInfo.js +58 -0
- package/dist/models/technical-sheet/catalogs/climate-ideal.d.ts +11 -0
- package/dist/models/technical-sheet/catalogs/climate-ideal.js +14 -0
- package/dist/models/technical-sheet/catalogs/fertilization-info.d.ts +34 -0
- package/dist/models/technical-sheet/catalogs/fertilization-info.js +35 -0
- package/dist/models/technical-sheet/catalogs/growth-class.d.ts +10 -0
- package/dist/models/technical-sheet/catalogs/growth-class.js +14 -0
- package/dist/models/technical-sheet/catalogs/growth-type.d.ts +32 -0
- package/dist/models/technical-sheet/catalogs/growth-type.js +35 -0
- package/dist/models/technical-sheet/catalogs/humidity-info.d.ts +9 -0
- package/dist/models/technical-sheet/catalogs/humidity-info.js +12 -0
- package/dist/models/technical-sheet/catalogs/light-info.d.ts +9 -0
- package/dist/models/technical-sheet/catalogs/light-info.js +13 -0
- package/dist/models/technical-sheet/catalogs/pest-info.d.ts +32 -0
- package/dist/models/technical-sheet/catalogs/pest-info.js +33 -0
- package/dist/models/technical-sheet/catalogs/plant-size.d.ts +11 -0
- package/dist/models/technical-sheet/catalogs/plant-size.js +15 -0
- package/dist/models/technical-sheet/catalogs/propagation-method.d.ts +14 -0
- package/dist/models/technical-sheet/catalogs/propagation-method.js +18 -0
- package/dist/models/technical-sheet/catalogs/substrate-info.d.ts +17 -0
- package/dist/models/technical-sheet/catalogs/substrate-info.js +21 -0
- package/dist/models/technical-sheet/index.d.ts +13 -0
- package/dist/models/technical-sheet/index.js +29 -0
- package/dist/models/technical-sheet/utils/enumColumn.d.ts +6 -0
- package/dist/models/technical-sheet/utils/enumColumn.js +12 -0
- package/dist/models/technical-sheet/utils/makeCatalog.d.ts +8 -0
- package/dist/models/technical-sheet/utils/makeCatalog.js +19 -0
- package/dist/types/MovementType.d.ts +7 -0
- package/dist/types/MovementType.js +11 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +3 -0
- package/package.json +5 -5
- package/src/entities/Inventory.ts +5 -0
- package/src/entities/InventoryMovement.ts +52 -0
- package/src/index.ts +2 -0
- package/src/models/technical-sheet/CareInstructions.ts +52 -0
- package/src/models/technical-sheet/ClimateIdeal.ts +34 -0
- package/src/models/technical-sheet/FertilizationInfo.ts +59 -0
- package/src/models/technical-sheet/GrowthClassInfo.ts +38 -0
- package/src/models/technical-sheet/HumidityInfo.ts +31 -0
- package/src/models/technical-sheet/ImageInfo.ts +111 -0
- package/src/models/technical-sheet/LightInfo.ts +31 -0
- package/src/models/technical-sheet/PestInfo.ts +65 -0
- package/src/models/technical-sheet/PlantGrowthType.ts +41 -0
- package/src/models/technical-sheet/PlantSize.ts +48 -0
- package/src/models/technical-sheet/PlantTechnicalSheet.ts +93 -0
- package/src/models/technical-sheet/PropagationMethodInfo.ts +37 -0
- package/src/models/technical-sheet/SubstrateInfo.ts +45 -0
- package/src/models/technical-sheet/catalogs/climate-ideal.ts +16 -0
- package/src/models/technical-sheet/catalogs/fertilization-info.ts +41 -0
- package/src/models/technical-sheet/catalogs/growth-class.ts +14 -0
- package/src/models/technical-sheet/catalogs/growth-type.ts +37 -0
- package/src/models/technical-sheet/catalogs/humidity-info.ts +12 -0
- package/src/models/technical-sheet/catalogs/light-info.ts +13 -0
- package/src/models/technical-sheet/catalogs/pest-info.ts +36 -0
- package/src/models/technical-sheet/catalogs/plant-size.ts +15 -0
- package/src/models/technical-sheet/catalogs/propagation-method.ts +18 -0
- package/src/models/technical-sheet/catalogs/substrate-info.ts +21 -0
- package/src/models/technical-sheet/index.ts +14 -0
- package/src/models/technical-sheet/utils/enumColumn.ts +17 -0
- package/src/models/technical-sheet/utils/makeCatalog.ts +17 -0
- package/src/types/MovementType.ts +7 -0
- package/src/types/index.ts +1 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
ObjectLiteral,
|
|
6
|
+
ManyToOne,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { PlantTechnicalSheet } from "./PlantTechnicalSheet";
|
|
10
|
+
import { PlantGrowthType } from "./PlantGrowthType";
|
|
11
|
+
import { LightInfo } from "./LightInfo";
|
|
12
|
+
import { HumidityInfo } from "./HumidityInfo";
|
|
13
|
+
import { ClimateIdeal } from "./ClimateIdeal";
|
|
14
|
+
import { SubstrateInfo } from "./SubstrateInfo";
|
|
15
|
+
import { FertilizationInfo } from "./FertilizationInfo";
|
|
16
|
+
import { PestInfo } from "./PestInfo";
|
|
17
|
+
import { PropagationMethodInfo } from "./PropagationMethodInfo";
|
|
18
|
+
import { PlantSize } from "./PlantSize";
|
|
19
|
+
import { GrowthClassInfo } from "./GrowthClassInfo";
|
|
20
|
+
|
|
21
|
+
@Entity("technical_sheet_images")
|
|
22
|
+
export class ImageInfo implements ObjectLiteral {
|
|
23
|
+
@PrimaryGeneratedColumn("increment")
|
|
24
|
+
idImage!: number;
|
|
25
|
+
|
|
26
|
+
@Column("varchar", { length: 500 })
|
|
27
|
+
url!: string;
|
|
28
|
+
|
|
29
|
+
@Column("text", { nullable: true })
|
|
30
|
+
description?: string;
|
|
31
|
+
|
|
32
|
+
@Column({ type: "boolean", default: true })
|
|
33
|
+
isActive!: boolean;
|
|
34
|
+
|
|
35
|
+
@ManyToOne(() => PlantTechnicalSheet, (sheet) => sheet.images, {
|
|
36
|
+
nullable: true,
|
|
37
|
+
onDelete: "CASCADE",
|
|
38
|
+
})
|
|
39
|
+
@JoinColumn({ name: "plantTechnicalSheetId" })
|
|
40
|
+
plantTechnicalSheet?: PlantTechnicalSheet;
|
|
41
|
+
|
|
42
|
+
@ManyToOne(() => PlantGrowthType, (growthType) => growthType.images, {
|
|
43
|
+
nullable: true,
|
|
44
|
+
onDelete: "CASCADE",
|
|
45
|
+
})
|
|
46
|
+
@JoinColumn({ name: "plantGrowthTypeId" })
|
|
47
|
+
plantGrowthType?: PlantGrowthType;
|
|
48
|
+
|
|
49
|
+
@ManyToOne(() => LightInfo, (lightInfo) => lightInfo.images, {
|
|
50
|
+
nullable: true,
|
|
51
|
+
onDelete: "CASCADE",
|
|
52
|
+
})
|
|
53
|
+
@JoinColumn({ name: "lightInfoId" })
|
|
54
|
+
lightInfo?: LightInfo;
|
|
55
|
+
|
|
56
|
+
@ManyToOne(() => HumidityInfo, (humidityInfo) => humidityInfo.images, {
|
|
57
|
+
nullable: true,
|
|
58
|
+
onDelete: "CASCADE",
|
|
59
|
+
})
|
|
60
|
+
@JoinColumn({ name: "humidityInfoId" })
|
|
61
|
+
humidityInfo?: HumidityInfo;
|
|
62
|
+
|
|
63
|
+
@ManyToOne(() => ClimateIdeal, (climate) => climate.images, {
|
|
64
|
+
nullable: true,
|
|
65
|
+
onDelete: "CASCADE",
|
|
66
|
+
})
|
|
67
|
+
@JoinColumn({ name: "climateIdealId" })
|
|
68
|
+
climateIdeal?: ClimateIdeal;
|
|
69
|
+
|
|
70
|
+
@ManyToOne(() => SubstrateInfo, (substrate) => substrate.images, {
|
|
71
|
+
nullable: true,
|
|
72
|
+
onDelete: "CASCADE",
|
|
73
|
+
})
|
|
74
|
+
@JoinColumn({ name: "substrateInfoId" })
|
|
75
|
+
substrateInfo?: SubstrateInfo;
|
|
76
|
+
|
|
77
|
+
@ManyToOne(() => FertilizationInfo, (f) => f.images, {
|
|
78
|
+
nullable: true,
|
|
79
|
+
onDelete: "CASCADE",
|
|
80
|
+
})
|
|
81
|
+
@JoinColumn({ name: "fertilizationInfoId" })
|
|
82
|
+
fertilizationInfo?: FertilizationInfo;
|
|
83
|
+
|
|
84
|
+
@ManyToOne(() => PestInfo, (pest) => pest.images, {
|
|
85
|
+
nullable: true,
|
|
86
|
+
onDelete: "CASCADE",
|
|
87
|
+
})
|
|
88
|
+
@JoinColumn({ name: "pestId" })
|
|
89
|
+
pest?: PestInfo;
|
|
90
|
+
|
|
91
|
+
@ManyToOne(() => PropagationMethodInfo, (info) => info.images, {
|
|
92
|
+
nullable: true,
|
|
93
|
+
onDelete: "CASCADE",
|
|
94
|
+
})
|
|
95
|
+
@JoinColumn({ name: "propagationMethodId" })
|
|
96
|
+
propagationMethod?: PropagationMethodInfo;
|
|
97
|
+
|
|
98
|
+
@ManyToOne(() => PlantSize, (size) => size.images, {
|
|
99
|
+
nullable: true,
|
|
100
|
+
onDelete: "CASCADE",
|
|
101
|
+
})
|
|
102
|
+
@JoinColumn({ name: "plantSizeId" })
|
|
103
|
+
plantSize?: PlantSize;
|
|
104
|
+
|
|
105
|
+
@ManyToOne(() => GrowthClassInfo, (growthClass) => growthClass.images, {
|
|
106
|
+
nullable: true,
|
|
107
|
+
onDelete: "CASCADE",
|
|
108
|
+
})
|
|
109
|
+
@JoinColumn({ name: "growthClassInfoId" })
|
|
110
|
+
growthClassInfo?: GrowthClassInfo;
|
|
111
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
Column,
|
|
4
|
+
PrimaryGeneratedColumn,
|
|
5
|
+
OneToMany,
|
|
6
|
+
ObjectLiteral,
|
|
7
|
+
} from 'typeorm';
|
|
8
|
+
import { LIGHT, LightRequirement } from './catalogs/light-info';
|
|
9
|
+
import { ImageInfo } from './ImageInfo';
|
|
10
|
+
import { EnumColumn } from './utils/enumColumn';
|
|
11
|
+
|
|
12
|
+
@Entity('light_info')
|
|
13
|
+
export class LightInfo implements ObjectLiteral {
|
|
14
|
+
@PrimaryGeneratedColumn('increment')
|
|
15
|
+
idLightInfo!: number;
|
|
16
|
+
|
|
17
|
+
@EnumColumn(Object.keys(LIGHT) as LightRequirement[])
|
|
18
|
+
type!: LightRequirement;
|
|
19
|
+
|
|
20
|
+
@Column('text', { nullable: true })
|
|
21
|
+
description?: string;
|
|
22
|
+
|
|
23
|
+
@OneToMany(() => ImageInfo, (image) => image.lightInfo, {
|
|
24
|
+
cascade: true,
|
|
25
|
+
})
|
|
26
|
+
images?: ImageInfo[];
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'boolean', default: true })
|
|
29
|
+
isActive!: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
ObjectLiteral,
|
|
6
|
+
ManyToOne,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
OneToMany,
|
|
9
|
+
} from 'typeorm';
|
|
10
|
+
import { PlantTechnicalSheet } from './PlantTechnicalSheet';
|
|
11
|
+
import { ImageInfo } from './ImageInfo';
|
|
12
|
+
import {
|
|
13
|
+
PEST_TYPE,
|
|
14
|
+
PestType,
|
|
15
|
+
PLANT_PART,
|
|
16
|
+
PlantPart,
|
|
17
|
+
CONTROL_METHOD,
|
|
18
|
+
ControlMethod,
|
|
19
|
+
} from './catalogs/pest-info';
|
|
20
|
+
import { EnumColumn } from './utils/enumColumn';
|
|
21
|
+
|
|
22
|
+
@Entity('pests')
|
|
23
|
+
export class PestInfo implements ObjectLiteral {
|
|
24
|
+
@PrimaryGeneratedColumn('increment')
|
|
25
|
+
idPestInfo!: number;
|
|
26
|
+
|
|
27
|
+
@Column('varchar', { length: 255 })
|
|
28
|
+
commonName!: string;
|
|
29
|
+
|
|
30
|
+
@Column('varchar', { nullable: true, length: 255 })
|
|
31
|
+
scientificName?: string;
|
|
32
|
+
|
|
33
|
+
@EnumColumn(Object.keys(PEST_TYPE) as PestType[])
|
|
34
|
+
type!: PestType;
|
|
35
|
+
|
|
36
|
+
@EnumColumn(Object.keys(PLANT_PART) as PlantPart[])
|
|
37
|
+
affectedParts!: PlantPart;
|
|
38
|
+
|
|
39
|
+
@Column('text')
|
|
40
|
+
symptoms!: string;
|
|
41
|
+
|
|
42
|
+
@Column('text', { nullable: true })
|
|
43
|
+
appearanceConditions?: string;
|
|
44
|
+
|
|
45
|
+
@EnumColumn(Object.keys(CONTROL_METHOD) as ControlMethod[])
|
|
46
|
+
controlMethod!: ControlMethod;
|
|
47
|
+
|
|
48
|
+
@Column('text', { nullable: true })
|
|
49
|
+
controlNotes?: string;
|
|
50
|
+
|
|
51
|
+
@ManyToOne(() => PlantTechnicalSheet, (sheet) => sheet.pests, {
|
|
52
|
+
onDelete: 'CASCADE',
|
|
53
|
+
})
|
|
54
|
+
@JoinColumn({ name: 'technicalSheetId' })
|
|
55
|
+
technicalSheet!: PlantTechnicalSheet;
|
|
56
|
+
|
|
57
|
+
@OneToMany(() => ImageInfo, (image) => image.pest, {
|
|
58
|
+
cascade: true,
|
|
59
|
+
})
|
|
60
|
+
images?: ImageInfo[];
|
|
61
|
+
|
|
62
|
+
@Column({ type: 'boolean', default: true })
|
|
63
|
+
isActive!: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
ObjectLiteral,
|
|
6
|
+
OneToMany,
|
|
7
|
+
} from 'typeorm';
|
|
8
|
+
import { EnumColumn } from './utils/enumColumn';
|
|
9
|
+
import { GROWTH_AREA, GROWTH_HABIT } from './catalogs/growth-type';
|
|
10
|
+
import { PlantTechnicalSheet } from './PlantTechnicalSheet';
|
|
11
|
+
import { ImageInfo } from './ImageInfo';
|
|
12
|
+
|
|
13
|
+
export type PlantGrowthArea = keyof typeof GROWTH_AREA;
|
|
14
|
+
export type PlantGrowthHabit = keyof typeof GROWTH_HABIT;
|
|
15
|
+
|
|
16
|
+
@Entity('plant_growth_types')
|
|
17
|
+
export class PlantGrowthType implements ObjectLiteral {
|
|
18
|
+
@PrimaryGeneratedColumn('increment')
|
|
19
|
+
idPlantGrowthType!: number;
|
|
20
|
+
|
|
21
|
+
@EnumColumn(Object.keys(GROWTH_AREA) as PlantGrowthArea[])
|
|
22
|
+
area!: PlantGrowthArea;
|
|
23
|
+
|
|
24
|
+
@EnumColumn(Object.keys(GROWTH_HABIT) as PlantGrowthHabit[])
|
|
25
|
+
habit!: PlantGrowthHabit;
|
|
26
|
+
|
|
27
|
+
@Column('text', { nullable: true })
|
|
28
|
+
description?: string;
|
|
29
|
+
|
|
30
|
+
@OneToMany(() => ImageInfo, (image) => image.plantGrowthType, {
|
|
31
|
+
cascade: true,
|
|
32
|
+
})
|
|
33
|
+
images?: ImageInfo[];
|
|
34
|
+
|
|
35
|
+
@OneToMany(() => PlantTechnicalSheet, (sheet) => sheet.plantType)
|
|
36
|
+
sheets!: PlantTechnicalSheet[];
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'boolean', default: true })
|
|
39
|
+
isActive!: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
Column,
|
|
4
|
+
PrimaryGeneratedColumn,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
OneToMany,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
ObjectLiteral,
|
|
9
|
+
} from 'typeorm';
|
|
10
|
+
import { GROWTH_HABIT_GEOM, GrowthHabit } from './catalogs/plant-size';
|
|
11
|
+
import { PlantTechnicalSheet } from './PlantTechnicalSheet';
|
|
12
|
+
import { ImageInfo } from './ImageInfo';
|
|
13
|
+
import { EnumColumn } from './utils/enumColumn';
|
|
14
|
+
|
|
15
|
+
@Entity('plant_size')
|
|
16
|
+
export class PlantSize implements ObjectLiteral {
|
|
17
|
+
@PrimaryGeneratedColumn('increment')
|
|
18
|
+
idPlantSize!: number;
|
|
19
|
+
|
|
20
|
+
@Column('int')
|
|
21
|
+
heightCm!: number;
|
|
22
|
+
|
|
23
|
+
@Column('int', { nullable: true })
|
|
24
|
+
widthCm?: number | null;
|
|
25
|
+
|
|
26
|
+
@EnumColumn(Object.keys(GROWTH_HABIT_GEOM) as GrowthHabit[], { nullable: true })
|
|
27
|
+
habit?: GrowthHabit | undefined;
|
|
28
|
+
|
|
29
|
+
@Column('text', { nullable: true })
|
|
30
|
+
notes?: string | null;
|
|
31
|
+
|
|
32
|
+
@OneToMany(() => ImageInfo, (image) => image.plantSize, {
|
|
33
|
+
cascade: true,
|
|
34
|
+
nullable: true,
|
|
35
|
+
})
|
|
36
|
+
images?: ImageInfo[] | undefined;
|
|
37
|
+
|
|
38
|
+
@ManyToOne(() => PlantTechnicalSheet, (sheet) => sheet.size, {
|
|
39
|
+
nullable: false,
|
|
40
|
+
onDelete: 'CASCADE',
|
|
41
|
+
})
|
|
42
|
+
@JoinColumn({ name: 'plantTechnicalSheetId' })
|
|
43
|
+
plantTechnicalSheet!: PlantTechnicalSheet;
|
|
44
|
+
|
|
45
|
+
@Column({ type: 'boolean', default: true })
|
|
46
|
+
isActive!: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
ObjectLiteral,
|
|
6
|
+
OneToOne,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
OneToMany,
|
|
9
|
+
} from "typeorm";
|
|
10
|
+
import { PlantGrowthType } from "./PlantGrowthType";
|
|
11
|
+
import { LightInfo } from "./LightInfo";
|
|
12
|
+
import { HumidityInfo } from "./HumidityInfo";
|
|
13
|
+
import { ClimateIdeal } from "./ClimateIdeal";
|
|
14
|
+
import { SubstrateInfo } from "./SubstrateInfo";
|
|
15
|
+
import { FertilizationInfo } from "./FertilizationInfo";
|
|
16
|
+
import { PestInfo } from "./PestInfo";
|
|
17
|
+
import { CareInstructions } from "./CareInstructions";
|
|
18
|
+
import { PropagationMethodInfo } from "./PropagationMethodInfo";
|
|
19
|
+
import { PlantSize } from "./PlantSize";
|
|
20
|
+
import { GrowthClassInfo } from "./GrowthClassInfo";
|
|
21
|
+
import { ImageInfo } from "./ImageInfo";
|
|
22
|
+
|
|
23
|
+
@Entity("plant_technical_sheets")
|
|
24
|
+
export class PlantTechnicalSheet implements ObjectLiteral {
|
|
25
|
+
@PrimaryGeneratedColumn("increment")
|
|
26
|
+
idPlantTechnicalSheet!: number;
|
|
27
|
+
|
|
28
|
+
@Column("varchar", { length: 255 })
|
|
29
|
+
commonName!: string;
|
|
30
|
+
|
|
31
|
+
@Column("varchar", { length: 255 })
|
|
32
|
+
scientificName!: string;
|
|
33
|
+
|
|
34
|
+
@Column("varchar", { length: 255 })
|
|
35
|
+
origin!: string;
|
|
36
|
+
|
|
37
|
+
@OneToOne(() => PlantGrowthType, { cascade: true })
|
|
38
|
+
@JoinColumn({ name: "plantGrowthTypeId" })
|
|
39
|
+
plantType!: PlantGrowthType;
|
|
40
|
+
|
|
41
|
+
@OneToOne(() => LightInfo, { cascade: true })
|
|
42
|
+
@JoinColumn({ name: "lightInfoId" })
|
|
43
|
+
light!: LightInfo;
|
|
44
|
+
|
|
45
|
+
@OneToOne(() => HumidityInfo, { cascade: true })
|
|
46
|
+
@JoinColumn({ name: "humidityInfoId" })
|
|
47
|
+
humidity!: HumidityInfo;
|
|
48
|
+
|
|
49
|
+
@OneToOne(() => ClimateIdeal, { cascade: true })
|
|
50
|
+
@JoinColumn({ name: "climateIdealId" })
|
|
51
|
+
climate!: ClimateIdeal;
|
|
52
|
+
|
|
53
|
+
@OneToOne(() => SubstrateInfo, { cascade: true })
|
|
54
|
+
@JoinColumn({ name: "substrateInfoId" })
|
|
55
|
+
substrate!: SubstrateInfo;
|
|
56
|
+
|
|
57
|
+
@OneToOne(() => FertilizationInfo, { cascade: true })
|
|
58
|
+
@JoinColumn({ name: "fertilizationInfoId" })
|
|
59
|
+
fertilization!: FertilizationInfo;
|
|
60
|
+
|
|
61
|
+
@OneToMany(() => PestInfo, (pest) => pest.technicalSheet, {
|
|
62
|
+
cascade: true,
|
|
63
|
+
})
|
|
64
|
+
pests!: PestInfo[];
|
|
65
|
+
|
|
66
|
+
@OneToOne(() => CareInstructions, { cascade: true })
|
|
67
|
+
@JoinColumn({ name: "careInstructionsId" })
|
|
68
|
+
care!: CareInstructions;
|
|
69
|
+
|
|
70
|
+
@OneToOne(() => PropagationMethodInfo, { cascade: true })
|
|
71
|
+
@JoinColumn({ name: "propagationMethodId" })
|
|
72
|
+
propagation!: PropagationMethodInfo;
|
|
73
|
+
|
|
74
|
+
@OneToOne(() => PlantSize, { cascade: true })
|
|
75
|
+
@JoinColumn({ name: "plantSizeId" })
|
|
76
|
+
size!: PlantSize;
|
|
77
|
+
|
|
78
|
+
@OneToOne(() => GrowthClassInfo, { cascade: true })
|
|
79
|
+
@JoinColumn({ name: "growthClassInfoId" })
|
|
80
|
+
growthClass!: GrowthClassInfo;
|
|
81
|
+
|
|
82
|
+
@OneToMany(() => ImageInfo, (img) => img.plantTechnicalSheet, {
|
|
83
|
+
cascade: true,
|
|
84
|
+
})
|
|
85
|
+
images?: ImageInfo[];
|
|
86
|
+
|
|
87
|
+
@Column("text", { nullable: true })
|
|
88
|
+
notes?: string;
|
|
89
|
+
|
|
90
|
+
@Column({ type: "boolean", default: true })
|
|
91
|
+
isActive!: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
Column,
|
|
4
|
+
PrimaryGeneratedColumn,
|
|
5
|
+
OneToMany,
|
|
6
|
+
ObjectLiteral,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { PropagationMethod, PROPAGATION } from "./catalogs/propagation-method";
|
|
9
|
+
import { ImageInfo } from "./ImageInfo";
|
|
10
|
+
import { PlantTechnicalSheet } from "./PlantTechnicalSheet";
|
|
11
|
+
import { EnumColumn } from "./utils/enumColumn";
|
|
12
|
+
|
|
13
|
+
@Entity("propagation_method_info")
|
|
14
|
+
export class PropagationMethodInfo implements ObjectLiteral {
|
|
15
|
+
@PrimaryGeneratedColumn("increment")
|
|
16
|
+
idPropagationMethodInfo!: number;
|
|
17
|
+
|
|
18
|
+
@EnumColumn(Object.keys(PROPAGATION) as PropagationMethod[], {
|
|
19
|
+
nullable: false,
|
|
20
|
+
})
|
|
21
|
+
type!: PropagationMethod | undefined;
|
|
22
|
+
|
|
23
|
+
@Column("text", { nullable: true })
|
|
24
|
+
description?: string | null;
|
|
25
|
+
|
|
26
|
+
@OneToMany(() => ImageInfo, (image) => image.propagationMethod, {
|
|
27
|
+
cascade: true,
|
|
28
|
+
nullable: true,
|
|
29
|
+
})
|
|
30
|
+
images?: ImageInfo[] | undefined;
|
|
31
|
+
|
|
32
|
+
@OneToMany(() => PlantTechnicalSheet, (sheet) => sheet.propagation)
|
|
33
|
+
plantTechnicalSheets!: PlantTechnicalSheet[];
|
|
34
|
+
|
|
35
|
+
@Column({ type: "boolean", default: true })
|
|
36
|
+
isActive?: boolean | undefined;
|
|
37
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
Column,
|
|
4
|
+
PrimaryGeneratedColumn,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
OneToMany,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
ObjectLiteral,
|
|
9
|
+
} from 'typeorm';
|
|
10
|
+
import { SubstrateType, SUBSTRATE } from './catalogs/substrate-info';
|
|
11
|
+
import { ImageInfo } from './ImageInfo';
|
|
12
|
+
import { PlantTechnicalSheet } from './PlantTechnicalSheet';
|
|
13
|
+
import { EnumColumn } from './utils/enumColumn';
|
|
14
|
+
|
|
15
|
+
@Entity('substrate_info')
|
|
16
|
+
export class SubstrateInfo implements ObjectLiteral {
|
|
17
|
+
@PrimaryGeneratedColumn('increment')
|
|
18
|
+
idSubstrateInfo!: number;
|
|
19
|
+
|
|
20
|
+
@EnumColumn(Object.keys(SUBSTRATE) as SubstrateType[])
|
|
21
|
+
type!: SubstrateType;
|
|
22
|
+
|
|
23
|
+
@Column('text', { nullable: true })
|
|
24
|
+
recipe?: string;
|
|
25
|
+
|
|
26
|
+
@Column('text', { nullable: true })
|
|
27
|
+
notes?: string;
|
|
28
|
+
|
|
29
|
+
@OneToMany(() => ImageInfo, (image) => image.substrateInfo, {
|
|
30
|
+
cascade: true,
|
|
31
|
+
nullable: true,
|
|
32
|
+
})
|
|
33
|
+
images?: ImageInfo[];
|
|
34
|
+
|
|
35
|
+
@ManyToOne(() => PlantTechnicalSheet, (sheet) => sheet.substrate, {
|
|
36
|
+
nullable: false,
|
|
37
|
+
onDelete: 'CASCADE',
|
|
38
|
+
})
|
|
39
|
+
@JoinColumn({ name: 'plantTechnicalSheetId' })
|
|
40
|
+
plantTechnicalSheet!: PlantTechnicalSheet;
|
|
41
|
+
|
|
42
|
+
@Column({ type: 'boolean', default: true })
|
|
43
|
+
isActive!: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/models/technical-sheet/catalogs/climate-ideal.ts
|
|
2
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
3
|
+
|
|
4
|
+
export const CLIMATE = makeCatalog({
|
|
5
|
+
TROPICAL: '18–35 °C, sin heladas.',
|
|
6
|
+
SUBTROPICAL: '12–30 °C, invierno suave.',
|
|
7
|
+
TEMPLADO: '5–28 °C, estaciones marcadas.',
|
|
8
|
+
MEDITERRÁNEO: 'Invierno templado, verano seco.',
|
|
9
|
+
DESÉRTICO: '5–45 °C, muy seco.',
|
|
10
|
+
FRÍO_MONTANO: '–5–20 °C, heladas frecuentes.',
|
|
11
|
+
UNIVERSAL: 'Amplio rango 5–35 °C.',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type ClimateType = keyof typeof CLIMATE;
|
|
15
|
+
|
|
16
|
+
export type TemperatureRangeC = [min: number, max: number];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
2
|
+
|
|
3
|
+
export const FERTILIZER_TYPE = makeCatalog({
|
|
4
|
+
ORGÁNICO: 'Humus, compost, estiércol.',
|
|
5
|
+
MINERAL: 'Sales NPK solubles.',
|
|
6
|
+
LIBERACIÓN_LENTA: 'Gránulos 3–6 meses.',
|
|
7
|
+
LÍQUIDO: 'Soluble para riego.',
|
|
8
|
+
FOLIAR: 'Aplicación foliar.',
|
|
9
|
+
ESPECÍFICO_PARA_FLORACIÓN: 'Alto P y K.',
|
|
10
|
+
ESPECÍFICO_PARA_HOJAS: 'Alto N.',
|
|
11
|
+
ENRAIZANTE: 'Auxinas para raíces.',
|
|
12
|
+
ABONO_COMPLETO: 'NPK balanceado + micro.',
|
|
13
|
+
NINGUNO: 'No se fertiliza regularmente.',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type FertilizerType = keyof typeof FERTILIZER_TYPE;
|
|
17
|
+
|
|
18
|
+
export const FERTILIZER_FREQ = makeCatalog({
|
|
19
|
+
SEMANAL: 'Cada semana.',
|
|
20
|
+
CADA_15_DÍAS: 'Cada 15 días.',
|
|
21
|
+
MENSUAL: 'Mensual.',
|
|
22
|
+
CADA_3_MESES: 'Trimestral.',
|
|
23
|
+
EN_PRIMAVERA_VERANO: 'Solo temporada activa.',
|
|
24
|
+
EN_PERÍODOS_ACTIVOS: 'Cuando la planta crece.',
|
|
25
|
+
OCASIONAL: 'Ante carencias.',
|
|
26
|
+
NINGUNA: 'Nunca.',
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export type FertilizerFrequency = keyof typeof FERTILIZER_FREQ;
|
|
30
|
+
|
|
31
|
+
export const FERTILIZER_METHOD = makeCatalog({
|
|
32
|
+
EN_EL_RIEGO: 'Disuelto en riego.',
|
|
33
|
+
DIRECTO_EN_SUSTRATO: 'Espolvoreado en sustrato.',
|
|
34
|
+
FOLIAR: 'Pulverizado en hojas.',
|
|
35
|
+
GRANULADO: 'Gránulos superficiales.',
|
|
36
|
+
EN_TABLETAS: 'Tabletas enterradas.',
|
|
37
|
+
HIDROPONÍA: 'En solución nutritiva.',
|
|
38
|
+
NO_APLICA: 'No corresponde.',
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export type FertilizerMethod = keyof typeof FERTILIZER_METHOD;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/models/technical-sheet/catalogs/growth-class.ts
|
|
2
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
3
|
+
|
|
4
|
+
export const GROWTH_CLASS = makeCatalog({
|
|
5
|
+
EFÍMERA_ANUAL: 'Ciclo <1 año.',
|
|
6
|
+
HEMIANUAL_ESTACIONAL: 'Activa 1–2 estaciones/año.',
|
|
7
|
+
PERENNE_CRECIMIENTO_CONTINUO: 'Activa todo el año.',
|
|
8
|
+
LEÑOSA_LENTA: '<20 cm/año.',
|
|
9
|
+
HERBÁCEA_MODERADA: '30–80 cm/año.',
|
|
10
|
+
TREPADORA_RÁPIDA: '>1.5 m/año.',
|
|
11
|
+
ESTOLONIFERA_EXPANSIVA: 'Expansión horizontal veloz.',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type GrowthClass = keyof typeof GROWTH_CLASS;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/models/technical-sheet/catalogs.ts
|
|
2
|
+
|
|
3
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
4
|
+
|
|
5
|
+
export const GROWTH_AREA = makeCatalog({
|
|
6
|
+
INTERIOR: 'Dentro de edificaciones; temperatura controlada.',
|
|
7
|
+
EXTERIOR_SOMBRA: '<2 h de sol directo.',
|
|
8
|
+
EXTERIOR_MEDIA_SOMBRA: '2–4 h de sol suave.',
|
|
9
|
+
EXTERIOR_SOL_DIRECTO: '>6 h de sol pleno.',
|
|
10
|
+
INVERNADERO: 'Estructura con temp. y HR controladas.',
|
|
11
|
+
ACUÁTICA: 'Raíces en agua o sustrato inundado.',
|
|
12
|
+
TERRARIO: 'Recinto cerrado, humedad muy alta.',
|
|
13
|
+
});
|
|
14
|
+
export type PlantGrowthArea = keyof typeof GROWTH_AREA;
|
|
15
|
+
|
|
16
|
+
export const GROWTH_HABIT = makeCatalog({
|
|
17
|
+
ERGIDA: 'Porte vertical.',
|
|
18
|
+
TREPADORA: 'Escala tutores o cuelga.',
|
|
19
|
+
COLGANTE: 'Tallos péndulos.',
|
|
20
|
+
HELECHO: 'Frondas divididas.',
|
|
21
|
+
SUCULENTA: 'Tejidos carnosos con agua.',
|
|
22
|
+
CACTUS: 'Tallo suculento con espinas.',
|
|
23
|
+
BROMELIA: 'Epífita de copa.',
|
|
24
|
+
ORQUÍDEA_EPÍFITA: 'Raíces aéreas.',
|
|
25
|
+
ARBUSTO: 'Leñoso <5 m.',
|
|
26
|
+
COBERTORA: 'Cubre el suelo.',
|
|
27
|
+
ENREDADERA: 'Tallo que se enrosca.',
|
|
28
|
+
FLOR_PERENNE: 'Herbácea plurianual.',
|
|
29
|
+
ÁRBOL: 'Leñoso ≥5 m.',
|
|
30
|
+
PALMERA: 'Tronco no ramificado.',
|
|
31
|
+
PASTO_ORNAMENTAL: 'Gramínea decorativa.',
|
|
32
|
+
FLOTANTE: 'Flota sobre el agua.',
|
|
33
|
+
EMERGENTE: 'Sobresale del agua.',
|
|
34
|
+
MUSGO: 'Briofita sin raíces.',
|
|
35
|
+
MINI_HELECHO: 'Helecho pequeño.',
|
|
36
|
+
});
|
|
37
|
+
export type PlantGrowthHabit = keyof typeof GROWTH_HABIT;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
2
|
+
|
|
3
|
+
export const HUMIDITY = makeCatalog({
|
|
4
|
+
XERICO: 'Sequía extrema (<10 % HR).',
|
|
5
|
+
SECO: 'Riego escaso (sustrato seco).',
|
|
6
|
+
MESICO: 'Sustrato ligeramente húmedo.',
|
|
7
|
+
HUMEDO: 'HR 60–80 %; riego frecuente.',
|
|
8
|
+
HUMEDO_CONSTANTE: 'Sustrato siempre húmedo.',
|
|
9
|
+
ACUATICO: 'Raíces permanentemente sumergidas.',
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type HumidityRequirement = keyof typeof HUMIDITY;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/models/technical-sheet/catalogs/light-info.ts
|
|
2
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
3
|
+
|
|
4
|
+
export const LIGHT = makeCatalog({
|
|
5
|
+
SOMBRA_PROFUNDA: '<2 h luz directa (100–200 lux).',
|
|
6
|
+
SOMBRA_PARCIAL: '2–4 h luz filtrada (200–500 lux).',
|
|
7
|
+
LUZ_INDIRECTA_BRILLANTE: 'Junto a ventana (500–1500 lux).',
|
|
8
|
+
SOL_SUAVE: 'Sol suave 2–4 h.',
|
|
9
|
+
SOL_PARCIAL: 'Sol 4–6 h.',
|
|
10
|
+
SOL_PLENO: 'Sol >6 h; >30 klux.',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type LightRequirement = keyof typeof LIGHT;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
2
|
+
|
|
3
|
+
export const PLANT_PART = makeCatalog({
|
|
4
|
+
HOJAS: 'Hojas.',
|
|
5
|
+
TALLOS: 'Tallos.',
|
|
6
|
+
RAÍCES: 'Raíces.',
|
|
7
|
+
FLORES: 'Flores.',
|
|
8
|
+
FRUTOS: 'Frutos.',
|
|
9
|
+
TODA_LA_PLANTA: 'Daño sistémico.',
|
|
10
|
+
});
|
|
11
|
+
export type PlantPart = keyof typeof PLANT_PART;
|
|
12
|
+
|
|
13
|
+
export const CONTROL_METHOD = makeCatalog({
|
|
14
|
+
JABÓN_POTÁSICO: 'Insecticida suave.',
|
|
15
|
+
ACEITE_DE_NEEM: 'Azadiractina sistémica.',
|
|
16
|
+
INSECTICIDA_SISTÉMICO: 'Absorción interna.',
|
|
17
|
+
INSECTICIDA_CONTACTO: 'Mata por contacto.',
|
|
18
|
+
FUNGICIDA_SISTÉMICO: 'Control interno hongos.',
|
|
19
|
+
FUNGICIDA_CONTACTO: 'Barrera superficial.',
|
|
20
|
+
TRAMPAS: 'Captura física.',
|
|
21
|
+
PODA_SANITARIA: 'Eliminación partes infectadas.',
|
|
22
|
+
CONTROL_BIOLÓGICO: 'Depredadores benéficos.',
|
|
23
|
+
OTRO: 'Otro método.',
|
|
24
|
+
});
|
|
25
|
+
export type ControlMethod = keyof typeof CONTROL_METHOD;
|
|
26
|
+
|
|
27
|
+
export const PEST_TYPE = makeCatalog({
|
|
28
|
+
INSECTO: 'Insectos.',
|
|
29
|
+
HONGO: 'Hongos.',
|
|
30
|
+
ÁCARO: 'Aácaros.',
|
|
31
|
+
BACTERIA: 'Bacterias.',
|
|
32
|
+
VIRUS: 'Virus.',
|
|
33
|
+
NEMATODO: 'Nematodos.',
|
|
34
|
+
OTRO: 'Otro.',
|
|
35
|
+
});
|
|
36
|
+
export type PestType = keyof typeof PEST_TYPE;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/models/technical-sheet/catalogs/plant-size.ts
|
|
2
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
3
|
+
|
|
4
|
+
export const GROWTH_HABIT_GEOM = makeCatalog({
|
|
5
|
+
COMPACTA: 'Poco volumen.',
|
|
6
|
+
EXPANSIVA: 'Brotes laterales extensos.',
|
|
7
|
+
ERECTA: 'Vertical sin soporte.',
|
|
8
|
+
RASERA: 'Se extiende sobre el suelo.',
|
|
9
|
+
TREPADORA: 'Escala estructuras.',
|
|
10
|
+
COLGANTE: 'Tallos péndulos.',
|
|
11
|
+
ARBUSTIVA: 'Múltiples ramas leñosas.',
|
|
12
|
+
ARBOREA: 'Tronco leñoso único.',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type GrowthHabit = keyof typeof GROWTH_HABIT_GEOM;
|