import { z } from "zod";

export const extraChargesSchema = z.object({
  id: z.number(),
  clientId: z.number(),
  name: z.string(),
  type: z.number(),
  amount: z.number(),
  repetitionType: z.number(),
  createdAt: z.string().datetime(),
  updatedAt: z.string().datetime(),
});

type extraChargesTypes = z.infer<typeof extraChargesSchema>;

export const AddExtraChargeSchema = z.object({
  type: extraChargesSchema.shape.type,
  repetitionType: extraChargesSchema.shape.repetitionType,
  amount: extraChargesSchema.shape.amount,
  propertyList: z.array(z.number()),
});

export const EditExtraChargeSchema = z.object({
  repetitionType: extraChargesSchema.shape.repetitionType,
  amount: extraChargesSchema.shape.amount,
  id: extraChargesSchema.shape.id,
});

export const TogglePropertySchema = z.object({
  toggleValue: z.number(),
  propId: z.number(),
  extraChargeId: z.number(),
});

export default extraChargesTypes;
