proflores-db-model 0.1.34 → 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.js +2 -2
- package/dist/entities/InventoryImage.js +2 -2
- package/dist/entities/InventoryItem.js +2 -2
- package/dist/entities/InventoryMovement.js +2 -2
- 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 +1 -0
- package/dist/index.js +1 -0
- 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.js +1 -1
- package/package.json +5 -5
- package/src/entities/Inventory.ts +1 -0
- package/src/index.ts +1 -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
|
@@ -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;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/models/technical-sheet/catalogs/propagation-method.ts
|
|
2
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
3
|
+
|
|
4
|
+
export const PROPAGATION = makeCatalog({
|
|
5
|
+
ESQUEJE_TALLO: 'Corte de tallo.',
|
|
6
|
+
ESQUEJE_HOJA: 'Esqueje de hoja.',
|
|
7
|
+
ESQUEJE_RAÍZ: 'Fragmento de raíz.',
|
|
8
|
+
SEMILLA: 'Propagación sexual.',
|
|
9
|
+
DIVISIÓN_MATA: 'División de mata.',
|
|
10
|
+
ACODO_SIMPLE: 'Acodo simple.',
|
|
11
|
+
ACODO_AÉREO: 'Acodo aéreo.',
|
|
12
|
+
IN_VITRO: 'Cultivo in vitro.',
|
|
13
|
+
BULBO_RIZOMA_TUBÉRCULO: 'Ãrgano subterráneo.',
|
|
14
|
+
HIJUELOS: 'Brotes basales.',
|
|
15
|
+
NO_APLICA: 'No aplicable.',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type PropagationMethod = keyof typeof PROPAGATION;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/models/technical-sheet/catalogs/substrate-info.ts
|
|
2
|
+
import { makeCatalog } from '../utils/makeCatalog';
|
|
3
|
+
|
|
4
|
+
export const SUBSTRATE = makeCatalog({
|
|
5
|
+
UNIVERSAL: 'Mezcla equilibrada.',
|
|
6
|
+
INTERIOR_LIGERO: 'Turba + perlita.',
|
|
7
|
+
CACTUS_SUCULENTAS: 'Arena + grava, baja materia orgánica.',
|
|
8
|
+
ORQUÍDEAS_EPÍFITAS: 'Corteza gruesa + carbón.',
|
|
9
|
+
BROMELIAS: 'Fibra coco + corteza.',
|
|
10
|
+
ACUÁTICO: 'Arcilla y arena sumergida.',
|
|
11
|
+
HELECHOS_HUMEDOS: 'Turba + musgo esfagno.',
|
|
12
|
+
SEMILLERO: 'Turba fina esterilizada.',
|
|
13
|
+
BONSAI: 'Akadama + kiryuzuna + grava.',
|
|
14
|
+
HIDROPONÍA: 'Sustrato inerte.',
|
|
15
|
+
ARENA_GRAVILLA: '100 % mineral.',
|
|
16
|
+
FIBRA_COCO_PURA: 'Coco hidratado.',
|
|
17
|
+
TURBA: 'Turba rubia o negra.',
|
|
18
|
+
COMPOST_HOJARASCA: 'Orgánico descompuesto.',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type SubstrateType = keyof typeof SUBSTRATE;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './PlantTechnicalSheet';
|
|
2
|
+
export * from './GrowthClassInfo';
|
|
3
|
+
export * from './CareInstructions';
|
|
4
|
+
export * from './ImageInfo';
|
|
5
|
+
export * from './LightInfo';
|
|
6
|
+
export * from './HumidityInfo';
|
|
7
|
+
export * from './PestInfo';
|
|
8
|
+
export * from './PlantGrowthType';
|
|
9
|
+
export * from './PlantSize';
|
|
10
|
+
export * from './SubstrateInfo';
|
|
11
|
+
export * from './ClimateIdeal';
|
|
12
|
+
export * from './FertilizationInfo';
|
|
13
|
+
export * from './PropagationMethodInfo';
|
|
14
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/models/technical-sheet/utils/enumColumn.ts
|
|
2
|
+
import { ColumnOptions, Column } from "typeorm";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Utilidad para columnas enum basadas en catálogos TypeScript.
|
|
6
|
+
* Permite usar `keyof typeof ENUM` como tipo en la entidad.
|
|
7
|
+
*/
|
|
8
|
+
export function EnumColumn<T extends string>(
|
|
9
|
+
values: readonly T[],
|
|
10
|
+
options: Omit<ColumnOptions, "type" | "enum"> = {}
|
|
11
|
+
): PropertyDecorator {
|
|
12
|
+
return Column({
|
|
13
|
+
type: "enum",
|
|
14
|
+
enum: values,
|
|
15
|
+
...options,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* =============================================================================
|
|
2
|
+
* UTILITY ───────────── makeCatalog
|
|
3
|
+
* ---------------------------------------------------------------------------
|
|
4
|
+
* Crea un Record<K, string> inmutable para catálogos
|
|
5
|
+
* y permite derivar tipos clave (keyof).
|
|
6
|
+
* ===========================================================================*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Define un catálogo estático e inmutable y devuelve el mismo objeto.
|
|
10
|
+
* TypeScript infiere correctamente los tipos de clave.
|
|
11
|
+
*
|
|
12
|
+
* @param c Objeto Record<string, string> que representa el catálogo
|
|
13
|
+
* @returns El mismo objeto `c`, como constante tipada
|
|
14
|
+
*/
|
|
15
|
+
export function makeCatalog<C extends Record<string, string>>(c: C): C {
|
|
16
|
+
return c;
|
|
17
|
+
}
|