/
Other.ts
26 lines (23 loc) · 900 Bytes
/
Other.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { z } from 'zod'
import { ContentDate, ContributionAreaSchema, NumberAsString, SecondaryContributionAreaSchema } from './utils.js'
export const OtherSchema = z.object({
primaryContributionArea: ContributionAreaSchema,
secondaryContributionArea: SecondaryContributionAreaSchema,
date: ContentDate,
title: z.string(),
url: z.string().url().optional(),
description: z.string().optional(),
annualQuantity: NumberAsString,
annualReach: NumberAsString.optional()
})
export type Other = z.infer<typeof OtherSchema>
export const OtherFieldMapping: Record<keyof Other, string> = {
primaryContributionArea: 'select_contributionAreasDDL',
secondaryContributionArea: 'select_contributionAreasDDL2',
date: 'DateOfActivity',
title: 'TitleOfActivity',
url: 'ReferenceUrl',
description: 'Description',
annualQuantity: 'AnnualQuantity',
annualReach: 'AnnualReach'
} as const