UNPKG

@adyen/kyc-components

Version:

This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.

57 lines (56 loc) 2.24 kB
import type { NsTranslationKey } from '../../types'; import { type DecisionMakerType } from '../core/models/api/decision-maker-type'; import { type Scenario } from '../core/models/api/get-scenarios'; /** * * When providing DECISION_MAKER_REQUIREMENTS per country - keep in mind that you need to specify rules for each role individually even if you have a mixed rule between them. * If you don't provide rules for a given individual role, it means that country does not support that type of decision maker and will not be returned by `getAvailableDecisionMakerRoleTypes(country)`. * * This give us more flexibility to have: * 1- rules for each role * 2- different rules for mixed roles if there's any * * Examples * A- provide at most 4 (controlling person - or - owners) but at least it should have 1 owner ... * B- provide at least 1 (controlling person - or - an owner) but max 4 owners and no max for controlling ... * * @example * let's say we want to write the config for the above [example B] it should look like this: * ``` * [ * { * // === the mixed rule === * roleTypes: [DecisionMakerType.CONTROLLING_PERSON, DecisionMakerType.OWNER], * min: 1, * max: Infinity * }, * { * // === specify each individually === * roleTypes: [DecisionMakerType.OWNER], * min: 0, * max: 4 * }, * { * // === specify each individually === * roleTypes: [DecisionMakerType.CONTROLLING_PERSON], * min: 0, * max: Infinity * } * ] * ``` * * each of the rules have different max to apply. * * */ export interface DecisionMakerRequirement { roleTypes: readonly DecisionMakerType[]; min: number; max: number; } export declare const getDecisionMakerRequirements: (country: string | undefined, matchingScenarios?: Scenario[]) => readonly DecisionMakerRequirement[]; export declare function getAvailableDecisionMakerRoleTypes(country: string, matchingScenarios?: Scenario[]): { roleType: DecisionMakerType; min: number; max: number; }[]; export declare const getDecisionMakerDescriptionMap: (country: string) => Record<DecisionMakerType, NsTranslationKey<"common">>;