Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reason code translations for rejected supporting documents #655

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,11 @@ export const ReadOnlyWithDocs = () => {
id: "id",
name: "IdCard.pdf",
url: "https://swan.io",
statusInfo: { status: "Refused", reason: "Invalid document" },
statusInfo: {
status: "Refused",
reason: "Invalid document",
reasonCode: "InvalidDocument",
},
},
},
]}
Expand Down
57 changes: 55 additions & 2 deletions packages/shared-business/src/components/FileTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,62 @@ export const FileTile = ({
.with({ status: "Pending" }, () => (
<LakeAlert anchored={true} title={t("fileTile.status.Pending")} variant="info" />
))
.with({ status: "Refused" }, ({ reason }) => (
.with({ status: "Refused" }, ({ reason, reasonCode }) => (
<LakeAlert anchored={true} title={t("fileTile.status.Refused")} variant="error">
{reason}
<Box direction="column">
<LakeText>
{match(reasonCode)
.with("BadDocumentQuality", () =>
t("supportingDocuments.rejectionReason.BadDocumentQuality"),
)
.with("CompanyNameMismatch", () =>
t("supportingDocuments.rejectionReason.CompanyNameMismatch"),
)
.with("ExpiredDocument", () =>
t("supportingDocuments.rejectionReason.ExpiredDocument"),
)
.with("FullDocumentRequired", () =>
t("supportingDocuments.rejectionReason.FullDocumentRequired"),
)
.with("IbanMismatch", () => t("supportingDocuments.rejectionReason.IbanMismatch"))
.with("InvalidAddress", () =>
t("supportingDocuments.rejectionReason.InvalidAddress"),
)
.with("InvalidDocument", () =>
t("supportingDocuments.rejectionReason.InvalidDocument"),
)
.with("InvalidOrMissingData", () =>
t("supportingDocuments.rejectionReason.InvalidOrMissingData"),
)
.with("InvalidTransaction", () =>
t("supportingDocuments.rejectionReason.InvalidTransaction"),
)
.with("MissingDescription", () =>
t("supportingDocuments.rejectionReason.MissingDescription"),
)
.with("MissingSignature", () =>
t("supportingDocuments.rejectionReason.MissingSignature"),
)
.with("ProviderColorIdDocumentRequired", () =>
t("supportingDocuments.rejectionReason.ProviderColorIdDocumentRequired"),
)
.with("TransactionAmountMismatch", () =>
t("supportingDocuments.rejectionReason.TransactionAmountMismatch"),
)
.with("TransactionDateMismatch", () =>
t("supportingDocuments.rejectionReason.TransactionDateMismatch"),
)
.with("TransactionNameMismatch", () =>
t("supportingDocuments.rejectionReason.TransactionNameMismatch"),
)
.with("UnacceptableDocument", () =>
t("supportingDocuments.rejectionReason.UnacceptableDocument"),
)
.otherwise(() => null)}
sandrine-ds marked this conversation as resolved.
Show resolved Hide resolved
</LakeText>

<LakeText>{reason}</LakeText>
</Box>
</LakeAlert>
))
.otherwise(() => null)}
Expand Down
25 changes: 25 additions & 0 deletions packages/shared-business/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,31 @@
"supportingDocuments.purpose.UltimateBeneficialOwnerProofOfAddress.description": "Bitte fügen Sie für jede Person, die mindestens 25% des Kapitals oder Stimmrechts besitzt oder jede Person, die die Geschäftsführung oder das Management Ihres Unternehmens kontrolliert, ein Dokument hinzu, das den Wohnsitz des Einzelnen nachweist. Das Dokument muss den Namen und die Adresse der Person enthalten und darf nicht älter als drei Monate sein.\n\nAkzeptable Dokumente:\n- Dokumente zum Wohnsitz (Mietvertrag, Hypothekenabrechnung usw.)\n- Haushaltsrechnungen (für Strom, Telefon, Internetdienste, Gas, Wasser usw.)\n- Lohnabrechnungen (sofern die Adresse des Arbeitnehmers enthalten ist)",
"supportingDocuments.purpose.UltimateBeneficialOwnerProofOfIdentity": "Identitätsdokument für jeden wirtschaftlich Berechtigten",
"supportingDocuments.purpose.UltimateBeneficialOwnerProofOfIdentity.description": "Bitte legen Sie ein Dokument für jede Person vor, die mindestens 25% des Kapitals oder der Stimmrechte besitzt oder jede Person, die die Geschäftsführung oder die Leitungsorgane Ihres Unternehmens kontrolliert.\n\nAkzeptable Dokumente:\n- Reisepass\n- Personalausweis (nur für Bürger von Mitgliedsländern der EWR-Zone)\n- Aufenthaltsgenehmigung (nur für Bewohner von Mitgliedsländern der EWR-Zone)\n- Führerschein (nur für Bewohner von Mitgliedsländern der EWR-Zone)",
"supportingDocuments.rejectionReason.BadDocumentQuality": "Die Qualität des Dokuments ist sehr niedrig",
"supportingDocuments.rejectionReason.CompanyNameMismatch": "Der im eingereichten Dokument angegebene Firmenname stimmt nicht mit unseren Aufzeichnungen überein.",
"supportingDocuments.rejectionReason.DeclaredAmountMismatch": "Der im eingereichten Dokument angegebene Betrag stimmt nicht mit unseren Aufzeichnungen überein.",
"supportingDocuments.rejectionReason.ExpiredDocument": "Das Ablaufdatum im eingereichten Dokument muss in den letzten 3 Monaten liegen.",
"supportingDocuments.rejectionReason.FullDocumentRequired": "Vollständiges Dokument erforderlich",
"supportingDocuments.rejectionReason.HandwrittenOrCertifiedElectronicSignatureRequired": "Die Unterschrift ist nicht handschriftlich oder elektronisch zertifiziert.",
"supportingDocuments.rejectionReason.IbanMismatch": "Die IBAN des Begünstigten im eingereichten Dokument stimmt nicht mit der Transaktionsanfrage überein.",
"supportingDocuments.rejectionReason.InvalidAddress": "Die Adresse im eingereichten Dokument stimmt nicht mit unseren Aufzeichnungen überein.",
"supportingDocuments.rejectionReason.InvalidDocument": "Das Dokument ist ungültig.",
"supportingDocuments.rejectionReason.InvalidOrMissingData": "Der Name des Aktionärs im eingereichten Dokument ist ungültig oder fehlt.",
"supportingDocuments.rejectionReason.InvalidTransaction": "Die Informationen im eingereichten Dokument stimmen nicht mit dieser spezifischen Transaktion überein.",
"supportingDocuments.rejectionReason.MissingAccommodationProviderId": "Ein Identitätsdokument für den Beherbergungsanbieter ist erforderlich.",
"supportingDocuments.rejectionReason.MissingAccommodationProviderIdLetter": "Die ID des Beherbergungsanbieters und ein Nachweis der Unterkunft sind erforderlich.",
"supportingDocuments.rejectionReason.MissingAccommodationProviderLetter": "Ein Nachweis der Unterkunft vom Anbieter ist erforderlich.",
"supportingDocuments.rejectionReason.MissingCompanyDomiciliationStatement": "Die Erklärung des Firmensitzes ist erforderlich.",
"supportingDocuments.rejectionReason.MissingDescription": "Es werden weitere Informationen benötigt, um die Art dieser Transaktion zu verstehen. Bitte reichen Sie zusätzliche Informationen ein.",
"supportingDocuments.rejectionReason.MissingProviderProofOfAddress": "Der Nachweis der Adresse des Beherbergungsanbieters ist erforderlich.",
"supportingDocuments.rejectionReason.MissingProviderProofOfAddressAndIdDocument": "Die ID und der Adressnachweis des Beherbergungsanbieters sind erforderlich.",
"supportingDocuments.rejectionReason.MissingSignature": "Das eingereichte Dokument muss unterschrieben oder datiert sein.",
"supportingDocuments.rejectionReason.PowerOfAttorneyToSwanRequired": "Eine Vollmacht muss an Swan übermittelt werden.",
"supportingDocuments.rejectionReason.ProviderColorIdDocumentRequired": "Das Dokument muss in Farbe eingereicht werden.",
"supportingDocuments.rejectionReason.TransactionAmountMismatch": "Der Transaktionsbetrag im eingereichten Dokument stimmt nicht mit der Transaktionsanfrage überein.",
"supportingDocuments.rejectionReason.TransactionDateMismatch": "Das Datum im eingereichten Dokument stimmt nicht mit der Transaktionsanfrage überein.",
"supportingDocuments.rejectionReason.TransactionNameMismatch": "Der Name des Ausstellers oder Begünstigten im eingereichten Dokument stimmt nicht mit der Transaktionsanfrage überein.",
"supportingDocuments.rejectionReason.UnacceptableDocument": "Das Dokument kann für den angeforderten Dokumenttyp nicht akzeptiert werden",
"taxIdentificationNumber.label": "Steueridentifikationsnummer",
"transactionStatement.creditor.accountNumber": "Kontonummer des Gläubigers",
"transactionStatement.creditor.bankIdentifier": "Bankleitzahl des Gläubigers",
Expand Down
25 changes: 25 additions & 0 deletions packages/shared-business/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,31 @@
"supportingDocuments.purpose.UltimateBeneficialOwnerProofOfAddress.description": "Include one document for each person who owns at least 25% of the capital or rights to vote, or any person who controls your company's executive bodies or management. Any document proving the individual's residence address. They must include the name and address of the individual and be dated less than 3 months old.\n\nAcceptable documents:\n- Documents related to the home (rental contract, mortgage statement, etc)\n- Home utility bills (for electricity, telephone, internet services, gas, water, etc)\n- Payroll (if it includes the worker's address)",
"supportingDocuments.purpose.UltimateBeneficialOwnerProofOfIdentity": "Identity document of each beneficial owner",
"supportingDocuments.purpose.UltimateBeneficialOwnerProofOfIdentity.description": "Include one document for each person who owns at least 25% of the capital or rights to vote, or any person who controls your company's executive bodies or management.\n\nAcceptable documents:\n- Passport\n- ID card (only applicable to citizens of member countries of the EEA zone)\n- Residence permit (only applicable to residents of member countries of the EEA zone)\n- Driver's license (only applicable to residents of member countries of the EEA zone)",
"supportingDocuments.rejectionReason.CompanyNameMismatch": "The company name in the document submitted doesn't match our records.",
"supportingDocuments.rejectionReason.DeclaredAmountMismatch": "The declared amount in the document submitted doesn't match our records.",
"supportingDocuments.rejectionReason.ExpiredDocument": "The expiry date in the document submitted must be within the past 3 months.",
"supportingDocuments.rejectionReason.InvalidAddress": "The address in the document submitted doesn't match our records.",
"supportingDocuments.rejectionReason.InvalidDocument": "The document is not valid.",
"supportingDocuments.rejectionReason.InvalidOrMissingData": "The shareholder's name in the document submitted is invalid or missing.",
"supportingDocuments.rejectionReason.MissingAccommodationProviderId": "An identity document for the accommodation provider is required.",
"supportingDocuments.rejectionReason.MissingAccommodationProviderIdLetter": "The accommodation provider’s ID and proof of accommodation are required.",
"supportingDocuments.rejectionReason.MissingAccommodationProviderLetter": "Proof of accommodation from the provider is required.",
"supportingDocuments.rejectionReason.UnacceptableDocument": "Document cannot be accepted for the requested document type",
"supportingDocuments.rejectionReason.ProviderColorIdDocumentRequired": "The document must be submitted in color.",
"supportingDocuments.rejectionReason.MissingSignature": "The document submitted must be signed or dated.",
"supportingDocuments.rejectionReason.BadDocumentQuality": "The quality of the document is really low",
"supportingDocuments.rejectionReason.FullDocumentRequired": "Full document required",
"supportingDocuments.rejectionReason.MissingProviderProofOfAddress": "The accommodation provider's proof of address is required.",
"supportingDocuments.rejectionReason.MissingProviderProofOfAddressAndIdDocument": "The accommodation provider's ID and proof of address are required.",
"supportingDocuments.rejectionReason.PowerOfAttorneyToSwanRequired": "Power of attorney must be provided to Swan.",
"supportingDocuments.rejectionReason.MissingCompanyDomiciliationStatement": "The company domiciliation statement is required.",
"supportingDocuments.rejectionReason.HandwrittenOrCertifiedElectronicSignatureRequired": "The signature is not handwritten or electronically certified.",
"supportingDocuments.rejectionReason.MissingDescription": "More information is needed to understand the nature of this transaction. Please submit additional information.",
"supportingDocuments.rejectionReason.InvalidTransaction": "The information in the document submitted doesn't match this specific transaction.",
"supportingDocuments.rejectionReason.TransactionNameMismatch": "The issuer or beneficiary name on the document submitted doesn't match the transaction request.",
"supportingDocuments.rejectionReason.TransactionDateMismatch": "The date on the document submitted doesn't match the transaction request.",
"supportingDocuments.rejectionReason.TransactionAmountMismatch": "The transaction amount on the document submitted doesn't match the transaction request.",
"supportingDocuments.rejectionReason.IbanMismatch": "The beneficiary IBAN on the document submitted doesn't match the transaction request.",
"taxIdentificationNumber.label": "Tax identification number",
"transactionStatement.creditor.accountNumber": "Creditor's account number",
"transactionStatement.creditor.bankIdentifier": "Creditor's bank identifier",
Expand Down
25 changes: 25 additions & 0 deletions packages/shared-business/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,31 @@
"supportingDocuments.purpose.UltimateBeneficialOwnerProofOfAddress.description": "Incluye un documento para cada persona que posea al menos el 25% del capital o derechos de voto, o cualquier persona que controle los órganos ejecutivos o la gestión de tu empresa. Cualquier documento que pruebe la dirección de residencia del individuo. Deben incluir el nombre y la dirección del individuo y tener una fecha de menos de 3 meses.\n\nDocumentos aceptables:\n- Documentos relacionados con la vivienda (contrato de alquiler, estado de la hipoteca, etc.)\n- Facturas de servicios domiciliarios (electricidad, teléfono, servicios de internet, gas, agua, etc.)\n- Nómina (si incluye la dirección del trabajador).",
"supportingDocuments.purpose.UltimateBeneficialOwnerProofOfIdentity": "Documento de identidad para cada Beneficiario Efectivo",
"supportingDocuments.purpose.UltimateBeneficialOwnerProofOfIdentity.description": "Incluye un documento para cada persona que posea al menos el 25% del capital o derechos de voto, o cualquier persona que controle los órganos ejecutivos o de gestión de tu empresa.\n\nDocumentos aceptables:\n- Pasaporte\n- DNI/Tarjeta de identidad (solo aplicable a ciudadanos de países miembros del Espacio Económico Europeo)\n- Permiso de residencia (solo aplicable a ciudadanos de países miembros del Espacio Económico Europeo)\n- Licencia de conducir (solo aplicable a ciudadanos de países miembros del Espacio Económico Europeo)",
"supportingDocuments.rejectionReason.BadDocumentQuality": "La calidad del documento es muy baja",
"supportingDocuments.rejectionReason.CompanyNameMismatch": "El nombre de la empresa en el documento presentado no coincide con nuestros registros.",
"supportingDocuments.rejectionReason.DeclaredAmountMismatch": "El monto declarado en el documento presentado no coincide con nuestros registros.",
"supportingDocuments.rejectionReason.ExpiredDocument": "La fecha de vencimiento en el documento presentado debe estar dentro de los últimos 3 meses.",
"supportingDocuments.rejectionReason.FullDocumentRequired": "Se requiere el documento completo",
"supportingDocuments.rejectionReason.HandwrittenOrCertifiedElectronicSignatureRequired": "La firma no es manuscrita o certificada electrónicamente.",
"supportingDocuments.rejectionReason.IbanMismatch": "El IBAN del beneficiario en el documento presentado no coincide con la solicitud de transacción.",
"supportingDocuments.rejectionReason.InvalidAddress": "La dirección en el documento presentado no coincide con nuestros registros.",
"supportingDocuments.rejectionReason.InvalidDocument": "El documento no es válido.",
"supportingDocuments.rejectionReason.InvalidOrMissingData": "El nombre del accionista en el documento presentado es inválido o está ausente.",
"supportingDocuments.rejectionReason.InvalidTransaction": "La información en el documento presentado no coincide con esta transacción específica.",
"supportingDocuments.rejectionReason.MissingAccommodationProviderId": "Se requiere un documento de identidad para el proveedor de alojamiento.",
"supportingDocuments.rejectionReason.MissingAccommodationProviderIdLetter": "Se requiere el ID del proveedor de alojamiento y la prueba de alojamiento.",
"supportingDocuments.rejectionReason.MissingAccommodationProviderLetter": "Se requiere una prueba de alojamiento del proveedor.",
"supportingDocuments.rejectionReason.MissingCompanyDomiciliationStatement": "Se requiere la declaración de domiciliación de la empresa.",
"supportingDocuments.rejectionReason.MissingDescription": "Se necesita más información para entender la naturaleza de esta transacción. Por favor, envía información adicional.",
"supportingDocuments.rejectionReason.MissingProviderProofOfAddress": "Se requiere la prueba de domicilio del proveedor de alojamiento.",
"supportingDocuments.rejectionReason.MissingProviderProofOfAddressAndIdDocument": "Se requiere el ID y la prueba de domicilio del proveedor de alojamiento.",
"supportingDocuments.rejectionReason.MissingSignature": "El documento presentado debe estar firmado o fechado.",
"supportingDocuments.rejectionReason.PowerOfAttorneyToSwanRequired": "Se debe proporcionar un poder notarial a Swan.",
"supportingDocuments.rejectionReason.ProviderColorIdDocumentRequired": "El documento debe ser presentado a color.",
"supportingDocuments.rejectionReason.TransactionAmountMismatch": "El monto de la transacción en el documento presentado no coincide con la solicitud de transacción.",
"supportingDocuments.rejectionReason.TransactionDateMismatch": "La fecha en el documento presentado no coincide con la solicitud de transacción.",
"supportingDocuments.rejectionReason.TransactionNameMismatch": "El nombre del emisor o beneficiario en el documento presentado no coincide con la solicitud de transacción.",
"supportingDocuments.rejectionReason.UnacceptableDocument": "El documento no puede ser aceptado para el tipo de documento solicitado",
"taxIdentificationNumber.label": "Número de identificación fiscal",
"transactionStatement.creditor.accountNumber": "Número de cuenta del acreedor",
"transactionStatement.creditor.bankIdentifier": "Identificador bancario del acreedor",
Expand Down
Loading
Loading