export const AGENT_SETTLEMENT_CYCLES = ["daily", "weekly", "monthly"] as const;

export type AgentSettlementCycle = (typeof AGENT_SETTLEMENT_CYCLES)[number];

export function normalizeAgentSettlementCycle(value: unknown): AgentSettlementCycle {
  const normalized = typeof value === "string" ? value.trim().toLowerCase() : "";

  if (AGENT_SETTLEMENT_CYCLES.includes(normalized as AgentSettlementCycle)) {
    return normalized as AgentSettlementCycle;
  }

  return "weekly";
}
