|
@@ -38,6 +38,23 @@ export const updateRouteSchema = z.object({
|
|
|
// 路线获取Schema
|
|
// 路线获取Schema
|
|
|
export const getRouteSchema = z.object({
|
|
export const getRouteSchema = z.object({
|
|
|
id: z.number().int().positive('ID必须为正整数'),
|
|
id: z.number().int().positive('ID必须为正整数'),
|
|
|
|
|
+ name: z.string().min(1, '路线名称不能为空').max(255, '路线名称不能超过255个字符'),
|
|
|
|
|
+ description: z.string().max(1000, '路线描述不能超过1000个字符').optional().nullable(),
|
|
|
|
|
+ startPoint: z.string().min(1, '出发地不能为空').max(255, '出发地不能超过255个字符'),
|
|
|
|
|
+ endPoint: z.string().min(1, '目的地不能为空').max(255, '目的地不能超过255个字符'),
|
|
|
|
|
+ pickupPoint: z.string().min(1, '上车点不能为空').max(255, '上车点不能超过255个字符'),
|
|
|
|
|
+ dropoffPoint: z.string().min(1, '下车点不能为空').max(255, '下车点不能超过255个字符'),
|
|
|
|
|
+ departureTime: z.coerce.date(),
|
|
|
|
|
+ vehicleType: z.string().min(1, '车型不能为空').max(50, '车型不能超过50个字符'),
|
|
|
|
|
+ price: z.coerce.number().min(0, '价格不能为负数').max(99999999.99, '价格不能超过99999999.99'),
|
|
|
|
|
+ seatCount: z.number().int().min(1, '座位数至少为1').max(1000, '座位数不能超过1000'),
|
|
|
|
|
+ availableSeats: z.number().int().min(0, '可用座位数不能为负数').max(1000, '可用座位数不能超过1000'),
|
|
|
|
|
+ activityId: z.number().int().positive('活动ID必须为正整数'),
|
|
|
|
|
+ isDisabled: z.nativeEnum(DisabledStatus),
|
|
|
|
|
+ createdAt: z.coerce.date(),
|
|
|
|
|
+ updatedAt: z.coerce.date(),
|
|
|
|
|
+ createdBy: z.number().int().optional(),
|
|
|
|
|
+ updatedBy: z.number().int().optional(),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 路线列表查询Schema
|
|
// 路线列表查询Schema
|