import type { PolicyCategory } from '@/shared/types/policies';

export const POLICY_DOCUMENT_ENTITY_TYPE = 'organization';
export const POLICY_DOCUMENT_CATEGORY = 'policy';
export const POLICY_UPDATED_BY_LABEL = 'Backend record';
export const POLICY_DATE_NOT_RECORDED_LABEL = 'Not recorded';

export const POLICY_QUERY_KEYS = {
  documents: ['policies', 'documents'],
  safetyDocuments: ['policies', 'safety-documents'],
  acknowledgments: ['policies', 'acknowledgments'],
} as const;

/**
 * The unified `policy_documents` store splits the two pages by `category` and
 * carries the handbook's finer sub-category in `tag`. The handbook page maps its
 * existing {@link POLICY_CATEGORIES} sub-categories onto `policy_documents.tag`.
 */
export const POLICY_DOCUMENT_PAGE_CATEGORY = {
  safetyProtocols: 'safety_protocol',
  handbookPolicies: 'handbook_policy',
} as const;

export const POLICY_CATEGORIES: readonly PolicyCategory[] = [
  'Operations',
  'Behavior',
  'Communication',
  'Safety',
  'Professional Growth',
  'Legal',
];

export const POLICY_CATEGORY_FILTERS: readonly (PolicyCategory | 'all')[] = [
  'all',
  ...POLICY_CATEGORIES,
];

export const POLICY_CATEGORY_COLORS: Record<PolicyCategory, string> = {
  Behavior: 'bg-rose-500/10 text-rose-400 border-rose-500/20',
  Operations: 'bg-amber-500/10 text-amber-400 border-amber-500/20',
  Communication: 'bg-cyan-500/10 text-cyan-400 border-cyan-500/20',
  Safety: 'bg-red-500/10 text-red-400 border-red-500/20',
  'Professional Growth': 'bg-emerald-500/10 text-emerald-400 border-emerald-500/20',
  Legal: 'bg-violet-500/10 text-violet-400 border-violet-500/20',
};

export const POLICY_DEFAULT_CATEGORY: PolicyCategory = 'Operations';
