Browse Source

✏️ fix(contracts): 优化续签合同DTO定义

- 移除CreateHetongRenewDto中的id字段,由系统自动生成
- 移除CreateHetongRenewDto中的createdTime字段,由系统自动记录
- 为contractId字段添加coerce.string()转换,确保输入值转为字符串类型
yourname 8 months ago
parent
commit
bc663adfbf
1 changed files with 1 additions and 9 deletions
  1. 1 9
      src/server/modules/contracts/hetong-renew.entity.ts

+ 1 - 9
src/server/modules/contracts/hetong-renew.entity.ts

@@ -113,11 +113,7 @@ export const HetongRenewSchema = z.object({
 });
 });
 
 
 export const CreateHetongRenewDto = z.object({
 export const CreateHetongRenewDto = z.object({
-  id: z.string().max(50).openapi({ 
-    description: '续签记录ID',
-    example: 'HTR20230001' 
-  }),
-  contractId: z.string().max(50).openapi({ 
+  contractId: z.coerce.string().max(50).openapi({ 
     description: '原合同ID',
     description: '原合同ID',
     example: 'HT20230001' 
     example: 'HT20230001' 
   }),
   }),
@@ -156,10 +152,6 @@ export const CreateHetongRenewDto = z.object({
   userId: z.string().max(50).nullable().optional().openapi({ 
   userId: z.string().max(50).nullable().optional().openapi({ 
     description: '处理用户ID',
     description: '处理用户ID',
     example: 'U1001' 
     example: 'U1001' 
-  }),
-  createdTime: z.coerce.date().openapi({ 
-    description: '记录创建时间',
-    example: '2024-01-10T09:00:00Z' 
   })
   })
 });
 });