2
0
Эх сурвалжийг харах

✨ feat(schema): add creator and updater tracking fields to multiple schemas

- add createdBy and updatedBy fields to card schema
- add createdBy and updatedBy fields to goods-category schema
- add createdBy and updatedBy fields to goods schema
- add createdBy and updatedBy fields to express-company schema
- add createdBy and updatedBy fields to organization schema
- add createdBy and updatedBy fields to supplier schema
- add createdBy and updatedBy fields to city schema
- add createdBy and updatedBy fields to config schema
- each field is defined as nullable positive integer with OpenAPI documentation
yourname 4 сар өмнө
parent
commit
4947d2cac2

+ 9 - 1
src/server/modules/card/card.schema.ts

@@ -37,7 +37,15 @@ export const CardSchema = z.object({
   updatedAt: z.coerce.date().openapi({
   updatedAt: z.coerce.date().openapi({
     description: '更新时间',
     description: '更新时间',
     example: '2024-01-01T12:00:00Z'
     example: '2024-01-01T12:00:00Z'
-  })
+  }),
+  createdBy: z.number().int().positive().nullable().openapi({
+    description: '创建用户ID',
+    example: 1
+  }),
+  updatedBy: z.number().int().positive().nullable().openapi({
+    description: '更新用户ID',
+    example: 1
+  }),
 });
 });
 
 
 export const CreateCardDto = z.object({
 export const CreateCardDto = z.object({

+ 8 - 0
src/server/modules/goods/goods-category.schema.ts

@@ -33,6 +33,14 @@ export const GoodsCategorySchema = z.object({
   updatedAt: z.coerce.date().openapi({
   updatedAt: z.coerce.date().openapi({
     description: '更新时间',
     description: '更新时间',
     example: '2024-01-01T12:00:00Z'
     example: '2024-01-01T12:00:00Z'
+  }),
+  createdBy: z.number().int().positive().nullable().openapi({
+    description: '创建用户ID',
+    example: 1
+  }),
+  updatedBy: z.number().int().positive().nullable().openapi({
+    description: '更新用户ID',
+    example: 1
   })
   })
 });
 });
 
 

+ 9 - 1
src/server/modules/goods/goods.schema.ts

@@ -109,7 +109,15 @@ export const GoodsSchema = z.object({
   updatedAt: z.coerce.date().openapi({
   updatedAt: z.coerce.date().openapi({
     description: '更新时间',
     description: '更新时间',
     example: '2024-01-01T12:00:00Z'
     example: '2024-01-01T12:00:00Z'
-  })
+  }),
+  createdBy: z.number().int().positive().nullable().openapi({
+    description: '创建用户ID',
+    example: 1
+  }),
+  updatedBy: z.number().int().positive().nullable().openapi({
+    description: '更新用户ID',
+    example: 1
+  }),
 });
 });
 
 
 export const CreateGoodsDto = z.object({
 export const CreateGoodsDto = z.object({

+ 8 - 0
src/server/modules/logistics/express-company.schema.ts

@@ -25,6 +25,14 @@ export const ExpressCompanySchema = z.object({
   updatedAt: z.coerce.date().openapi({
   updatedAt: z.coerce.date().openapi({
     description: '更新时间',
     description: '更新时间',
     example: '2024-01-01T12:00:00Z'
     example: '2024-01-01T12:00:00Z'
+  }),
+  createdBy: z.number().int().positive().nullable().openapi({
+    description: '创建用户ID',
+    example: 1
+  }),
+  updatedBy: z.number().int().positive().nullable().openapi({
+    description: '更新用户ID',
+    example: 1
   })
   })
 });
 });
 
 

+ 8 - 0
src/server/modules/organization/organization.schema.ts

@@ -25,6 +25,14 @@ export const OrganizationSchema = z.object({
   updatedAt: z.coerce.date().openapi({
   updatedAt: z.coerce.date().openapi({
     description: '更新时间',
     description: '更新时间',
     example: '2024-01-01T12:00:00Z'
     example: '2024-01-01T12:00:00Z'
+  }),
+  createdBy: z.number().int().positive().nullable().openapi({
+    description: '创建用户ID',
+    example: 1
+  }),
+  updatedBy: z.number().int().positive().nullable().openapi({
+    description: '更新用户ID',
+    example: 1
   })
   })
 });
 });
 
 

+ 8 - 0
src/server/modules/supplier/supplier.schema.ts

@@ -57,6 +57,14 @@ export const SupplierSchema = z.object({
   updatedAt: z.coerce.date().openapi({
   updatedAt: z.coerce.date().openapi({
     description: '更新时间',
     description: '更新时间',
     example: '2024-01-01T12:00:00Z'
     example: '2024-01-01T12:00:00Z'
+  }),
+  createdBy: z.number().int().positive().nullable().openapi({
+    description: '创建用户ID',
+    example: 1
+  }),
+  updatedBy: z.number().int().positive().nullable().openapi({
+    description: '更新用户ID',
+    example: 1
   })
   })
 });
 });
 
 

+ 8 - 0
src/server/modules/system/city.schema.ts

@@ -29,6 +29,14 @@ export const CitySchema = z.object({
   updatedAt: z.coerce.date().openapi({
   updatedAt: z.coerce.date().openapi({
     description: '更新时间',
     description: '更新时间',
     example: '2024-01-01T12:00:00Z'
     example: '2024-01-01T12:00:00Z'
+  }),
+  createdBy: z.number().int().positive().nullable().openapi({
+    description: '创建用户ID',
+    example: 1
+  }),
+  updatedBy: z.number().int().positive().nullable().openapi({
+    description: '更新用户ID',
+    example: 1
   })
   })
 });
 });
 
 

+ 8 - 0
src/server/modules/system/config.schema.ts

@@ -21,6 +21,14 @@ export const ConfigSchema = z.object({
   updatedAt: z.coerce.date().openapi({
   updatedAt: z.coerce.date().openapi({
     description: '更新时间',
     description: '更新时间',
     example: '2024-01-01T12:00:00Z'
     example: '2024-01-01T12:00:00Z'
+  }),
+  createdBy: z.number().int().positive().nullable().openapi({
+    description: '创建用户ID',
+    example: 1
+  }),
+  updatedBy: z.number().int().positive().nullable().openapi({
+    description: '更新用户ID',
+    example: 1
   })
   })
 });
 });