correciones al formulario osp
This commit is contained in:
@@ -1,23 +1,27 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const statisticsItemSchema = z.object({
|
||||
name: z.string(),
|
||||
value: z.number(),
|
||||
name: z
|
||||
.string()
|
||||
.nullable()
|
||||
.transform((val) => val || 'Sin Información'),
|
||||
value: z.number(),
|
||||
});
|
||||
|
||||
export const trainingStatisticsSchema = z.object({
|
||||
totalOsps: z.number(),
|
||||
totalProducers: z.number(),
|
||||
statusDistribution: z.array(statisticsItemSchema),
|
||||
activityDistribution: z.array(statisticsItemSchema),
|
||||
typeDistribution: z.array(statisticsItemSchema),
|
||||
stateDistribution: z.array(statisticsItemSchema),
|
||||
yearDistribution: z.array(statisticsItemSchema),
|
||||
totalOsps: z.number(),
|
||||
totalProducers: z.number(),
|
||||
totalProducts: z.number(),
|
||||
statusDistribution: z.array(statisticsItemSchema),
|
||||
activityDistribution: z.array(statisticsItemSchema),
|
||||
typeDistribution: z.array(statisticsItemSchema),
|
||||
stateDistribution: z.array(statisticsItemSchema),
|
||||
yearDistribution: z.array(statisticsItemSchema),
|
||||
});
|
||||
|
||||
export type TrainingStatisticsData = z.infer<typeof trainingStatisticsSchema>;
|
||||
|
||||
export const trainingStatisticsResponseSchema = z.object({
|
||||
message: z.string(),
|
||||
data: trainingStatisticsSchema,
|
||||
message: z.string(),
|
||||
data: trainingStatisticsSchema,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user