import {
  UpdateFrequency,
  UpdateFrequencyCode,
  updateFrequencyCodeValues,
} from '../../../../../../../libs/common/domain/src/lib/model/record'

export function getUpdateFrequencyFromFrequencyCode(
  frequencyCode: string
): UpdateFrequency {
  return frequencyCode &&
    updateFrequencyCodeValues.includes(frequencyCode as UpdateFrequencyCode)
    ? (frequencyCode as UpdateFrequencyCode)
    : null
}
