import { z } from "zod"

export const attendanceSchema = z.object({
  employeeId: z.string().min(1, "Employee is required"),
  branchId:   z.string().optional(),
  date:       z.string().min(1, "Date is required"),   // YYYY-MM-DD
  checkIn:    z.string().optional(),                   // HH:mm
  checkOut:   z.string().optional(),                   // HH:mm
  status:     z.enum(["present", "absent", "late", "half_day", "on_leave"]),
  note:       z.string().optional(),
})

export type AttendanceInput = z.infer<typeof attendanceSchema>

// clock-in / clock-out from employee self-service
export const clockSchema = z.object({
  employeeId: z.string().min(1),
  type:       z.enum(["in", "out"]),
})

export type ClockInput = z.infer<typeof clockSchema>