22 lines
658 B
TypeScript
22 lines
658 B
TypeScript
export const CONTRACT_NATURES = ['CDI', 'CDD', 'INTERIM'] as const
|
|
|
|
export type ContractNature = (typeof CONTRACT_NATURES)[number]
|
|
|
|
export const contractNatureLabel = (value?: ContractNature) => {
|
|
if (value === 'CDD') return 'CDD'
|
|
if (value === 'INTERIM') return 'Intérim'
|
|
return 'CDI'
|
|
}
|
|
|
|
export const showsContractEndDate = (nature: ContractNature) => {
|
|
return nature === 'CDD' || nature === 'INTERIM'
|
|
}
|
|
|
|
export const requiresContractEndDate = (nature: ContractNature) => {
|
|
return nature === 'CDD'
|
|
}
|
|
|
|
export const isContractNature = (value: string): value is ContractNature => {
|
|
return (CONTRACT_NATURES as readonly string[]).includes(value)
|
|
}
|