Algunos campos agregados/eliminados
This commit is contained in:
14
apps/api/src/database/migrations/0011_magical_thundra.sql
Normal file
14
apps/api/src/database/migrations/0011_magical_thundra.sql
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "commune_name" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "commune_rif" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "commune_spokesperson_name" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "commune_spokesperson_cedula" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "commune_spokesperson_rif" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "commune_spokesperson_phone" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "commune_email" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "communal_council_rif" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "communal_council_spokesperson_name" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "communal_council_spokesperson_cedula" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "communal_council_spokesperson_rif" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "communal_council_spokesperson_phone" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "communal_council_email" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "osp_google_maps_link" text DEFAULT '' NOT NULL;
|
||||||
20
apps/api/src/database/migrations/0012_sudden_venus.sql
Normal file
20
apps/api/src/database/migrations/0012_sudden_venus.sql
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "coor_state" integer;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "coor_municipality" integer;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "coor_parish" integer;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "coor_phone" text;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "eco_sector" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "productive_sector" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "central_productive_activity" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "main_productive_activity" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "types_of_equipment" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "equipment_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "equipment_description" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "raw_material" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "material_type" text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "raw_material_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "product_count_daily" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "product_count_weekly" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD COLUMN "product_count_monthly" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD CONSTRAINT "training_surveys_coor_state_states_id_fk" FOREIGN KEY ("coor_state") REFERENCES "public"."states"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD CONSTRAINT "training_surveys_coor_municipality_municipalities_id_fk" FOREIGN KEY ("coor_municipality") REFERENCES "public"."municipalities"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "training_surveys" ADD CONSTRAINT "training_surveys_coor_parish_parishes_id_fk" FOREIGN KEY ("coor_parish") REFERENCES "public"."parishes"("id") ON DELETE set null ON UPDATE no action;
|
||||||
1948
apps/api/src/database/migrations/meta/0011_snapshot.json
Normal file
1948
apps/api/src/database/migrations/meta/0011_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
2102
apps/api/src/database/migrations/meta/0012_snapshot.json
Normal file
2102
apps/api/src/database/migrations/meta/0012_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -78,6 +78,20 @@
|
|||||||
"when": 1769097895095,
|
"when": 1769097895095,
|
||||||
"tag": "0010_dashing_bishop",
|
"tag": "0010_dashing_bishop",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 11,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1769618795008,
|
||||||
|
"tag": "0011_magical_thundra",
|
||||||
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 12,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1769621656400,
|
||||||
|
"tag": "0012_sudden_venus",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -62,8 +62,22 @@ export const trainingSurveys = t.pgTable(
|
|||||||
.integer('parish')
|
.integer('parish')
|
||||||
.references(() => parishes.id, { onDelete: 'set null' }),
|
.references(() => parishes.id, { onDelete: 'set null' }),
|
||||||
siturCodeCommune: t.text('situr_code_commune').notNull(),
|
siturCodeCommune: t.text('situr_code_commune').notNull(),
|
||||||
|
communeName: t.text('commune_name').notNull().default(''),
|
||||||
|
communeRif: t.text('commune_rif').notNull().default(''),
|
||||||
|
communeSpokespersonName: t.text('commune_spokesperson_name').notNull().default(''),
|
||||||
|
communeSpokespersonCedula: t.text('commune_spokesperson_cedula').notNull().default(''),
|
||||||
|
communeSpokespersonRif: t.text('commune_spokesperson_rif').notNull().default(''),
|
||||||
|
communeSpokespersonPhone: t.text('commune_spokesperson_phone').notNull().default(''),
|
||||||
|
communeEmail: t.text('commune_email').notNull().default(''),
|
||||||
communalCouncil: t.text('communal_council').notNull(),
|
communalCouncil: t.text('communal_council').notNull(),
|
||||||
siturCodeCommunalCouncil: t.text('situr_code_communal_council').notNull(),
|
siturCodeCommunalCouncil: t.text('situr_code_communal_council').notNull(),
|
||||||
|
communalCouncilRif: t.text('communal_council_rif').notNull().default(''),
|
||||||
|
communalCouncilSpokespersonName: t.text('communal_council_spokesperson_name').notNull().default(''),
|
||||||
|
communalCouncilSpokespersonCedula: t.text('communal_council_spokesperson_cedula').notNull().default(''),
|
||||||
|
communalCouncilSpokespersonRif: t.text('communal_council_spokesperson_rif').notNull().default(''),
|
||||||
|
communalCouncilSpokespersonPhone: t.text('communal_council_spokesperson_phone').notNull().default(''),
|
||||||
|
communalCouncilEmail: t.text('communal_council_email').notNull().default(''),
|
||||||
|
ospGoogleMapsLink: t.text('osp_google_maps_link').notNull().default(''),
|
||||||
// datos del OSP (ORGANIZACIÓN SOCIOPRODUCTIVA)
|
// datos del OSP (ORGANIZACIÓN SOCIOPRODUCTIVA)
|
||||||
ospName: t.text('osp_name').notNull(),
|
ospName: t.text('osp_name').notNull(),
|
||||||
ospAddress: t.text('osp_address').notNull(),
|
ospAddress: t.text('osp_address').notNull(),
|
||||||
@@ -96,6 +110,34 @@ export const trainingSurveys = t.pgTable(
|
|||||||
photo1: t.text('photo1').notNull(),
|
photo1: t.text('photo1').notNull(),
|
||||||
photo2: t.text('photo2'),
|
photo2: t.text('photo2'),
|
||||||
photo3: t.text('photo3'),
|
photo3: t.text('photo3'),
|
||||||
|
// nuevos campos coordinacion
|
||||||
|
coorState: t
|
||||||
|
.integer('coor_state')
|
||||||
|
.references(() => states.id, { onDelete: 'set null' }),
|
||||||
|
coorMunicipality: t
|
||||||
|
.integer('coor_municipality')
|
||||||
|
.references(() => municipalities.id, { onDelete: 'set null' }),
|
||||||
|
coorParish: t
|
||||||
|
.integer('coor_parish')
|
||||||
|
.references(() => parishes.id, { onDelete: 'set null' }),
|
||||||
|
coorPhone: t.text('coor_phone'),
|
||||||
|
// sectores
|
||||||
|
ecoSector: t.text('eco_sector').notNull().default(''),
|
||||||
|
productiveSector: t.text('productive_sector').notNull().default(''),
|
||||||
|
centralProductiveActivity: t.text('central_productive_activity').notNull().default(''),
|
||||||
|
mainProductiveActivity: t.text('main_productive_activity').notNull().default(''),
|
||||||
|
// equipamiento
|
||||||
|
typesOfEquipment: t.text('types_of_equipment').notNull().default(''),
|
||||||
|
equipmentCount: t.integer('equipment_count').notNull().default(0),
|
||||||
|
equipmentDescription: t.text('equipment_description').notNull().default(''),
|
||||||
|
// materia prima
|
||||||
|
rawMaterial: t.text('raw_material').notNull().default(''),
|
||||||
|
materialType: t.text('material_type').notNull().default(''),
|
||||||
|
rawMaterialCount: t.integer('raw_material_count').notNull().default(0),
|
||||||
|
// conteo de productos
|
||||||
|
productCountDaily: t.integer('product_count_daily').notNull().default(0),
|
||||||
|
productCountWeekly: t.integer('product_count_weekly').notNull().default(0),
|
||||||
|
productCountMonthly: t.integer('product_count_monthly').notNull().default(0),
|
||||||
...timestamps,
|
...timestamps,
|
||||||
},
|
},
|
||||||
(trainingSurveys) => ({
|
(trainingSurveys) => ({
|
||||||
|
|||||||
@@ -24,20 +24,51 @@ export class CreateTrainingDto {
|
|||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsInt()
|
@IsInt()
|
||||||
|
@IsOptional()
|
||||||
state: number;
|
state: number;
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsInt()
|
@IsInt()
|
||||||
|
@IsOptional()
|
||||||
municipality: number;
|
municipality: number;
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsInt()
|
@IsInt()
|
||||||
|
@IsOptional()
|
||||||
parish: number;
|
parish: number;
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsString()
|
@IsString()
|
||||||
siturCodeCommune: string;
|
siturCodeCommune: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communeName: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communeRif: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communeSpokespersonName: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communeSpokespersonCedula: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communeSpokespersonRif: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communeSpokespersonPhone: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communeEmail: string;
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsString()
|
@IsString()
|
||||||
communalCouncil: string;
|
communalCouncil: string;
|
||||||
@@ -46,6 +77,34 @@ export class CreateTrainingDto {
|
|||||||
@IsString()
|
@IsString()
|
||||||
siturCodeCommunalCouncil: string;
|
siturCodeCommunalCouncil: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communalCouncilRif: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communalCouncilSpokespersonName: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communalCouncilSpokespersonCedula: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communalCouncilSpokespersonRif: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communalCouncilSpokespersonPhone: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
communalCouncilEmail: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
ospGoogleMapsLink: string;
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsString()
|
@IsString()
|
||||||
ospName: string;
|
ospName: string;
|
||||||
@@ -146,4 +205,81 @@ export class CreateTrainingDto {
|
|||||||
@IsString()
|
@IsString()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
paralysisReason: string;
|
paralysisReason: string;
|
||||||
|
|
||||||
|
// nuevos campos coordinacion
|
||||||
|
@ApiProperty()
|
||||||
|
@IsInt()
|
||||||
|
@IsOptional()
|
||||||
|
coorState?: number;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsInt()
|
||||||
|
@IsOptional()
|
||||||
|
coorMunicipality?: number;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsInt()
|
||||||
|
@IsOptional()
|
||||||
|
coorParish?: number;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
@IsOptional()
|
||||||
|
coorPhone?: string;
|
||||||
|
|
||||||
|
// sectores
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
ecoSector: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
productiveSector: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
centralProductiveActivity: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
mainProductiveActivity: string;
|
||||||
|
|
||||||
|
// equipamiento
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
typesOfEquipment: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsInt()
|
||||||
|
equipmentCount: number;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
equipmentDescription: string;
|
||||||
|
|
||||||
|
// materia prima
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
rawMaterial: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsString()
|
||||||
|
materialType: string;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsInt()
|
||||||
|
rawMaterialCount: number;
|
||||||
|
|
||||||
|
// conteo de productos
|
||||||
|
@ApiProperty()
|
||||||
|
@IsInt()
|
||||||
|
productCountDaily: number;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsInt()
|
||||||
|
productCountWeekly: number;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
@IsInt()
|
||||||
|
productCountMonthly: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ export default function NewTrainingPage() {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContainer scrollable>
|
// <PageContainer scrollable>
|
||||||
<div className="flex-1 space-y-4">
|
<div className="px-6 pt-2 pb-6 flex-1 space-y-4">
|
||||||
<CreateTrainingForm
|
<CreateTrainingForm
|
||||||
onSuccess={() => router.push('/dashboard/formulario')}
|
onSuccess={() => router.push('/dashboard/formulario')}
|
||||||
onCancel={() => router.back()}
|
onCancel={() => router.back()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</PageContainer>
|
// </PageContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,25 +37,116 @@ import {
|
|||||||
import { SelectSearchable } from '@repo/shadcn/select-searchable';
|
import { SelectSearchable } from '@repo/shadcn/select-searchable';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const PRODUCTIVE_ACTIVITIES = [
|
// const PRODUCTIVE_ACTIVITIES = [
|
||||||
'Agricola',
|
// 'Agricola',
|
||||||
'Textil',
|
// 'Textil',
|
||||||
'Bloquera',
|
// 'Bloquera',
|
||||||
'Carpinteria',
|
// 'Carpinteria',
|
||||||
'Unidad de suministro',
|
// 'Unidad de suministro',
|
||||||
];
|
// ];
|
||||||
|
|
||||||
const ECO_SECTORS = ['Primario', 'Secundario', 'Terciario'];
|
const ECO_SECTORS = ['Primario', 'Secundario', 'Terciario'];
|
||||||
|
|
||||||
// const ECO_SECTORS_PRIMARIO = ['Agropecuario', 'Pesca', 'Minería', 'Forestal'];
|
// const ECO_SECTORS_PRIMARIO = ['Agropecuario', 'Pesca', 'Minería', 'Forestal'];
|
||||||
// const ECO_SECTORS_SECUNDARIO = ['Manufactura', 'Construcción', 'Energía'];
|
// const ECO_SECTORS_SECUNDARIO = ['Manufactura', 'Construcción', 'Energía'];
|
||||||
const ECO_SECTORS_PRIMARIO = ['Agricola'];
|
|
||||||
const ECO_SECTORS_SECUNDARIO = ['Manufactura'];
|
|
||||||
const ECO_SECTORS_TERCIARIO = ['Servicios', 'Comercio', 'Turismo'];
|
|
||||||
|
|
||||||
const CENTRAL_PRODUCTIVE_ACTIVITY = ['Produción Vegetal', 'Produción Animal', 'Produción Animal y Vegetal'];
|
const PRODUCTIVE_SECTORS = ['Agricola', 'Manufactura', 'Servicios', 'Comercio', 'Turismo'];
|
||||||
const MAIN_PRODUCTIVE_ACTIVITY = ['Agricultura', ''];
|
|
||||||
|
|
||||||
|
const CENTRAL_PRODUCTIVE_ACTIVITY = [
|
||||||
|
'Produción Vegetal',
|
||||||
|
'Produción Animal',
|
||||||
|
'Produción Animal y Vegetal',
|
||||||
|
'INDUSTRIAL',
|
||||||
|
'SERVICIOS',
|
||||||
|
'TURISMO',
|
||||||
|
'COMERCIO'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
// const PRODUCTIVE_SECTORS_PRIMARIO = ['Agricola'];
|
||||||
|
// const PRODUCTIVE_SECTORS_SECUNDARIO = ['Manufactura'];
|
||||||
|
// const PRODUCTIVE_SECTORS_TERCIARIO = ['Servicios', 'Comercio', 'Turismo'];
|
||||||
|
|
||||||
|
const MAIN_PRODUCTIVE_ACTIVITY = [
|
||||||
|
'AGRICULTURA ',
|
||||||
|
'CRIA ',
|
||||||
|
'PATIOS PRODUCTIVOS O CONUCOS ',
|
||||||
|
'TRANSFORMACION DE LA MATERIA PRIMA',
|
||||||
|
'TALLER DE COFECCION TEXTIL ',
|
||||||
|
'CONSTRUCION ',
|
||||||
|
'OFRECER PRODUCTOS DE BIENES Y SERVICIOS',
|
||||||
|
'VISITAS GUIADAS ',
|
||||||
|
'ALOJAMIENTO ',
|
||||||
|
'TURISMO',
|
||||||
|
'COMERCIO'
|
||||||
|
];
|
||||||
|
|
||||||
|
const PRODUCTIVE_ACTIVITIES = [
|
||||||
|
'SIEMBRA DE MAIZ ',
|
||||||
|
'SIEMBRA DE AJI',
|
||||||
|
'SIEMBRA DE CAFÉ ',
|
||||||
|
'SIEMBRA DE PLATANO',
|
||||||
|
'SIEMBRA DE CAMBUR ',
|
||||||
|
'SIEMBRA DE AGUACATE',
|
||||||
|
'SIEMBRA DE FRUTAS',
|
||||||
|
'SIEMBRA DE HORTALIZAS ',
|
||||||
|
'SIEMBRA DE TOMATE ',
|
||||||
|
'SIEMBRA DE CACAO',
|
||||||
|
'SIEMBRA DE PIMENTON ',
|
||||||
|
'SIEMBRA DE YUCA ',
|
||||||
|
'SIEMBRA DE CAÑA DE AZUCAR ',
|
||||||
|
'SIEMBRA DE GRANOS (CARAOTAS, FRIJOLES)',
|
||||||
|
'SIEMBRA DE ARROZ',
|
||||||
|
'SIEMBRA DE CEREALES (CEBADA, LINAZA, SOYA)',
|
||||||
|
'ELABORACION DE BIO-INSUMO (ABONO ORGANICO) ',
|
||||||
|
'BOVINO ',
|
||||||
|
'PORCINO',
|
||||||
|
'CAPRINO',
|
||||||
|
'CUNICULTURA',
|
||||||
|
'AVICOLA',
|
||||||
|
'PISCICULA',
|
||||||
|
'SIEMBRA Y CRIA ',
|
||||||
|
'ELABORACION DE PRODUCTOS QUIMICOS (LIMPIEZA E HIGIENE PERSONAL)',
|
||||||
|
'PANADERIAS',
|
||||||
|
'RESPOSTERIA ',
|
||||||
|
'ELABORACION DE HARINAS PRECOCIDA ',
|
||||||
|
'PLANTA ABA (ELABORACION DE ALIMENTOS BALANCEADOS PARA ANIMALES)',
|
||||||
|
'ELABORACION DE PRODUCTOS DERIVADO DE LA LECHE (VACA, CABRA, BUFFALA)',
|
||||||
|
'EMPAQUETADORAS DE GRANOS Y POLVOS ',
|
||||||
|
'ELABORACION DE ACEITE COMESTIBLE ',
|
||||||
|
'FABRICA DE HIELO',
|
||||||
|
'ELABORACION DE PAPELON',
|
||||||
|
'ARTESANIAS',
|
||||||
|
'ELABORACION DE UNIFORME ESCOLARES Y PRENDA DE VESTIR ',
|
||||||
|
'ELABORACION DE PRENDAS INTIMAS ',
|
||||||
|
'ELABORACION DE LENCERIA ',
|
||||||
|
'SUBLIMACION DE TEJIDOS ',
|
||||||
|
'ELABORACION DE CALZADOS ',
|
||||||
|
'BLOQUERAS ',
|
||||||
|
'PLANTA PREMEZCLADORA DE CEMENTO',
|
||||||
|
'CARPINTERIAS',
|
||||||
|
'HERRERIAS',
|
||||||
|
'MERCADOS COMUNALES',
|
||||||
|
'CENTROS DE ACOPIOS Y DISTRIBUCION',
|
||||||
|
'UNIDAD DE SUMINISTRO',
|
||||||
|
'MATADERO (SALA DE MATANZA DE ANIMALES)',
|
||||||
|
'PELUQUERIA',
|
||||||
|
'BARBERIA',
|
||||||
|
'AGENCIAS DE FESTEJOS',
|
||||||
|
'LAVANDERIAS',
|
||||||
|
'REPARACION DE CALZADOS',
|
||||||
|
'TALLER DE MECANICA',
|
||||||
|
'TRANSPORTES',
|
||||||
|
'RUTAS TURISTICAS',
|
||||||
|
'POSADAS',
|
||||||
|
'HOTELES',
|
||||||
|
'AGENCIAS DE VIAJES',
|
||||||
|
'VENTA DE VIVERES',
|
||||||
|
'VENTAS DE PRENDAS DE VESTIR',
|
||||||
|
'VENTA DE PRODUCTOS QUIMICOS Y DERIVADOS',
|
||||||
|
'BODEGAS COMUNALES',
|
||||||
|
'FRIGORIFICOS Y CARNICOS'
|
||||||
|
]
|
||||||
|
|
||||||
const OSP_TYPES = ['EPSIC', 'EPSDC', 'UPF', 'OTROS', 'COOPERATIVA'];
|
const OSP_TYPES = ['EPSIC', 'EPSDC', 'UPF', 'OTROS', 'COOPERATIVA'];
|
||||||
const STATUS_OPTIONS = ['ACTIVA', 'INACTIVA'];
|
const STATUS_OPTIONS = ['ACTIVA', 'INACTIVA'];
|
||||||
@@ -77,71 +168,72 @@ export function CreateTrainingForm({
|
|||||||
|
|
||||||
const isSaving = isCreating || isUpdating;
|
const isSaving = isCreating || isUpdating;
|
||||||
|
|
||||||
const [state, setState] = React.useState(0);
|
// const [state, setState] = React.useState(0);
|
||||||
const [municipality, setMunicipality] = React.useState(0);
|
// const [municipality, setMunicipality] = React.useState(0);
|
||||||
const [disabledMunicipality, setDisabledMunicipality] = React.useState(true);
|
// const [disabledMunicipality, setDisabledMunicipality] = React.useState(true);
|
||||||
const [disabledParish, setDisabledParish] = React.useState(true);
|
// const [disabledParish, setDisabledParish] = React.useState(true);
|
||||||
|
|
||||||
const [coor_state, setCoor_state] = React.useState(0);
|
const [coorState, setcoorState] = React.useState(0);
|
||||||
const [coor_municipality, setCoor_municipality] = React.useState(0);
|
const [coorMunicipality, setcoorMunicipality] = React.useState(0);
|
||||||
const [disabledCoorMunicipality, setDisabledCoorMunicipality] = React.useState(true);
|
const [disabledCoorMunicipality, setDisabledCoorMunicipality] = React.useState(true);
|
||||||
const [disabledCoorParish, setDisabledCoorParish] = React.useState(true);
|
const [disabledCoorParish, setDisabledCoorParish] = React.useState(true);
|
||||||
|
|
||||||
const [selectedFiles, setSelectedFiles] = React.useState<File[]>([]);
|
const [selectedFiles, setSelectedFiles] = React.useState<File[]>([]);
|
||||||
|
|
||||||
const { data: dataState } = useStateQuery();
|
// const { data: dataState } = useStateQuery();
|
||||||
const { data: dataMunicipality } = useMunicipalityQuery(state);
|
// const { data: dataMunicipality } = useMunicipalityQuery(state);
|
||||||
const { data: dataParish } = useParishQuery(municipality);
|
// const { data: dataParish } = useParishQuery(municipality);
|
||||||
|
|
||||||
const { data: dataCoorState } = useStateQuery();
|
const { data: dataCoorState } = useStateQuery();
|
||||||
const { data: dataCoorMunicipality } = useMunicipalityQuery(coor_state);
|
const { data: dataCoorMunicipality } = useMunicipalityQuery(coorState);
|
||||||
const { data: dataCoorParish } = useParishQuery(coor_municipality);
|
const { data: dataCoorParish } = useParishQuery(coorMunicipality);
|
||||||
|
|
||||||
|
|
||||||
const coor_stateOptions = dataCoorState?.data || [{ id: 0, name: 'Sin estados' }];
|
const coorStateOptions = dataCoorState?.data || [{ id: 0, name: 'Sin estados' }];
|
||||||
|
|
||||||
const coor_municipalityOptions =
|
const coorMunicipalityOptions =
|
||||||
Array.isArray(dataCoorMunicipality?.data) && dataCoorMunicipality.data.length > 0
|
Array.isArray(dataCoorMunicipality?.data) && dataCoorMunicipality.data.length > 0
|
||||||
? dataCoorMunicipality.data
|
? dataCoorMunicipality.data
|
||||||
: [{ id: 0, stateId: 0, name: 'Sin Municipios' }];
|
: [{ id: 0, stateId: 0, name: 'Sin Municipios' }];
|
||||||
|
|
||||||
const coor_parishOptions =
|
const coorParishOptions =
|
||||||
Array.isArray(dataCoorParish?.data) && dataCoorParish.data.length > 0
|
Array.isArray(dataCoorParish?.data) && dataCoorParish.data.length > 0
|
||||||
? dataCoorParish.data
|
? dataCoorParish.data
|
||||||
: [{ id: 0, stateId: 0, name: 'Sin Parroquias' }];
|
: [{ id: 0, stateId: 0, name: 'Sin Parroquias' }];
|
||||||
|
|
||||||
|
|
||||||
const stateOptions = dataState?.data || [{ id: 0, name: 'Sin estados' }];
|
// const stateOptions = dataState?.data || [{ id: 0, name: 'Sin estados' }];
|
||||||
|
|
||||||
const municipalityOptions =
|
// const municipalityOptions =
|
||||||
Array.isArray(dataMunicipality?.data) && dataMunicipality.data.length > 0
|
// Array.isArray(dataMunicipality?.data) && dataMunicipality.data.length > 0
|
||||||
? dataMunicipality.data
|
// ? dataMunicipality.data
|
||||||
: [{ id: 0, stateId: 0, name: 'Sin Municipios' }];
|
// : [{ id: 0, stateId: 0, name: 'Sin Municipios' }];
|
||||||
|
|
||||||
const parishOptions =
|
// const parishOptions =
|
||||||
Array.isArray(dataParish?.data) && dataParish.data.length > 0
|
// Array.isArray(dataParish?.data) && dataParish.data.length > 0
|
||||||
? dataParish.data
|
// ? dataParish.data
|
||||||
: [{ id: 0, stateId: 0, name: 'Sin Parroquias' }];
|
// : [{ id: 0, stateId: 0, name: 'Sin Parroquias' }];
|
||||||
|
|
||||||
// No local state needed for existing photos, we use form values
|
// No local state needed for existing photos, we use form values
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (defaultValues) {
|
if (defaultValues) {
|
||||||
if (defaultValues.state) {
|
// if (defaultValues.state) {
|
||||||
setState(Number(defaultValues.state));
|
// setState(Number(defaultValues.state));
|
||||||
setDisabledMunicipality(false);
|
// setDisabledMunicipality(false);
|
||||||
}
|
// }
|
||||||
if (defaultValues.municipality) {
|
// if (defaultValues.municipality) {
|
||||||
setMunicipality(Number(defaultValues.municipality));
|
// setMunicipality(Number(defaultValues.municipality));
|
||||||
setDisabledParish(false);
|
// setDisabledParish(false);
|
||||||
}
|
// }
|
||||||
if (defaultValues.coor_state) {
|
|
||||||
setCoor_state(Number(defaultValues.coor_state));
|
if (defaultValues.coorState) {
|
||||||
|
setcoorState(Number(defaultValues.coorState));
|
||||||
setDisabledCoorMunicipality(false);
|
setDisabledCoorMunicipality(false);
|
||||||
}
|
}
|
||||||
if (defaultValues.coor_municipality) {
|
if (defaultValues.coorMunicipality) {
|
||||||
setCoor_municipality(Number(defaultValues.coor_municipality));
|
setcoorMunicipality(Number(defaultValues.coorMunicipality));
|
||||||
setDisabledParish(false);
|
setDisabledCoorParish(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [defaultValues]);
|
}, [defaultValues]);
|
||||||
@@ -161,18 +253,44 @@ export function CreateTrainingForm({
|
|||||||
defaultValues: {
|
defaultValues: {
|
||||||
firstname: defaultValues?.firstname || '',
|
firstname: defaultValues?.firstname || '',
|
||||||
lastname: defaultValues?.lastname || '',
|
lastname: defaultValues?.lastname || '',
|
||||||
coor_state: defaultValues?.coor_state || undefined,
|
coorState: defaultValues?.coorState || undefined,
|
||||||
coor_municipality: defaultValues?.coor_municipality || undefined,
|
coorMunicipality: defaultValues?.coorMunicipality || undefined,
|
||||||
coor_parish: defaultValues?.coor_parish || undefined,
|
coorParish: defaultValues?.coorParish || undefined,
|
||||||
coor_phone: defaultValues?.coor_phone || '',
|
coorPhone: defaultValues?.coorPhone || '',
|
||||||
visitDate: formatToLocalISO(defaultValues?.visitDate),
|
visitDate: formatToLocalISO(defaultValues?.visitDate),
|
||||||
productiveActivity: defaultValues?.productiveActivity || '',
|
productiveActivity: defaultValues?.productiveActivity || '',
|
||||||
ecoSector: defaultValues?.ecoSector || '',
|
ecoSector: defaultValues?.ecoSector || undefined,
|
||||||
|
productiveSector: defaultValues?.productiveSector || undefined,
|
||||||
|
centralProductiveActivity: defaultValues?.centralProductiveActivity || '',
|
||||||
|
mainProductiveActivity: defaultValues?.mainProductiveActivity || '',
|
||||||
|
typesOfEquipment: defaultValues?.typesOfEquipment || '',
|
||||||
|
equipmentCount: defaultValues?.equipmentCount || 0,
|
||||||
|
equipmentDescription: defaultValues?.equipmentDescription || '',
|
||||||
|
rawMaterial: defaultValues?.rawMaterial || '',
|
||||||
|
materialType: defaultValues?.materialType || '',
|
||||||
|
rawMaterialCount: defaultValues?.rawMaterialCount || 0,
|
||||||
|
productCountDaily: defaultValues?.productCountDaily || 0,
|
||||||
|
productCountWeekly: defaultValues?.productCountWeekly || 0,
|
||||||
|
productCountMonthly: defaultValues?.productCountMonthly || 0,
|
||||||
financialRequirementDescription:
|
financialRequirementDescription:
|
||||||
defaultValues?.financialRequirementDescription || '',
|
defaultValues?.financialRequirementDescription || '',
|
||||||
siturCodeCommune: defaultValues?.siturCodeCommune || '',
|
siturCodeCommune: defaultValues?.siturCodeCommune || '',
|
||||||
|
communeName: defaultValues?.communeName || '',
|
||||||
|
communeRif: defaultValues?.communeRif || '',
|
||||||
|
communeSpokespersonName: defaultValues?.communeSpokespersonName || '',
|
||||||
|
communeSpokespersonCedula: defaultValues?.communeSpokespersonCedula || '',
|
||||||
|
communeSpokespersonRif: defaultValues?.communeSpokespersonRif || '',
|
||||||
|
communeSpokespersonPhone: defaultValues?.communeSpokespersonPhone || '',
|
||||||
|
communeEmail: defaultValues?.communeEmail || '',
|
||||||
communalCouncil: defaultValues?.communalCouncil || '',
|
communalCouncil: defaultValues?.communalCouncil || '',
|
||||||
siturCodeCommunalCouncil: defaultValues?.siturCodeCommunalCouncil || '',
|
siturCodeCommunalCouncil: defaultValues?.siturCodeCommunalCouncil || '',
|
||||||
|
communalCouncilRif: defaultValues?.communalCouncilRif || '',
|
||||||
|
communalCouncilSpokespersonName: defaultValues?.communalCouncilSpokespersonName || '',
|
||||||
|
communalCouncilSpokespersonCedula: defaultValues?.communalCouncilSpokespersonCedula || '',
|
||||||
|
communalCouncilSpokespersonRif: defaultValues?.communalCouncilSpokespersonRif || '',
|
||||||
|
communalCouncilSpokespersonPhone: defaultValues?.communalCouncilSpokespersonPhone || '',
|
||||||
|
communalCouncilEmail: defaultValues?.communalCouncilEmail || '',
|
||||||
|
ospGoogleMapsLink: defaultValues?.ospGoogleMapsLink || '',
|
||||||
ospName: defaultValues?.ospName || '',
|
ospName: defaultValues?.ospName || '',
|
||||||
ospAddress: defaultValues?.ospAddress || '',
|
ospAddress: defaultValues?.ospAddress || '',
|
||||||
ospRif: defaultValues?.ospRif || '',
|
ospRif: defaultValues?.ospRif || '',
|
||||||
@@ -198,9 +316,9 @@ export function CreateTrainingForm({
|
|||||||
photo2: defaultValues?.photo2 || '',
|
photo2: defaultValues?.photo2 || '',
|
||||||
photo3: defaultValues?.photo3 || '',
|
photo3: defaultValues?.photo3 || '',
|
||||||
paralysisReason: defaultValues?.paralysisReason || '',
|
paralysisReason: defaultValues?.paralysisReason || '',
|
||||||
state: defaultValues?.state || undefined,
|
// state: defaultValues?.state || undefined,
|
||||||
municipality: defaultValues?.municipality || undefined,
|
// municipality: defaultValues?.municipality || undefined,
|
||||||
parish: defaultValues?.parish || undefined,
|
// parish: defaultValues?.parish || undefined
|
||||||
},
|
},
|
||||||
mode: 'onChange',
|
mode: 'onChange',
|
||||||
});
|
});
|
||||||
@@ -296,7 +414,7 @@ export function CreateTrainingForm({
|
|||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="coor_phone"
|
name="coorPhone"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Telefono del coordinador Estadal</FormLabel>
|
<FormLabel>Telefono del coordinador Estadal</FormLabel>
|
||||||
@@ -310,18 +428,18 @@ export function CreateTrainingForm({
|
|||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="coor_state"
|
name="coorState"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Estado</FormLabel>
|
<FormLabel>Estado</FormLabel>
|
||||||
<SelectSearchable
|
<SelectSearchable
|
||||||
options={stateOptions.map((item) => ({
|
options={coorStateOptions.map((item) => ({
|
||||||
value: item.id.toString(),
|
value: item.id.toString(),
|
||||||
label: item.name,
|
label: item.name,
|
||||||
}))}
|
}))}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
field.onChange(Number(value));
|
field.onChange(Number(value));
|
||||||
setCoor_state(Number(value));
|
setcoorState(Number(value));
|
||||||
setDisabledCoorMunicipality(false);
|
setDisabledCoorMunicipality(false);
|
||||||
setDisabledCoorParish(true);
|
setDisabledCoorParish(true);
|
||||||
}}
|
}}
|
||||||
@@ -335,18 +453,18 @@ export function CreateTrainingForm({
|
|||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="coor_municipality"
|
name="coorMunicipality"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Municipio</FormLabel>
|
<FormLabel>Municipio</FormLabel>
|
||||||
<SelectSearchable
|
<SelectSearchable
|
||||||
options={municipalityOptions.map((item) => ({
|
options={coorMunicipalityOptions.map((item) => ({
|
||||||
value: item.id.toString(),
|
value: item.id.toString(),
|
||||||
label: item.name,
|
label: item.name,
|
||||||
}))}
|
}))}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
field.onChange(Number(value));
|
field.onChange(Number(value));
|
||||||
setCoor_municipality(Number(value));
|
setcoorMunicipality(Number(value));
|
||||||
setDisabledCoorParish(false);
|
setDisabledCoorParish(false);
|
||||||
}}
|
}}
|
||||||
placeholder="Selecciona un municipio"
|
placeholder="Selecciona un municipio"
|
||||||
@@ -360,12 +478,12 @@ export function CreateTrainingForm({
|
|||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="coor_parish"
|
name="coorParish"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Parroquia</FormLabel>
|
<FormLabel>Parroquia</FormLabel>
|
||||||
<SelectSearchable
|
<SelectSearchable
|
||||||
options={parishOptions.map((item) => ({
|
options={coorParishOptions.map((item) => ({
|
||||||
value: item.id.toString(),
|
value: item.id.toString(),
|
||||||
label: item.name,
|
label: item.name,
|
||||||
}))}
|
}))}
|
||||||
@@ -463,12 +581,96 @@ export function CreateTrainingForm({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="productiveSector"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Sector Productivo</FormLabel>
|
||||||
|
<Select
|
||||||
|
onValueChange={field.onChange}
|
||||||
|
defaultValue={field.value}
|
||||||
|
>
|
||||||
|
<FormControl>
|
||||||
|
<SelectTrigger className="w-full">
|
||||||
|
<SelectValue placeholder="Seleccione tipo" />
|
||||||
|
</SelectTrigger>
|
||||||
|
</FormControl>
|
||||||
|
<SelectContent>
|
||||||
|
{PRODUCTIVE_SECTORS.map((type) => (
|
||||||
|
<SelectItem key={type} value={type}>
|
||||||
|
{type}
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="centralProductiveActivity"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Actividad Central Productivo</FormLabel>
|
||||||
|
<Select
|
||||||
|
onValueChange={field.onChange}
|
||||||
|
defaultValue={field.value}
|
||||||
|
>
|
||||||
|
<FormControl>
|
||||||
|
<SelectTrigger className="w-full">
|
||||||
|
<SelectValue placeholder="Seleccione tipo" />
|
||||||
|
</SelectTrigger>
|
||||||
|
</FormControl>
|
||||||
|
<SelectContent>
|
||||||
|
{CENTRAL_PRODUCTIVE_ACTIVITY.map((type) => (
|
||||||
|
<SelectItem key={type} value={type}>
|
||||||
|
{type}
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="mainProductiveActivity"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Actividad Productiva</FormLabel>
|
||||||
|
<Select
|
||||||
|
onValueChange={field.onChange}
|
||||||
|
defaultValue={field.value}
|
||||||
|
>
|
||||||
|
<FormControl>
|
||||||
|
<SelectTrigger className="w-full">
|
||||||
|
<SelectValue placeholder="Seleccione tipo" />
|
||||||
|
</SelectTrigger>
|
||||||
|
</FormControl>
|
||||||
|
<SelectContent>
|
||||||
|
{PRODUCTIVE_ACTIVITIES.map((type) => (
|
||||||
|
<SelectItem key={type} value={type}>
|
||||||
|
{type}
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="ospRif"
|
name="ospRif"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>RIF de la OSP</FormLabel>
|
<FormLabel>RIF de la Organización</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} placeholder="J-12345678-9" />
|
<Input {...field} placeholder="J-12345678-9" />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -491,7 +693,7 @@ export function CreateTrainingForm({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FormField
|
{/* <FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="productiveActivity"
|
name="productiveActivity"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
@@ -517,8 +719,162 @@ export function CreateTrainingForm({
|
|||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
|
/> */}
|
||||||
|
|
||||||
|
{/* Tipo de equipamiento */}
|
||||||
|
<hr className="col-span-2" />
|
||||||
|
<h3 className="text-lg font-semibold col-span-2">Tipo de equipamiento:</h3>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="typesOfEquipment"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Maquinarias</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="equipmentCount"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Cantidad</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="number" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="equipmentDescription"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="col-span-2">
|
||||||
|
<FormLabel>Descripción</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Textarea {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<hr className="col-span-2" />
|
||||||
|
|
||||||
|
{/* Productos Terminados */}
|
||||||
|
<h3 className="text-lg font-semibold col-span-2">Datos de Producción de la Organización Socio Productivo:</h3>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="rawMaterial"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Materia prima requerida (mensual)</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="materialType"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Tipo de Insumo/Rubro</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="rawMaterialCount"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Cantidad</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="number" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<hr className="col-span-2" />
|
||||||
|
|
||||||
|
{/* Productos Terminados */}
|
||||||
|
<h3 className="text-lg font-semibold col-span-2">Productos Terminados</h3>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="productDescription"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="col-span-2">
|
||||||
|
<FormLabel>Descripción del producto</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Textarea {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="productCountDaily"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Diario</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="number" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="productCountWeekly"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Semanal</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="number" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="productCountMonthly"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Mensual</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="number" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<hr className="col-span-2" />
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="companyConstitutionYear"
|
name="companyConstitutionYear"
|
||||||
@@ -659,24 +1015,13 @@ export function CreateTrainingForm({
|
|||||||
<CardContent className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<CardContent className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="state"
|
name="ospAddress"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem className="col-span-2">
|
||||||
<FormLabel>Estado</FormLabel>
|
<FormLabel>Dirección de la Organización Socio Productivo</FormLabel>
|
||||||
<SelectSearchable
|
<FormControl>
|
||||||
options={stateOptions.map((item) => ({
|
<Textarea {...field} />
|
||||||
value: item.id.toString(),
|
</FormControl>
|
||||||
label: item.name,
|
|
||||||
}))}
|
|
||||||
onValueChange={(value) => {
|
|
||||||
field.onChange(Number(value));
|
|
||||||
setState(Number(value));
|
|
||||||
setDisabledMunicipality(false);
|
|
||||||
setDisabledParish(true);
|
|
||||||
}}
|
|
||||||
placeholder="Selecciona un estado"
|
|
||||||
defaultValue={field.value?.toString()}
|
|
||||||
/>
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
@@ -684,45 +1029,31 @@ export function CreateTrainingForm({
|
|||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="municipality"
|
name="ospGoogleMapsLink"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem className="col-span-2">
|
||||||
<FormLabel>Municipio</FormLabel>
|
<FormLabel>Dirección Link Google Maps</FormLabel>
|
||||||
<SelectSearchable
|
<FormControl>
|
||||||
options={municipalityOptions.map((item) => ({
|
<Input {...field} placeholder="https://maps.google.com/..." />
|
||||||
value: item.id.toString(),
|
</FormControl>
|
||||||
label: item.name,
|
|
||||||
}))}
|
|
||||||
onValueChange={(value) => {
|
|
||||||
field.onChange(Number(value));
|
|
||||||
setMunicipality(Number(value));
|
|
||||||
setDisabledParish(false);
|
|
||||||
}}
|
|
||||||
placeholder="Selecciona un municipio"
|
|
||||||
disabled={disabledMunicipality}
|
|
||||||
defaultValue={field.value?.toString()}
|
|
||||||
/>
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div className="col-span-2">
|
||||||
|
<h4 className="font-semibold mb-2">Datos de la Comuna</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="parish"
|
name="communeName"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Parroquia</FormLabel>
|
<FormLabel>Nombre de la Comuna</FormLabel>
|
||||||
<SelectSearchable
|
<FormControl>
|
||||||
options={parishOptions.map((item) => ({
|
<Input {...field} />
|
||||||
value: item.id.toString(),
|
</FormControl>
|
||||||
label: item.name,
|
|
||||||
}))}
|
|
||||||
onValueChange={(value) => field.onChange(Number(value))}
|
|
||||||
placeholder="Selecciona una parroquia"
|
|
||||||
disabled={disabledParish}
|
|
||||||
defaultValue={field.value?.toString()}
|
|
||||||
/>
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
@@ -733,7 +1064,109 @@ export function CreateTrainingForm({
|
|||||||
name="siturCodeCommune"
|
name="siturCodeCommune"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Código SITUR Comuna</FormLabel>
|
<FormLabel>Código SITUR de la Comuna</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communeRif"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Rif de la Comuna</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communeSpokespersonName"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Nombre del Vocero o Vocera</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communeSpokespersonCedula"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Cédula de Identidad del Vocero</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communeSpokespersonRif"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>RIF del Vocero</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communeSpokespersonPhone"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Número de Teléfono del Vocero</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communeEmail"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Correo Electrónico de la Comuna</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="email" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className="col-span-2">
|
||||||
|
<h4 className="font-semibold mb-2">Datos del Consejo Comunal</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communalCouncil"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Nombre del Consejo Comunal</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} />
|
<Input {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -747,7 +1180,7 @@ export function CreateTrainingForm({
|
|||||||
name="siturCodeCommunalCouncil"
|
name="siturCodeCommunalCouncil"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Código SITUR Consejo Comunal</FormLabel>
|
<FormLabel>Código SITUR del Consejo Comunal</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} />
|
<Input {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -758,10 +1191,10 @@ export function CreateTrainingForm({
|
|||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="communalCouncil"
|
name="communalCouncilRif"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Consejo Comunal</FormLabel>
|
<FormLabel>Rif del Consejo Comunal</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} />
|
<Input {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -772,12 +1205,68 @@ export function CreateTrainingForm({
|
|||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="ospAddress"
|
name="communalCouncilSpokespersonName"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem className="col-span-2">
|
<FormItem>
|
||||||
<FormLabel>Dirección</FormLabel>
|
<FormLabel>Nombre del Vocero o Vocera</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Textarea {...field} />
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communalCouncilSpokespersonCedula"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Cédula de Identidad del Vocero</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communalCouncilSpokespersonRif"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>RIF del Vocero</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communalCouncilSpokespersonPhone"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Número de Teléfono del Vocero</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="communalCouncilEmail"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Correo Electrónico del Consejo Comunal</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input type="email" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|||||||
@@ -16,12 +16,52 @@ export const trainingSchema = z.object({
|
|||||||
siturCodeCommune: z
|
siturCodeCommune: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, { message: 'Código SITUR Comuna es requerido' }),
|
.min(1, { message: 'Código SITUR Comuna es requerido' }),
|
||||||
|
communeName: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'Nombre de la Comuna es requerido' }),
|
||||||
|
communeRif: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'RIF de la Comuna es requerido' }),
|
||||||
|
communeSpokespersonName: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'Nombre del Vocero de la Comuna es requerido' }),
|
||||||
|
communeSpokespersonCedula: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'Cédula del Vocero de la Comuna es requerida' }),
|
||||||
|
communeSpokespersonRif: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'RIF del Vocero de la Comuna es requerido' }),
|
||||||
|
communeSpokespersonPhone: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'Teléfono del Vocero de la Comuna es requerido' }),
|
||||||
|
communeEmail: z.string().email({ message: 'Correo electrónico de la Comuna inválido' }),
|
||||||
communalCouncil: z
|
communalCouncil: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, { message: 'Consejo Comunal es requerido' }),
|
.min(1, { message: 'Consejo Comunal es requerido' }),
|
||||||
siturCodeCommunalCouncil: z
|
siturCodeCommunalCouncil: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, { message: 'Código SITUR Consejo Comunal es requerido' }),
|
.min(1, { message: 'Código SITUR Consejo Comunal es requerido' }),
|
||||||
|
communalCouncilRif: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'RIF del Consejo Comunal es requerido' }),
|
||||||
|
communalCouncilSpokespersonName: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'Nombre del Vocero del Consejo Comunal es requerido' }),
|
||||||
|
communalCouncilSpokespersonCedula: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'Cédula del Vocero del Consejo Comunal es requerida' }),
|
||||||
|
communalCouncilSpokespersonRif: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'RIF del Vocero del Consejo Comunal es requerido' }),
|
||||||
|
communalCouncilSpokespersonPhone: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'Teléfono del Vocero del Consejo Comunal es requerido' }),
|
||||||
|
communalCouncilEmail: z
|
||||||
|
.string()
|
||||||
|
.email({ message: 'Correo electrónico del Consejo Comunal inválido' }),
|
||||||
|
ospGoogleMapsLink: z
|
||||||
|
.string()
|
||||||
|
.min(1, { message: 'Enlace de Google Maps es requerido' }),
|
||||||
ospName: z.string().min(1, { message: 'Nombre de la OSP es requerido' }),
|
ospName: z.string().min(1, { message: 'Nombre de la OSP es requerido' }),
|
||||||
ospAddress: z
|
ospAddress: z
|
||||||
.string()
|
.string()
|
||||||
@@ -79,15 +119,27 @@ export const trainingSchema = z.object({
|
|||||||
photo3: z.string().optional().nullable(),
|
photo3: z.string().optional().nullable(),
|
||||||
files: z.any().optional(),
|
files: z.any().optional(),
|
||||||
paralysisReason: z.string().optional().default(''),
|
paralysisReason: z.string().optional().default(''),
|
||||||
state: z.number().optional().nullable(),
|
// state: z.number().optional().nullable(),
|
||||||
municipality: z.number().optional().nullable(),
|
// municipality: z.number().optional().nullable(),
|
||||||
parish: z.number().optional().nullable(),
|
// parish: z.number().optional().nullable(),
|
||||||
coor_state: z.number().optional().nullable(),
|
coorState: z.number().optional().nullable(),
|
||||||
coor_municipality: z.number().optional().nullable(),
|
coorMunicipality: z.number().optional().nullable(),
|
||||||
coor_parish: z.number().optional().nullable(),
|
coorParish: z.number().optional().nullable(),
|
||||||
coor_phone: z.string().optional().nullable(),
|
coorPhone: z.string().optional().nullable(),
|
||||||
ecoSector: z.string().min(1, { message: 'Sector económico es requerido' })
|
ecoSector: z.string().min(1, { message: 'Sector económico es requerido' }),
|
||||||
// mainProductiveActivity: z.string().optional().nullable(),
|
productiveSector: z.string().min(1, { message: 'Sector productivo es requerido' }),
|
||||||
|
centralProductiveActivity: z.string().min(1, { message: 'Actividad productiva central es requerida' }),
|
||||||
|
mainProductiveActivity: z.string().min(1, { message: 'Actividad productiva principal es requerida' }),
|
||||||
|
typesOfEquipment: z.string().min(1, { message: 'Tipo de equipo es requerido' }),
|
||||||
|
equipmentCount: z.coerce.number().min(0, { message: 'Cantidad de equipo requerida' }),
|
||||||
|
equipmentDescription: z.string().min(1, { message: 'Descripción del equipo es requerida' }),
|
||||||
|
rawMaterial: z.string().min(1, { message: 'Material bruto es requerido' }),
|
||||||
|
materialType: z.string().min(1, { message: 'Tipo de material es requerido' }),
|
||||||
|
rawMaterialCount: z.coerce.number().min(0, { message: 'Cantidad de material bruto requerida' }),
|
||||||
|
productCountDaily: z.coerce.number().min(0, { message: 'Cantidad diaria de productos requerida' }),
|
||||||
|
productCountWeekly: z.coerce.number().min(0, { message: 'Cantidad semanal de productos requerida' }),
|
||||||
|
productCountMonthly: z.coerce.number().min(0, { message: 'Cantidad mensual de productos requerida' }),
|
||||||
|
// productCountYearly: z.number().min(0, { message: 'Cantidad anual de productos requerida' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type TrainingSchema = z.infer<typeof trainingSchema>;
|
export type TrainingSchema = z.infer<typeof trainingSchema>;
|
||||||
|
|||||||
Reference in New Issue
Block a user