Files
kycnotme/web/src/constants/kycLevelClarifications.ts

52 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-06-02 03:53:03 +00:00
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
import { transformCase } from '../lib/strings'
2025-06-11 21:08:32 +00:00
import type { AttributeType, KycLevelClarification } from '@prisma/client'
2025-06-02 03:53:03 +00:00
type KycLevelClarificationInfo<T extends string | null | undefined = string> = {
value: T
2025-06-11 21:08:32 +00:00
slug: string
2025-06-02 03:53:03 +00:00
label: string
description: string
icon: string
2025-06-11 21:08:32 +00:00
privacyPoints: number
attributeType: AttributeType
2025-06-02 03:53:03 +00:00
}
export const {
dataArray: kycLevelClarifications,
dataObject: kycLevelClarificationsById,
getFn: getKycLevelClarificationInfo,
} = makeHelpersForOptions(
'value',
(value): KycLevelClarificationInfo<typeof value> => ({
value,
2025-06-11 21:08:32 +00:00
slug: value ? value.toLowerCase().replace('_', '-') : '',
2025-06-02 03:53:03 +00:00
label: value ? transformCase(value.replace('_', ' '), 'title') : String(value),
description: '',
icon: 'ri:question-line',
2025-06-11 21:08:32 +00:00
privacyPoints: 0,
attributeType: 'INFO',
2025-06-02 03:53:03 +00:00
}),
[
{
value: 'NONE',
2025-06-11 21:08:32 +00:00
slug: 'none',
2025-06-02 03:53:03 +00:00
label: 'None',
description: 'No clarification needed.',
icon: 'ri:file-copy-line',
2025-06-11 21:08:32 +00:00
privacyPoints: 0,
attributeType: 'INFO',
2025-06-02 03:53:03 +00:00
},
{
value: 'DEPENDS_ON_PARTNERS',
2025-06-11 21:08:32 +00:00
slug: 'depends-on-partners',
2025-06-02 03:53:03 +00:00
label: 'Depends on partners',
description: 'May vary across partners.',
icon: 'ri:share-forward-line',
2025-06-11 21:08:32 +00:00
privacyPoints: -5,
attributeType: 'WARNING',
2025-06-02 03:53:03 +00:00
},
] as const satisfies KycLevelClarificationInfo<KycLevelClarification>[]
)