Algunos campos agregados/eliminados

This commit is contained in:
2026-01-28 13:50:10 -04:00
parent 5c080c6d32
commit 69843e9e68
10 changed files with 4955 additions and 138 deletions

View 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;

View 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;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -78,6 +78,20 @@
"when": 1769097895095,
"tag": "0010_dashing_bishop",
"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
}
]
}

View File

@@ -62,8 +62,22 @@ export const trainingSurveys = t.pgTable(
.integer('parish')
.references(() => parishes.id, { onDelete: 'set null' }),
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(),
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)
ospName: t.text('osp_name').notNull(),
ospAddress: t.text('osp_address').notNull(),
@@ -96,6 +110,34 @@ export const trainingSurveys = t.pgTable(
photo1: t.text('photo1').notNull(),
photo2: t.text('photo2'),
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,
},
(trainingSurveys) => ({

View File

@@ -24,20 +24,51 @@ export class CreateTrainingDto {
@ApiProperty()
@IsInt()
@IsOptional()
state: number;
@ApiProperty()
@IsInt()
@IsOptional()
municipality: number;
@ApiProperty()
@IsInt()
@IsOptional()
parish: number;
@ApiProperty()
@IsString()
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()
@IsString()
communalCouncil: string;
@@ -46,6 +77,34 @@ export class CreateTrainingDto {
@IsString()
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()
@IsString()
ospName: string;
@@ -146,4 +205,81 @@ export class CreateTrainingDto {
@IsString()
@IsOptional()
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;
}