agregado los campos de distribucion (interna y externa)

This commit is contained in:
2026-01-28 15:54:26 -04:00
parent 69843e9e68
commit d2908f1e4c
8 changed files with 2770 additions and 112 deletions

View File

@@ -0,0 +1,9 @@
ALTER TABLE "training_surveys" ALTER COLUMN "financial_requirement_description" SET DEFAULT '';--> statement-breakpoint
ALTER TABLE "training_surveys" ADD COLUMN "prod_description_internal" text DEFAULT '' NOT NULL;--> statement-breakpoint
ALTER TABLE "training_surveys" ADD COLUMN "internal_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
ALTER TABLE "training_surveys" ADD COLUMN "external_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
ALTER TABLE "training_surveys" ADD COLUMN "prod_description_external" text DEFAULT '' NOT NULL;--> statement-breakpoint
ALTER TABLE "training_surveys" ADD COLUMN "country" text DEFAULT '' NOT NULL;--> statement-breakpoint
ALTER TABLE "training_surveys" ADD COLUMN "city" text DEFAULT '' NOT NULL;--> statement-breakpoint
ALTER TABLE "training_surveys" ADD COLUMN "men_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
ALTER TABLE "training_surveys" ADD COLUMN "women_count" integer DEFAULT 0 NOT NULL;

File diff suppressed because it is too large Load Diff

View File

@@ -92,6 +92,13 @@
"when": 1769621656400,
"tag": "0012_sudden_venus",
"breakpoints": true
},
{
"idx": 13,
"version": "7",
"when": 1769629815868,
"tag": "0013_cuddly_night_nurse",
"breakpoints": true
}
]
}

View File

@@ -86,7 +86,8 @@ export const trainingSurveys = t.pgTable(
productiveActivity: t.text('productive_activity').notNull(),
financialRequirementDescription: t
.text('financial_requirement_description')
.notNull(),
.notNull()
.default(''),
currentStatus: t.text('current_status').notNull().default('ACTIVA'),
companyConstitutionYear: t.integer('company_constitution_year').notNull(),
producerCount: t.integer('producer_count').notNull(),
@@ -138,6 +139,15 @@ export const trainingSurveys = t.pgTable(
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),
// nuevos campos adicionales
prodDescriptionInternal: t.text('prod_description_internal').notNull().default(''),
internalCount: t.integer('internal_count').notNull().default(0),
externalCount: t.integer('external_count').notNull().default(0),
prodDescriptionExternal: t.text('prod_description_external').notNull().default(''),
country: t.text('country').notNull().default(''),
city: t.text('city').notNull().default(''),
menCount: t.integer('men_count').notNull().default(0),
womenCount: t.integer('women_count').notNull().default(0),
...timestamps,
},
(trainingSurveys) => ({

View File

@@ -20,7 +20,8 @@ export class CreateTrainingDto {
@ApiProperty()
@IsString()
financialRequirementDescription: string;
@IsOptional()
financialRequirementDescription?: string;
@ApiProperty()
@IsInt()
@@ -282,4 +283,36 @@ export class CreateTrainingDto {
@ApiProperty()
@IsInt()
productCountMonthly: number;
@ApiProperty()
@IsString()
prodDescriptionInternal: string;
@ApiProperty()
@IsInt()
internalCount: number;
@ApiProperty()
@IsInt()
externalCount: number;
@ApiProperty()
@IsString()
prodDescriptionExternal: string;
@ApiProperty()
@IsString()
country: string;
@ApiProperty()
@IsString()
city: string;
@ApiProperty()
@IsInt()
menCount: number;
@ApiProperty()
@IsInt()
womenCount: number;
}