const VALID_GENDERS = Object.freeze(['male', 'female', 'other']);

function normalizeGender(value) {
  if (typeof value !== 'string') return value || null;

  const normalized = value.trim().toLowerCase();
  if (!normalized) return null;
  if (normalized === 'm') return 'male';
  if (normalized === 'f') return 'female';
  return normalized;
}

module.exports = { VALID_GENDERS, normalizeGender };
