function normalizeLeaveRequest(record) {
  return {
    ...record,
    id: record.id,
    member: record.member,
    memberId: record.memberId ?? record.member_id ?? null,
    startDate: record.startDate ?? record.start_date ?? null,
    endDate: record.endDate ?? record.end_date ?? null,
    timezone: record.timezone ?? null,
    status: record.status ?? "pending",
    unavailabilityReasonEntryId: record.unavailabilityReasonEntryId ?? record.unavailability_reason_entry_id ?? null,
    unavailabilityReasonValue: record.unavailabilityReasonValue ?? record.unavailability_reason_value ?? null,
    note: record.note ?? null,
    decisionComment: record.decisionComment ?? record.decision_comment ?? null,
    decidedAt: record.decidedAt ?? record.decided_at ?? null,
    updatedAt: record.updatedAt ?? record.updated_at ?? null
  };
}
function resolveStatusVariant(status) {
  if (status === "approved") return "default";
  if (status === "rejected") return "destructive";
  return "secondary";
}
function formatDateLabel(value) {
  if (!value) return "";
  const date = new Date(value);
  if (Number.isNaN(date.getTime())) return value;
  return date.toLocaleDateString();
}
function formatDateRange(start, end) {
  const startLabel = formatDateLabel(start);
  const endLabel = formatDateLabel(end);
  if (startLabel && endLabel) return `${startLabel} -> ${endLabel}`;
  return startLabel || endLabel || "-";
}
export {
  formatDateLabel,
  formatDateRange,
  normalizeLeaveRequest,
  resolveStatusVariant
};
//# sourceMappingURL=leaveRequestHelpers.js.map
