import { prependListener } from "process";
import { start } from "repl";
import { z } from "zod";

export const electricityBill = z.object({
  id: z.number(),
  clientId: z.number(),
  propId: z.number(),
  roomFlatId: z.number(),
  amount: z.number(),
  noOfTenant: z.number(),
  startDate: z.string().date(),
  endDate: z.string().date(),
  previousReading: z.number(),
  currentReading: z.number(),
  docs: z.string(),
  createdAt: z.string().datetime(),
  updatedAt: z.string().datetime(),
});

type electricityBillTypes = z.infer<typeof electricityBill>;

export const AddAmountSchema = z.object({
  amount: z.string(),
  roomFlatId: z.number(),
  startDate: z.string().date(),
  endDate: z.string().date(),
  propId: z.string(),
  previousReading: z.string().optional(),
  currentReading: z.string().optional(),
});
export const AddTenantUnitsSchema = z.object({
  tenantId: z.number(),
  units: z.number().gt(0),
});

export default electricityBillTypes;
