@swan-io/shared-business 2.1.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/BeneficiaryForm.js +8 -7
- package/src/components/RIB.d.ts +23 -0
- package/src/components/RIB.js +89 -0
- package/src/components/SupportingDocument.js +23 -13
- package/src/components/UploadArea.js +2 -2
- package/src/constants/uploads.d.ts +1 -0
- package/src/constants/uploads.js +2 -1
- package/src/locales/de.json +1 -1
- package/src/locales/en.json +11 -1
- package/src/locales/es.json +1 -1
- package/src/locales/fr.json +1 -1
- package/src/locales/it.json +1 -1
- package/src/locales/nl.json +1 -1
- package/src/locales/pt.json +1 -1
package/package.json
CHANGED
|
@@ -49,7 +49,7 @@ const validateCca3CountryCode = value => {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
export const validateUbo = (editorState, accountCountry) => {
|
|
52
|
-
const isAddressRequired = accountCountry === "DEU";
|
|
52
|
+
const isAddressRequired = accountCountry === "DEU" || accountCountry === "ESP";
|
|
53
53
|
const isBirthInfoRequired = accountCountry !== "DEU";
|
|
54
54
|
const isTaxIdentificationNumberRequired = accountCountry === "DEU" && editorState.residencyAddressCountry === "DEU";
|
|
55
55
|
const validateTaxNumber = isTaxIdentificationNumberRequired
|
|
@@ -151,7 +151,7 @@ const requiredStepFields = [
|
|
|
151
151
|
];
|
|
152
152
|
export const BeneficiaryForm = forwardRef(({ initialState, accountCountry, step, googleMapApiKey, onStepChange, onClose, onSave, onCityLoadError, }, ref) => {
|
|
153
153
|
const [reference] = useState(() => initialState?.reference ?? uuid());
|
|
154
|
-
const isAddressRequired = accountCountry === "DEU";
|
|
154
|
+
const isAddressRequired = accountCountry === "DEU" || accountCountry === "ESP";
|
|
155
155
|
const isBirthInfoRequired = accountCountry !== "DEU";
|
|
156
156
|
const initialAddress = useRef({
|
|
157
157
|
residencyAddressLine1: initialState?.residencyAddressLine1,
|
|
@@ -320,16 +320,17 @@ export const BeneficiaryForm = forwardRef(({ initialState, accountCountry, step,
|
|
|
320
320
|
};
|
|
321
321
|
});
|
|
322
322
|
return (_jsx(ResponsiveContainer, { breakpoint: breakpoints.tiny, children: ({ small, large }) => (_jsxs(_Fragment, { children: [match(step)
|
|
323
|
-
.with("common", () => (_jsxs(View, { role: "form", children: [_jsxs(Box, { direction: small ? "column" : "row", children: [_jsx(Field, { name: "firstName", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.firstName"), style: styles.inputContainer, render: id => (_jsx(LakeTextInput, { error: error, placeholder: t("beneficiaryForm.beneficiary.firstNamePlaceholder"), id: id, value: value, onChangeText: onChange })) })) }), _jsx(Space, { width: 12 }), _jsx(Field, { name: "lastName", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.lastName"), style: styles.inputContainer, render: id => (_jsx(LakeTextInput, { error: error, placeholder: t("beneficiaryForm.beneficiary.lastNamePlaceholder"), id: id, value: value, onChangeText: onChange })) })) })] }), _jsxs(Box, { direction: small ? "column" : "row", children: [_jsx(Field, { name: "birthDate", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.birthDate"), style: styles.inputContainer, render: id => (_jsx(Rifm, { value: value ?? "", onChange: onChange, ...rifmDateProps, children: ({ value, onChange }) => (_jsx(LakeTextInput, { error: error, placeholder: locale.datePlaceholder, id: id, value: value, onChange: onChange })) })) })) }), _jsx(Space, { width: 12 }), _jsx(Field, { name: "birthCountryCode", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.birthCountry"), style: styles.inputContainer, render: id => (_jsx(CountryPicker, { id: id, error: error, value: value, placeholder: t("beneficiaryForm.beneficiary.birthCountryPlaceholder"), countries: allCountries, onValueChange: onChange })) })) })] }), _jsx(Box, { direction: small ? "column" : "row", children: _jsx(FieldsListener, { names: ["birthCountryCode"], children: ({ birthCountryCode }) => (_jsxs(_Fragment, { children: [_jsx(Field, { name: "birthCity", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.birthCity"), style: styles.inputContainer, render: id => (_jsx(GMapCityInput, { id: id, apiKey: googleMapApiKey, error: error, country: birthCountryCode.value, value: value ?? "", onValueChange: onChange, placeholder: birthCountryCode.value == null
|
|
323
|
+
.with("common", () => (_jsxs(View, { role: "form", children: [_jsxs(Box, { direction: small ? "column" : "row", children: [_jsx(Field, { name: "firstName", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.firstName"), style: styles.inputContainer, render: id => (_jsx(LakeTextInput, { error: error, placeholder: t("beneficiaryForm.beneficiary.firstNamePlaceholder"), id: id, value: value, onChangeText: onChange })) })) }), _jsx(Space, { width: 12 }), _jsx(Field, { name: "lastName", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.lastName"), style: styles.inputContainer, render: id => (_jsx(LakeTextInput, { error: error, placeholder: t("beneficiaryForm.beneficiary.lastNamePlaceholder"), id: id, value: value, onChangeText: onChange })) })) })] }), _jsxs(Box, { direction: small ? "column" : "row", children: [_jsx(Field, { name: "birthDate", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.birthDate"), optionalLabel: isBirthInfoRequired ? undefined : t("common.optional"), style: styles.inputContainer, render: id => (_jsx(Rifm, { value: value ?? "", onChange: onChange, ...rifmDateProps, children: ({ value, onChange }) => (_jsx(LakeTextInput, { error: error, placeholder: locale.datePlaceholder, id: id, value: value, onChange: onChange })) })) })) }), _jsx(Space, { width: 12 }), _jsx(Field, { name: "birthCountryCode", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.birthCountry"), style: styles.inputContainer, render: id => (_jsx(CountryPicker, { id: id, error: error, value: value, placeholder: t("beneficiaryForm.beneficiary.birthCountryPlaceholder"), countries: allCountries, onValueChange: onChange })) })) })] }), _jsx(Box, { direction: small ? "column" : "row", children: _jsx(FieldsListener, { names: ["birthCountryCode"], children: ({ birthCountryCode }) => (_jsxs(_Fragment, { children: [_jsx(Field, { name: "birthCity", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.birthCity"), optionalLabel: isBirthInfoRequired ? undefined : t("common.optional"), style: styles.inputContainer, render: id => (_jsx(GMapCityInput, { id: id, apiKey: googleMapApiKey, error: error, country: birthCountryCode.value, value: value ?? "", onValueChange: onChange, placeholder: birthCountryCode.value == null
|
|
324
324
|
? t("beneficiaryForm.beneficiary.fillBirthCountry")
|
|
325
325
|
: t("beneficiaryForm.beneficiary.birthCityPlaceholder"), onSuggestion: place => {
|
|
326
326
|
onChange(place.city);
|
|
327
327
|
setFieldValue("birthCityPostalCode", place.postalCode);
|
|
328
|
-
}, onLoadError: onCityLoadError })) })) }), _jsx(Space, { width: 12 }), _jsx(Field, { name: "birthCityPostalCode", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.birthPostalCode"), style: styles.inputContainer, render: id => (_jsx(LakeTextInput, { error: error, placeholder: birthCountryCode.value == null
|
|
328
|
+
}, onLoadError: onCityLoadError })) })) }), _jsx(Space, { width: 12 }), _jsx(Field, { name: "birthCityPostalCode", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.birthPostalCode"), optionalLabel: isBirthInfoRequired ? undefined : t("common.optional"), style: styles.inputContainer, render: id => (_jsx(LakeTextInput, { error: error, placeholder: birthCountryCode.value == null
|
|
329
329
|
? t("beneficiaryForm.beneficiary.fillBirthCountry")
|
|
330
|
-
: t("beneficiaryForm.beneficiary.birthPostalCodePlaceholder"), id: id, disabled: birthCountryCode.value === undefined, value: value, onChangeText: onChange })) })) })] })) }) }),
|
|
331
|
-
.with("address", () => (_jsxs(View, { role: "form", children: [_jsx(Field, { name: "country", children: ({ value, onChange }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.country"), render: id => (_jsx(CountryPicker, { id: id, value: value, countries: individualCountries, onValueChange: onChange })) })) }), _jsx(Space, { height: 12 }), _jsx(FieldsListener, { names: ["country"], children: ({ country }) => (_jsxs(_Fragment, { children: [_jsx(AddressFormPart, { apiKey: googleMapApiKey, initialAddress: initialAddress.current.residencyAddressLine1 ?? "", initialCity: initialAddress.current.residencyAddressCity ?? "", initialPostalCode: initialAddress.current.residencyAddressPostalCode ?? "", country: country?.value ?? accountCountry, label: t("beneficiaryForm.beneficiary.address"), Field: Field, setFieldValue: setFieldValue, listenFields: listenFields, isLarge: large }),
|
|
330
|
+
: t("beneficiaryForm.beneficiary.birthPostalCodePlaceholder"), id: id, disabled: birthCountryCode.value === undefined, value: value, onChangeText: onChange })) })) })] })) }) }), _jsx(Field, { name: "type", children: ({ value, onChange }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.type"), type: "radioGroup", render: () => (_jsx(RadioGroup, { direction: "row", value: value, onValueChange: onChange, items: beneficiaryTypes })) })) }), _jsx(FieldsListener, { names: ["type"], children: ({ type }) => type.value === "HasCapital" ? (_jsxs(_Fragment, { children: [_jsx(Field, { name: "totalCapitalPercentage", children: ({ value, onChange, error }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.totalCapitalPercentage"), render: id => (_jsx(LakeTextInput, { error: error, unit: "%", inputMode: "decimal", "aria-valuemin": 0, "aria-valuemax": 100, id: id, value: value, onChangeText: onChange })) })) }), _jsx(Space, { height: 12 }), _jsx(Field, { name: "capitalType", children: ({ value, error, onChange }) => (_jsx(CapitalTypeCheckboxes, { value: value ?? "none", error: error, onChange: onChange })) })] })) : null })] })))
|
|
331
|
+
.with("address", () => (_jsxs(View, { role: "form", children: [_jsx(Field, { name: "country", children: ({ value, onChange }) => (_jsx(LakeLabel, { label: t("beneficiaryForm.beneficiary.country"), render: id => (_jsx(CountryPicker, { id: id, value: value, countries: individualCountries, onValueChange: onChange })) })) }), _jsx(Space, { height: 12 }), _jsx(FieldsListener, { names: ["country"], children: ({ country }) => (_jsxs(_Fragment, { children: [_jsx(AddressFormPart, { apiKey: googleMapApiKey, initialAddress: initialAddress.current.residencyAddressLine1 ?? "", initialCity: initialAddress.current.residencyAddressCity ?? "", initialPostalCode: initialAddress.current.residencyAddressPostalCode ?? "", country: country?.value ?? accountCountry, label: t("beneficiaryForm.beneficiary.address"), Field: Field, setFieldValue: setFieldValue, listenFields: listenFields, isLarge: large }), ((accountCountry === "DEU" && country?.value === "DEU") ||
|
|
332
|
+
accountCountry === "ESP") && (_jsxs(_Fragment, { children: [_jsx(Space, { height: 12 }), _jsx(Field, { name: "taxIdentificationNumber", children: ({ value, error, valid, onChange }) => (_jsx(TaxIdentificationNumberInput, { value: value ?? "", error: error, valid: valid, onChange: onChange, accountCountry: accountCountry, isCompany: false,
|
|
332
333
|
// is mandatory for German accounts and UBO living in Germany
|
|
333
|
-
required:
|
|
334
|
+
required: accountCountry === "DEU" && country?.value === "DEU" })) })] }))] })) })] })))
|
|
334
335
|
.exhaustive(), isAddressRequired && (_jsxs(_Fragment, { children: [_jsx(Space, { height: 12 }), _jsx(StepDots, { currentStep: step, steps: formSteps })] }))] })) }));
|
|
335
336
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Address = {
|
|
2
|
+
name: string;
|
|
3
|
+
address: string;
|
|
4
|
+
zipCode: string;
|
|
5
|
+
city: string;
|
|
6
|
+
country: string;
|
|
7
|
+
};
|
|
8
|
+
type RIBv1Props = {
|
|
9
|
+
version: "v1";
|
|
10
|
+
partnerColor: string;
|
|
11
|
+
partnerLogoUrl?: string;
|
|
12
|
+
iban: string;
|
|
13
|
+
bic: string;
|
|
14
|
+
bank: string;
|
|
15
|
+
agency: string;
|
|
16
|
+
bankNumber: string;
|
|
17
|
+
bankKey: string;
|
|
18
|
+
bankAddress: Address;
|
|
19
|
+
accountHolderAddress: Address;
|
|
20
|
+
};
|
|
21
|
+
export type RIBProps = RIBv1Props;
|
|
22
|
+
export declare const RIB: (props: RIBProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AutoWidthImage } from "@swan-io/lake/src/components/AutoWidthImage";
|
|
3
|
+
import { Box } from "@swan-io/lake/src/components/Box";
|
|
4
|
+
import { Fill } from "@swan-io/lake/src/components/Fill";
|
|
5
|
+
import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading";
|
|
6
|
+
import { Separator } from "@swan-io/lake/src/components/Separator";
|
|
7
|
+
import { Space } from "@swan-io/lake/src/components/Space";
|
|
8
|
+
import { SwanLogo } from "@swan-io/lake/src/components/SwanLogo";
|
|
9
|
+
import { WithPartnerAccentColor } from "@swan-io/lake/src/components/WithPartnerAccentColor";
|
|
10
|
+
import { ayuthayaFontStyle, colors, interFontStyle, invariantColors, radii, spacings, } from "@swan-io/lake/src/constants/design";
|
|
11
|
+
import { isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
|
|
12
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
13
|
+
import { match } from "ts-pattern";
|
|
14
|
+
import { t } from "../utils/i18n";
|
|
15
|
+
const LOGO_MAX_HEIGHT = 26;
|
|
16
|
+
const LOGO_MAX_WIDTH = 200;
|
|
17
|
+
const styles = StyleSheet.create({
|
|
18
|
+
container: {
|
|
19
|
+
width: 470,
|
|
20
|
+
borderRadius: radii[8],
|
|
21
|
+
backgroundColor: invariantColors.white,
|
|
22
|
+
borderWidth: 1,
|
|
23
|
+
borderColor: colors.gray[100],
|
|
24
|
+
},
|
|
25
|
+
part: {
|
|
26
|
+
padding: spacings[24],
|
|
27
|
+
},
|
|
28
|
+
label: {
|
|
29
|
+
...interFontStyle,
|
|
30
|
+
fontSize: 10,
|
|
31
|
+
},
|
|
32
|
+
labelPartner: {
|
|
33
|
+
color: colors.partner[500],
|
|
34
|
+
fontWeight: "500",
|
|
35
|
+
},
|
|
36
|
+
mainInfo: {
|
|
37
|
+
...ayuthayaFontStyle,
|
|
38
|
+
fontSize: 12,
|
|
39
|
+
color: colors.gray[900],
|
|
40
|
+
},
|
|
41
|
+
smallInfo: {
|
|
42
|
+
...ayuthayaFontStyle,
|
|
43
|
+
fontSize: 10,
|
|
44
|
+
color: colors.gray[900],
|
|
45
|
+
},
|
|
46
|
+
addressInfo: {
|
|
47
|
+
...interFontStyle,
|
|
48
|
+
fontSize: 12,
|
|
49
|
+
color: colors.gray[900],
|
|
50
|
+
},
|
|
51
|
+
partnershipText: {
|
|
52
|
+
...interFontStyle,
|
|
53
|
+
fontSize: 8,
|
|
54
|
+
color: colors.gray[500],
|
|
55
|
+
},
|
|
56
|
+
defaultLogo: {
|
|
57
|
+
height: LOGO_MAX_HEIGHT,
|
|
58
|
+
width: 115,
|
|
59
|
+
},
|
|
60
|
+
swanLogo: {
|
|
61
|
+
width: 26,
|
|
62
|
+
height: 6,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
export const RIB = (props) => match(props)
|
|
66
|
+
.with({ version: "v1" }, props => _jsx(RIBv1, { ...props }))
|
|
67
|
+
.exhaustive();
|
|
68
|
+
const RIBv1 = ({ partnerColor, partnerLogoUrl, iban, bic, bank, agency, bankNumber, bankKey, bankAddress, accountHolderAddress, }) => {
|
|
69
|
+
return (_jsx(WithPartnerAccentColor, { color: partnerColor, children: _jsxs(View, { style: styles.container, children: [_jsxs(View, { style: styles.part, children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx(AutoWidthImage, { sourceUri: partnerLogoUrl, height: LOGO_MAX_HEIGHT, maxWidth: LOGO_MAX_WIDTH, resizeMode: "contain" })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Fill, { minWidth: 24 }), _jsx(LakeHeading, { level: 2, variant: "h3", color: colors.gray[900], children: t("rib.bankDetails") })] }), _jsx(Space, { height: 24 }), _jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(RibValue, { type: "mainInfo", color: "partner", label: t("rib.iban"), value: iban }), _jsx(Space, { width: 24 }), _jsx(RibValue, { type: "mainInfo", color: "partner", label: t("rib.bic"), value: bic })] }), _jsx(Space, { height: 8 }), _jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(RibValue, { type: "smallInfo", color: "gray", label: t("rib.bank"), value: bank }), _jsx(Space, { width: 24 }), _jsx(RibValue, { type: "smallInfo", color: "gray", label: t("rib.agency"), value: agency }), _jsx(Space, { width: 24 }), _jsx(RibValue, { type: "smallInfo", color: "gray", label: t("rib.number"), value: bankNumber }), _jsx(Space, { width: 24 }), _jsx(RibValue, { type: "smallInfo", color: "gray", label: t("rib.key"), value: bankKey })] })] }), _jsx(Separator, {}), _jsxs(View, { style: styles.part, children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(RibValue, { type: "addressInfo", color: "partner", label: t("rib.address"), value: [
|
|
70
|
+
bankAddress.name,
|
|
71
|
+
bankAddress.address,
|
|
72
|
+
`${bankAddress.zipCode} ${bankAddress.city}`,
|
|
73
|
+
bankAddress.country,
|
|
74
|
+
] }), _jsx(Space, { width: 24 }), _jsx(RibValue, { type: "addressInfo", color: "partner", label: t("rib.accountHolder"), value: [
|
|
75
|
+
accountHolderAddress.name,
|
|
76
|
+
accountHolderAddress.address,
|
|
77
|
+
`${accountHolderAddress.zipCode} ${accountHolderAddress.city}`,
|
|
78
|
+
accountHolderAddress.country,
|
|
79
|
+
] })] }), _jsx(Space, { height: 12 }), _jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(Text, { style: styles.partnershipText, children: t("rib.partnership") }), _jsx(Space, { width: 4 }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] })] })] }) }));
|
|
80
|
+
};
|
|
81
|
+
const ribValueStyle = {
|
|
82
|
+
mainInfo: styles.mainInfo,
|
|
83
|
+
smallInfo: styles.smallInfo,
|
|
84
|
+
addressInfo: styles.addressInfo,
|
|
85
|
+
};
|
|
86
|
+
const RibValue = ({ type, color, label, value }) => {
|
|
87
|
+
const lines = Array.isArray(value) ? value : [value];
|
|
88
|
+
return (_jsxs(View, { children: [_jsx(Text, { style: [styles.label, color === "partner" && styles.labelPartner], children: label }), _jsx(Space, { height: 4 }), lines.map((line, index) => (_jsx(Text, { style: ribValueStyle[type], children: line }, index)))] }));
|
|
89
|
+
};
|
|
@@ -11,7 +11,7 @@ import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from "r
|
|
|
11
11
|
import { StyleSheet } from "react-native";
|
|
12
12
|
import { useForm } from "react-ux-form";
|
|
13
13
|
import { match } from "ts-pattern";
|
|
14
|
-
import { MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE } from "../constants/uploads";
|
|
14
|
+
import { MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE, MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB, } from "../constants/uploads";
|
|
15
15
|
import { locale, t } from "../utils/i18n";
|
|
16
16
|
import { UploadArea } from "./UploadArea";
|
|
17
17
|
const ACCEPTED_FORMATS = ["application/pdf", "image/png", "image/jpeg"];
|
|
@@ -62,8 +62,6 @@ export const SupportingDocument = forwardRef(({ documents, getAwsUrl, onChange,
|
|
|
62
62
|
}, {}), [documents]);
|
|
63
63
|
const [showPowerOfAttorneyModal, setShowPowerOfAttorneyModal] = useState(false);
|
|
64
64
|
const [showSwornStatementModal, setShowSwornStatementModal] = useState(false);
|
|
65
|
-
const initialPowerOfAttorneyDocuments = initialValues["PowerOfAttorney"] ?? [];
|
|
66
|
-
const initialOtherDocuments = initialValues["Other"] ?? [];
|
|
67
65
|
const { Field, setFieldValue, getFieldState, listenFields, submitForm } = useForm({
|
|
68
66
|
CompanyRegistration: {
|
|
69
67
|
initialValue: initialValues["CompanyRegistration"] ?? [],
|
|
@@ -86,9 +84,7 @@ export const SupportingDocument = forwardRef(({ documents, getAwsUrl, onChange,
|
|
|
86
84
|
validate: validateNotEmpty,
|
|
87
85
|
},
|
|
88
86
|
PowerOfAttorney: {
|
|
89
|
-
|
|
90
|
-
// this should be replaced by initialValues["PowerOfAttorney"] ?? [] in may 2023
|
|
91
|
-
initialValue: [...initialPowerOfAttorneyDocuments, ...initialOtherDocuments],
|
|
87
|
+
initialValue: initialValues["PowerOfAttorney"] ?? [],
|
|
92
88
|
validate: validateNotEmpty,
|
|
93
89
|
},
|
|
94
90
|
SwornStatement: {
|
|
@@ -195,25 +191,39 @@ export const SupportingDocument = forwardRef(({ documents, getAwsUrl, onChange,
|
|
|
195
191
|
return (_jsxs(Form, { children: [requiredDocumentTypes.includes("CompanyRegistration") && (_jsxs(_Fragment, { children: [_jsx(LakeLabel, { label: t("supportingDoc.companyRegistration"), help: _jsx(Help, { type: "tooltip", text: "supportingDoc.companyRegistration.description" }), render: () => (_jsx(Field, { name: "CompanyRegistration", children: ({ value, onChange, error }) => (_jsx(UploadArea, { layout: "horizontal", error: error, onDropAccepted: files => {
|
|
196
192
|
onChange([...value, { id: NO_ID_YET, status: "uploading", progress: 0 }]);
|
|
197
193
|
handleUpload(files, "CompanyRegistration");
|
|
198
|
-
}, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes"
|
|
194
|
+
}, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes", {
|
|
195
|
+
maxSizeMB: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB,
|
|
196
|
+
}), maxSize: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE })) })) }), _jsx(Space, { height: 24 })] })), requiredDocumentTypes.includes("AssociationRegistration") && (_jsxs(_Fragment, { children: [_jsx(LakeLabel, { label: t("supportingDoc.associationRegistration"), help: _jsx(Help, { type: "tooltip", text: "supportingDoc.associationRegistration.description" }), render: () => (_jsx(Field, { name: "AssociationRegistration", children: ({ value, onChange, error }) => (_jsx(UploadArea, { layout: "horizontal", onDropAccepted: files => {
|
|
199
197
|
onChange([...value, { id: NO_ID_YET, status: "uploading", progress: 0 }]);
|
|
200
198
|
handleUpload(files, "AssociationRegistration");
|
|
201
|
-
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes"
|
|
199
|
+
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes", {
|
|
200
|
+
maxSizeMB: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB,
|
|
201
|
+
}), maxSize: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE })) })) }), _jsx(Space, { height: 24 })] })), requiredDocumentTypes.includes("SignedStatus") && (_jsxs(_Fragment, { children: [_jsx(LakeLabel, { label: t("supportingDoc.signedStatus"), help: _jsx(Help, { type: "tooltip", text: "supportingDoc.signedStatus.description" }), render: () => (_jsx(Field, { name: "SignedStatus", children: ({ value, onChange, error }) => (_jsx(UploadArea, { layout: "horizontal", onDropAccepted: files => {
|
|
202
202
|
onChange([...value, { id: NO_ID_YET, status: "uploading", progress: 0 }]);
|
|
203
203
|
handleUpload(files, "SignedStatus");
|
|
204
|
-
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes"
|
|
204
|
+
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes", {
|
|
205
|
+
maxSizeMB: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB,
|
|
206
|
+
}), maxSize: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE })) })) }), _jsx(Space, { height: 24 })] })), requiredDocumentTypes.includes("UBODeclaration") && (_jsxs(_Fragment, { children: [_jsx(LakeLabel, { label: t("supportingDoc.UBODeclaration"), help: _jsx(Help, { type: "tooltip", text: "supportingDoc.UBODeclaration.description" }), render: () => (_jsx(Field, { name: "UBODeclaration", children: ({ value, onChange, error }) => (_jsx(UploadArea, { layout: "horizontal", onDropAccepted: files => {
|
|
205
207
|
onChange([...value, { id: NO_ID_YET, status: "uploading", progress: 0 }]);
|
|
206
208
|
handleUpload(files, "UBODeclaration");
|
|
207
|
-
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes"
|
|
209
|
+
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes", {
|
|
210
|
+
maxSizeMB: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB,
|
|
211
|
+
}), maxSize: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE })) })) }), _jsx(Space, { height: 24 })] })), requiredDocumentTypes.includes("ProofOfIdentity") && (_jsxs(_Fragment, { children: [_jsx(LakeLabel, { label: t("supportingDoc.proofOfIdentity"), help: _jsx(Help, { type: "tooltip", width: 600, text: "supportingDoc.proofOfIdentity.description" }), render: () => (_jsx(Field, { name: "ProofOfIdentity", children: ({ value, onChange, error }) => (_jsx(UploadArea, { layout: "horizontal", onDropAccepted: files => {
|
|
208
212
|
onChange([...value, { id: NO_ID_YET, status: "uploading", progress: 0 }]);
|
|
209
213
|
handleUpload(files, "ProofOfIdentity");
|
|
210
|
-
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes"
|
|
214
|
+
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes", {
|
|
215
|
+
maxSizeMB: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB,
|
|
216
|
+
}), maxSize: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE })) })) }), _jsx(Space, { height: 24 })] })), requiredDocumentTypes.includes("PowerOfAttorney") && (_jsxs(_Fragment, { children: [_jsx(LakeLabel, { label: t("supportingDoc.powerAttornySigned"), help: _jsx(Help, { type: "button", label: t("supportingDoc.whatIsThis"), onPress: () => setShowPowerOfAttorneyModal(true) }), render: () => (_jsx(Field, { name: "PowerOfAttorney", children: ({ value, onChange, error }) => (_jsx(UploadArea, { layout: "horizontal", onDropAccepted: files => {
|
|
211
217
|
onChange([...value, { id: NO_ID_YET, status: "uploading", progress: 0 }]);
|
|
212
218
|
handleUpload(files, "PowerOfAttorney");
|
|
213
|
-
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes"
|
|
219
|
+
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes", {
|
|
220
|
+
maxSizeMB: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB,
|
|
221
|
+
}), maxSize: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE })) })) }), _jsx(Space, { height: 24 })] })), requiredDocumentTypes.includes("SwornStatement") && (_jsxs(_Fragment, { children: [_jsx(LakeLabel, { label: t("supportingDoc.swornStatementDeclaration"), help: _jsx(Help, { type: "button", label: t("supportingDoc.whatIsThis"), onPress: () => setShowSwornStatementModal(true) }), render: () => (_jsx(Field, { name: "SwornStatement", children: ({ value, onChange, error }) => (_jsx(UploadArea, { layout: "horizontal", onDropAccepted: files => {
|
|
214
222
|
onChange([...value, { id: NO_ID_YET, status: "uploading", progress: 0 }]);
|
|
215
223
|
handleUpload(files, "SwornStatement");
|
|
216
|
-
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes"
|
|
224
|
+
}, error: error, documents: value, accept: ACCEPTED_FORMATS, icon: "document-regular", description: t("supportingDoc.documentTypes", {
|
|
225
|
+
maxSizeMB: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB,
|
|
226
|
+
}), maxSize: MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE })) })) }), _jsx(Space, { height: 24 })] })), requiredDocumentTypes.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Space, { height: 24 }), _jsx(LakeText, { children: t("supportingDoc.noRequiredDocuments") }), _jsx(Space, { height: 24 })] })) : null, _jsxs(LakeModal, { visible: showPowerOfAttorneyModal, title: t("supportingDoc.powerAttorney"), icon: "document-regular", onPressClose: () => setShowPowerOfAttorneyModal(false), children: [_jsx(LakeText, { children: t("supportingDoc.powerAttornySigned.description") }), _jsx(Space, { height: 16 }), _jsx(LakeButtonGroup, { paddingBottom: 0, children: _jsx(LakeButton, { grow: true, color: "current", onPress: () => window.open(`/power-of-attorney-template/${match(onboardingLanguage)
|
|
217
227
|
.with("fr", () => "fr")
|
|
218
228
|
.with("de", () => "de")
|
|
219
229
|
.with("es", () => "es")
|
|
@@ -157,8 +157,8 @@ export const UploadArea = ({ icon, accept, value, documents = [], disabled = fal
|
|
|
157
157
|
}) }), isNotNullish(error) ? (_jsxs(_Fragment, { children: [_jsx(Space, { height: 4 }), _jsx(LakeText, { color: colors.negative[400], align: layout === "horizontal" ? "left" : "center", children: error })] })) : (!disabled &&
|
|
158
158
|
isNotNullish(description) && (_jsxs(_Fragment, { children: [_jsx(Space, { height: 4 }), _jsx(LakeText, { align: layout === "horizontal" ? "left" : "center", children: description })] })))] })] }))] }) }), documents.map(({ ...document }, index) => {
|
|
159
159
|
return (_jsxs(Fragment, { children: [_jsx(Space, { height: index === 0 ? 8 : 4 }), match(document)
|
|
160
|
-
.with({ status: "finished" }, () => (_jsx(FileTile, { name: document.name ?? t("uploadArea.unknownFileName"), url: document.fileUrl, onRemove: () => onRemoveFile
|
|
161
|
-
.with({ status: "failed" }, ({ error }) => (_jsx(FileTile, { name: document.name ?? t("uploadArea.unknownFileName"), url: document.fileUrl, onRemove: () => onRemoveFile
|
|
160
|
+
.with({ status: "finished" }, () => (_jsx(FileTile, { name: document.name ?? t("uploadArea.unknownFileName"), url: document.fileUrl, onRemove: onRemoveFile ? () => onRemoveFile(document.id) : undefined })))
|
|
161
|
+
.with({ status: "failed" }, ({ error }) => (_jsx(FileTile, { name: document.name ?? t("uploadArea.unknownFileName"), url: document.fileUrl, onRemove: () => (onRemoveFile ? onRemoveFile(document.id) : undefined), variant: "refused", title: error })))
|
|
162
162
|
.with({ status: "uploading" }, ({ progress }) => (_jsxs(Box, { direction: "row", alignItems: "center", style: styles.item, children: [_jsx(LakeText, { numberOfLines: 1, color: colors.gray[700], children: t("uploadArea.uploading") }), _jsx(Space, { width: 20 }), _jsx(View, { role: "progressbar", style: styles.progressBar, children: _jsx(View, { style: [styles.progress, { width: `${progress}%` }] }) })] })))
|
|
163
163
|
.exhaustive()] }, document.id));
|
|
164
164
|
})] }));
|
package/src/constants/uploads.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
export const MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB = 20;
|
|
1
2
|
// just below 20MB (* 1000 instead of * 1024) in bytes to account for the rest of the payload
|
|
2
|
-
export const MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE =
|
|
3
|
+
export const MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE = MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE_MB * 1000 * 1000;
|
package/src/locales/de.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"supportingDoc.associationRegistration.description": "Offizielles Dokument zum Nachweis der Registrierung Ihrer Vereinigung. (weniger als 3 Monate alt)",
|
|
99
99
|
"supportingDoc.companyRegistration": "Nachweis der Unternehmensregistrierung (weniger als 3 Monate alt)",
|
|
100
100
|
"supportingDoc.companyRegistration.description": "Offizielles Dokument, das die rechtliche Existenz eines Unternehmens nachweist und Auskunft über seine Rechtspersönlichkeit gibt.\n(weniger als 3 Monate alt)",
|
|
101
|
-
"supportingDoc.documentTypes": "Unterstützte Dokumente: .pdf, .png, .jpg",
|
|
101
|
+
"supportingDoc.documentTypes": "Unterstützte Dokumente: .pdf, .png, .jpg\nMax: {maxSizeMB} MB",
|
|
102
102
|
"supportingDoc.downloadTemplate": "Vorlage herunterladen",
|
|
103
103
|
"supportingDoc.errorUpload": "Fehler beim Hochladen der Datei",
|
|
104
104
|
"supportingDoc.noRequiredDocuments": "Wir brauchen keine Dokumente von Ihnen. Sie können fortfahren.",
|
package/src/locales/en.json
CHANGED
|
@@ -92,13 +92,23 @@
|
|
|
92
92
|
"registrationPage.defaultNumberLabel": "Registration number",
|
|
93
93
|
"registrationPage.withOrganismLabel": "Are you registered to {organismName}?",
|
|
94
94
|
"registrationPage.withoutOrganismNameLabel": "Are you registered?",
|
|
95
|
+
"rib.accountHolder": "Account holder",
|
|
96
|
+
"rib.address": "Address",
|
|
97
|
+
"rib.agency": "Agency",
|
|
98
|
+
"rib.bank": "Bank",
|
|
99
|
+
"rib.bankDetails": "Bank details",
|
|
100
|
+
"rib.bic": "BIC / SWIFT",
|
|
101
|
+
"rib.iban": "IBAN",
|
|
102
|
+
"rib.key": "Key",
|
|
103
|
+
"rib.number": "Number",
|
|
104
|
+
"rib.partnership": "In partnership with",
|
|
95
105
|
"supportingDoc.UBODeclaration": "UBO Declaration",
|
|
96
106
|
"supportingDoc.UBODeclaration.description": "Ultimate Beneficial Owners declaration of the organization",
|
|
97
107
|
"supportingDoc.associationRegistration": "Proof of registration",
|
|
98
108
|
"supportingDoc.associationRegistration.description": "Official document proving the registration of your association. (< 3 months old)",
|
|
99
109
|
"supportingDoc.companyRegistration": "Proof of company registration (< 3 months old)",
|
|
100
110
|
"supportingDoc.companyRegistration.description": "Official document proving the legal existence of a company and providing info about its legal personality.\n(< 3 months old)",
|
|
101
|
-
"supportingDoc.documentTypes": "Supported documents: .pdf, .png, .jpg",
|
|
111
|
+
"supportingDoc.documentTypes": "Supported documents: .pdf, .png, .jpg\nMax: {maxSizeMB} MB",
|
|
102
112
|
"supportingDoc.downloadTemplate": "Download a template",
|
|
103
113
|
"supportingDoc.errorUpload": "Failed to upload file",
|
|
104
114
|
"supportingDoc.noRequiredDocuments": "We don't need any documents from you. You can continue.",
|
package/src/locales/es.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"supportingDoc.associationRegistration.description": "Documento oficial que acredite el registro de tu asociación. (< 3 meses)",
|
|
99
99
|
"supportingDoc.companyRegistration": "Comprobante de registro de la empresa (< 3 meses de antigüedad)",
|
|
100
100
|
"supportingDoc.companyRegistration.description": "Documento oficial que acredite la existencia legal de una empresa y proporcione información sobre su personalidad jurídica.\n(< 3 meses)",
|
|
101
|
-
"supportingDoc.documentTypes": "Documentos admitidos: .pdf, .png, .jpg",
|
|
101
|
+
"supportingDoc.documentTypes": "Documentos admitidos: .pdf, .png, .jpg\nMáximo: {maxSizeMB} MB",
|
|
102
102
|
"supportingDoc.downloadTemplate": "Descargar una plantilla",
|
|
103
103
|
"supportingDoc.errorUpload": "Error al subir el archivo",
|
|
104
104
|
"supportingDoc.noRequiredDocuments": "No necesitamos ningún documento de ti. Puedes continuar.",
|
package/src/locales/fr.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"supportingDoc.associationRegistration.description": "Document officiel prouvant l'enregistrement de votre association. (de moins de 3 mois)",
|
|
99
99
|
"supportingDoc.companyRegistration": "Preuve d'enregistrement de l'entreprise (de moins de 3 mois)",
|
|
100
100
|
"supportingDoc.companyRegistration.description": "Document officiel prouvant l'existence légale d'une entreprise et fournissant des informations sur sa personnalité juridique.\n(de moins de 3 mois)",
|
|
101
|
-
"supportingDoc.documentTypes": "Documents pris en charge : .pdf, .png, .jpg",
|
|
101
|
+
"supportingDoc.documentTypes": "Documents pris en charge : .pdf, .png, .jpg\nMax : {maxSizeMB} Mo",
|
|
102
102
|
"supportingDoc.downloadTemplate": "Télécharger un modèle",
|
|
103
103
|
"supportingDoc.errorUpload": "Échec du téléversement du fichier",
|
|
104
104
|
"supportingDoc.noRequiredDocuments": "Nous n'avons besoin d'aucun document de votre part. Vous pouvez continuer.",
|
package/src/locales/it.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"supportingDoc.associationRegistration.description": "Documento ufficiale attestante la registrazione della tua associazione. (< 3 mesi)",
|
|
99
99
|
"supportingDoc.companyRegistration": "Prova di registrazione della società (< 3 mesi)",
|
|
100
100
|
"supportingDoc.companyRegistration.description": "Documento ufficiale che attesta l'esistenza legale di una società e fornisce informazioni sulla sua personalità giuridica.\n(< 3 mesi)",
|
|
101
|
-
"supportingDoc.documentTypes": "Documenti supportati: .pdf, .png, .jpg",
|
|
101
|
+
"supportingDoc.documentTypes": "Documenti supportati: .pdf, .png, .jpg\nMax: {maxSizeMB} MB",
|
|
102
102
|
"supportingDoc.downloadTemplate": "Scarica un modello",
|
|
103
103
|
"supportingDoc.errorUpload": "Caricamento del file non riuscito",
|
|
104
104
|
"supportingDoc.noRequiredDocuments": "Non abbiamo bisogno di alcun documento da parte tua. Puoi proseguire.",
|
package/src/locales/nl.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"supportingDoc.associationRegistration.description": "Officieel document waaruit de registratie van uw vereniging blijkt. (minder dan 3 maanden oud)",
|
|
99
99
|
"supportingDoc.companyRegistration": "Uittreksel van het handelsregister (KVK document, minder dan 3 maanden oud)",
|
|
100
100
|
"supportingDoc.companyRegistration.description": "Een officieel uittreksel van het handelsregister dat niet ouder is dan 3 maanden. Je kunt via de website van KVK een recent uittreksel downloaden.",
|
|
101
|
-
"supportingDoc.documentTypes": "Ondersteunde documenten: .pdf, .png, .jpg",
|
|
101
|
+
"supportingDoc.documentTypes": "Ondersteunde documenten: .pdf, .png, .jpg\nMax: {maxSizeMB} MB",
|
|
102
102
|
"supportingDoc.downloadTemplate": "Een sjabloon downloaden",
|
|
103
103
|
"supportingDoc.errorUpload": "Bestand uploaden mislukt",
|
|
104
104
|
"supportingDoc.noRequiredDocuments": "We hebben geen documenten van u nodig. U kunt verder gaan.",
|
package/src/locales/pt.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"supportingDoc.associationRegistration.description": "Documento oficial comprovando o registo da sua associação. (< 3 meses)",
|
|
99
99
|
"supportingDoc.companyRegistration": "Prova de registo da empresa (< 3 meses)",
|
|
100
100
|
"supportingDoc.companyRegistration.description": "\"Documento oficial comprovando a existência legal de uma empresa e fornecendo informações sobre a sua personalidade jurídica. (< 3 meses)\"",
|
|
101
|
-
"supportingDoc.documentTypes": "
|
|
101
|
+
"supportingDoc.documentTypes": "Documentos suportados: .pdf, .png, .jpg\nMáximo: {maxSizeMB} MB",
|
|
102
102
|
"supportingDoc.downloadTemplate": "Outro",
|
|
103
103
|
"supportingDoc.errorUpload": "Falha ao carregar ficheiro",
|
|
104
104
|
"supportingDoc.noRequiredDocuments": "Não necessitamos quaisquer documentos da sua parte. Pode continuar.",
|