import { z } from "zod";

export const roomOptionsSchema = z.object({
  id: z.number(),
  rent: z
    .number()
    .gte(1000, "Rent must be at least 1000")
    .lte(1000000, "Rent must be at most 1000000"),
  security: z.number().gte(1000, "Rent must be at least 1000").lte(1000000, "Rent must be at most 1000000"),
  type: z.number(),
  name: z.string().min(1, "Name must be at least 1 character"),
  propId: z.number(),
  amenities: z.string(),
  totalBedCount: z.number().gt(0),
  furnishingType: z.number(),
  status: z.number(),
  createdAt: z.string().datetime(),
  updatedAt: z.string().datetime(),
});

type roomOptionsTypes = z.infer<typeof roomOptionsSchema>;

export const CreateRoomOptionSchema = z.object({
  name: roomOptionsSchema.shape.name,
  rent: roomOptionsSchema.shape.rent,
  type: roomOptionsSchema.shape.type,
  amenities: roomOptionsSchema.shape.amenities,
  propId: roomOptionsSchema.shape.propId,
  totalBedCount: roomOptionsSchema.shape.totalBedCount,
});

export const EditRoomOptionSchema = z.object({
  name: roomOptionsSchema.shape.name,
  rent: roomOptionsSchema.shape.rent,
  amenities: roomOptionsSchema.shape.amenities,
  roomOptionId: roomOptionsSchema.shape.id,
});

export default roomOptionsTypes;
