import { type Periodicity } from '../types';

export const resolvePeriodicity = (
  raw: string | undefined | null,
): Periodicity => {
  if (raw === 'weekly' || raw === 'biweekly') return raw;
  return 'weekly';
};

export const periodicityKey = (
  base: string,
  periodicity: Periodicity,
): string => `${base}_${periodicity}`;
