2024-06-07 12:29:53 +01:00
|
|
|
import { z } from "zod";
|
|
|
|
|
|
|
|
|
|
const UserSchema = z.object({
|
|
|
|
|
wxUserId: z.number(),
|
|
|
|
|
wxFullName: z.string(),
|
|
|
|
|
wxeMail: z.string(),
|
|
|
|
|
userPhoto: z.string().nullable(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const MemberSchema = z.object({
|
|
|
|
|
id: z.string(),
|
|
|
|
|
user: UserSchema,
|
|
|
|
|
joinAt: z.string(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const RoomByIdOutputDTOSchema = z.object({
|
|
|
|
|
success: z.boolean(),
|
|
|
|
|
message: z.string(),
|
|
|
|
|
data: z.object({
|
|
|
|
|
id: z.string(),
|
|
|
|
|
roomName: z.string(),
|
|
|
|
|
createdBy: UserSchema,
|
|
|
|
|
createdAt: z.string(),
|
|
|
|
|
expirationDate: z.string().nullable(),
|
|
|
|
|
roomType: z.number(),
|
|
|
|
|
members: z.array(MemberSchema),
|
|
|
|
|
}),
|
2024-06-11 12:15:47 +01:00
|
|
|
})
|
2024-06-07 12:29:53 +01:00
|
|
|
|
|
|
|
|
|
2024-06-10 17:04:04 +01:00
|
|
|
export type RoomByIdMemberItemOutputDTO = z.infer<typeof MemberSchema>
|
2024-06-07 12:29:53 +01:00
|
|
|
export type RoomByIdOutputDTO = z.infer<typeof RoomByIdOutputDTOSchema>
|