// ─── Calculation Rules ────────────────────────────────────────────────────────
// Admin-configurable rules that decouple cost attribution from chargeability.
// Example: "Sick person = still chargeable, but NOT charged to project."

export type AbsenceTrigger = "SICK" | "VACATION" | "PUBLIC_HOLIDAY" | "CUSTOM";

export type CostEffect = "CHARGE" | "ZERO" | "REDUCE";

export type ChargeabilityEffect = "COUNT" | "SKIP";

export interface CalculationRule {
  id: string;
  name: string;
  description: string | null;

  // ── Matching ──
  triggerType: AbsenceTrigger;
  projectId: string | null;     // null = all projects
  orderType: string | null;     // null = all order types

  // ── Effects ──
  costEffect: CostEffect;
  costReductionPercent: number | null; // only for REDUCE (0-100)
  chargeabilityEffect: ChargeabilityEffect;

  // ── Ordering ──
  priority: number;
  isActive: boolean;

  createdAt: Date;
  updatedAt: Date;
}
