Files
doneit-web/src/app/module/chat/data/dto/message/messageOutputDTO.ts
T

32 lines
756 B
TypeScript
Raw Normal View History

2024-06-04 16:21:11 +01:00
import { z } from "zod"
2024-06-05 14:31:26 +01:00
const DataSchema = z.object({
id: z.string(),
chatRoomId: z.string(),
wxUserId: z.number(),
2024-06-10 16:34:43 +01:00
sender: z.object({
wxUserId: z.number(),
wxFullName: z.string(),
wxeMail: z.string(),
userPhoto: z.string().optional()
}).nullable(),
2024-06-05 14:31:26 +01:00
message: z.string(),
messageType: z.number(),
2024-06-10 16:34:43 +01:00
sentAt: z.string(),
2024-06-05 14:31:26 +01:00
deliverAt: z.string().datetime().nullable(),
canEdit: z.boolean(),
oneShot: z.boolean(),
2024-07-31 17:23:44 +01:00
requireUnlock: z.boolean(),
requestId: z.string()
2024-06-05 14:31:26 +01:00
});
2024-06-10 16:34:43 +01:00
export const MessageOutPutDTOSchema = z.object({
2024-06-05 10:28:38 +01:00
success: z.boolean(),
message: z.string(),
2024-06-05 14:31:26 +01:00
data: DataSchema
2024-06-04 16:21:11 +01:00
});
2024-07-18 16:19:30 +01:00
export type MessageOutPutDataDTO = z.infer<typeof DataSchema>
2024-06-10 16:34:43 +01:00
export type MessageOutPutDTO = z.infer<typeof MessageOutPutDTOSchema>