import { type VacationType, type VacationStatus } from "./enums.js";

export interface Vacation {
  id: string;
  resourceId: string;
  type: VacationType;
  status: VacationStatus;
  startDate: Date;
  endDate: Date;
  note?: string | null;
  rejectionReason?: string | null;
  isHalfDay: boolean;
  halfDayPart?: string | null; // "MORNING" | "AFTERNOON"
  approvedById?: string | null;
  approvedAt?: Date | null;
  requestedById: string;
  createdAt: Date;
  updatedAt: Date;
}

export interface VacationEntitlement {
  id: string;
  resourceId: string;
  year: number;
  entitledDays: number;
  carryoverDays: number;
  usedDays: number;
  pendingDays: number;
  createdAt: Date;
  updatedAt: Date;
}

/** Computed balance for a resource in a year — not stored, returned by API */
export interface VacationBalance {
  year: number;
  resourceId: string;
  entitledDays: number;   // base quota + carryover
  carryoverDays: number;
  usedDays: number;       // APPROVED ANNUAL+OTHER
  pendingDays: number;    // PENDING ANNUAL+OTHER
  remainingDays: number;  // entitledDays - usedDays - pendingDays
  sickDays: number;       // APPROVED SICK (informational only, not subtracted)
}
