Skip to content

Commit

Permalink
Merge pull request #444 from swan-io/skip-supporting-docs
Browse files Browse the repository at this point in the history
Skip supporting documents step if none is uploadable
  • Loading branch information
bloodyowl authored Nov 15, 2023
2 parents 41c3752 + 52368c6 commit b9f1a4c
Show file tree
Hide file tree
Showing 13 changed files with 1,245 additions and 248 deletions.
2 changes: 2 additions & 0 deletions clients/banking/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@
"supportingDocuments.Banking.title": "Kontoauszug (weniger als 3 Monate alt)",
"supportingDocuments.CompanyRegistration.description": "Offizielles Dokument, das die rechtliche Existenz eines Unternehmens nachweist und Informationen über seine Rechtspersönlichkeit enthält.\n(weniger als 3 Monate alt)",
"supportingDocuments.CompanyRegistration.title": "Nachweis der Unternehmensregistrierung (weniger als 3 Monate alt)",
"supportingDocuments.GeneralAssemblyMinutes.description": "Protokoll der letzten Generalversammlung des Vereins.",
"supportingDocuments.GeneralAssemblyMinutes.title": "Protokoll der Generalversammlung",
"supportingDocuments.Other.description": "Sonstiges",
"supportingDocuments.Other.title": "Sonstiges",
"supportingDocuments.PowerOfAttorney.description": "Ein unterschriebenes und datiertes Dokument, das eine Person ermächtigt, den gesetzlichen Vertreter eines Unternehmens zu vertreten oder in dessen Namen zu handeln.",
Expand Down
2 changes: 2 additions & 0 deletions clients/banking/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@
"supportingDocuments.Banking.title": "Bank Statement (less than 3 months old)",
"supportingDocuments.CompanyRegistration.description": "Official document proving the legal existence of a company and providing information about its legal personality.\n(less than 3 months old)",
"supportingDocuments.CompanyRegistration.title": "Proof of company registration (less than 3 months old)",
"supportingDocuments.GeneralAssemblyMinutes.title": "General assembly minutes",
"supportingDocuments.GeneralAssemblyMinutes.description": "Minutes of the last general assembly of the association.",
"supportingDocuments.Other.description": "Other",
"supportingDocuments.Other.title": "Other",
"supportingDocuments.PowerOfAttorney.description": "A signed and dated document authorizing an individual to represent or act on behalf of a company's legal representative.",
Expand Down
2 changes: 2 additions & 0 deletions clients/banking/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@
"supportingDocuments.Banking.title": "Extracto bancario (< 3 meses de antigüedad)",
"supportingDocuments.CompanyRegistration.description": "Un documento oficial que acredite la existencia legal de una empresa y brinde información sobre su personalidad jurídica.\n(< 3 meses de antigüedad)",
"supportingDocuments.CompanyRegistration.title": "Prueba de registro de la empresa (< 3 meses de antigüedad)",
"supportingDocuments.GeneralAssemblyMinutes.description": "Acta de la última asamblea general de la asociación.",
"supportingDocuments.GeneralAssemblyMinutes.title": "Acta de la asamblea general",
"supportingDocuments.Other.description": "Otro",
"supportingDocuments.Other.title": "Otro",
"supportingDocuments.PowerOfAttorney.description": "Documento firmado y fechado que autoriza a una persona a representar o actuar en nombre del representante legal de una empresa.",
Expand Down
2 changes: 2 additions & 0 deletions clients/banking/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@
"supportingDocuments.Banking.title": "Relevé bancaire datant de moins de 3 mois",
"supportingDocuments.CompanyRegistration.description": "Document officiel prouvant l'existence légale d'une entreprise et fournissant des informations sur son statut juridique.\n(moins de 3 mois)",
"supportingDocuments.CompanyRegistration.title": "Preuve de l'enregistrement de l'entreprise (datant de moins de 3 mois)",
"supportingDocuments.GeneralAssemblyMinutes.description": "Compte-rendu de la dernière assemblée générale de l'association.",
"supportingDocuments.GeneralAssemblyMinutes.title": "Compte-rendu de l'assemblée générale",
"supportingDocuments.Other.description": "Autre",
"supportingDocuments.Other.title": "Autre",
"supportingDocuments.PowerOfAttorney.description": "Un document signé et daté autorisant une personne à représenter ou à agir au nom du représentant légal d'une entreprise.",
Expand Down
2 changes: 2 additions & 0 deletions clients/banking/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@
"supportingDocuments.Banking.title": "Estratto conto bancario (inferiore ai 3 mesi)",
"supportingDocuments.CompanyRegistration.description": "Documento ufficiale che attesta l'esistenza legale di una società e che fornisce informazioni sull'entità legale\n(inferiore ai 3 mesi)",
"supportingDocuments.CompanyRegistration.title": "Prova dell'iscrizione della società (inferiore ai 3 mesi)",
"supportingDocuments.GeneralAssemblyMinutes.description": "Verbali dell'ultima assemblea generale dell'associazione.",
"supportingDocuments.GeneralAssemblyMinutes.title": "Verbali dell'assemblea generale",
"supportingDocuments.Other.description": "Altro",
"supportingDocuments.Other.title": "Altro",
"supportingDocuments.PowerOfAttorney.description": "Un documento firmato e datato che autorizzi una persona fisica a rappresentare o ad agire per conto del legale rappresentante di una società.",
Expand Down
2 changes: 2 additions & 0 deletions clients/banking/src/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@
"supportingDocuments.Banking.title": "Bankafschrift (niet ouder dan 3 maanden)",
"supportingDocuments.CompanyRegistration.description": "Officieel document dat het juridische bestaan van een bedrijf bewijst en informatie geeft over haar rechtspersoonlijkheid.\n(niet ouder dan 3 maanden)",
"supportingDocuments.CompanyRegistration.title": "Bewijs van bedrijfsregistratie (niet ouder dan 3 maanden)",
"supportingDocuments.GeneralAssemblyMinutes.description": "Notulen van de laatste algemene vergadering van de vereniging.",
"supportingDocuments.GeneralAssemblyMinutes.title": "Notulen algemene vergadering",
"supportingDocuments.Other.description": "Andere",
"supportingDocuments.Other.title": "Andere",
"supportingDocuments.PowerOfAttorney.description": "Een ondertekend en gedateerd document dat een persoon machtigt om de wettelijke vertegenwoordiger van een bedrijf te vertegenwoordigen of op te treden namens deze.",
Expand Down
2 changes: 2 additions & 0 deletions clients/banking/src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@
"supportingDocuments.Banking.title": "Extrato bancário (com menos de 3 meses)",
"supportingDocuments.CompanyRegistration.description": "Documento oficial que comprova a existência legal de uma empresa e fornece informações sobre sua personalidade jurídica.\n(menos de 3 meses)",
"supportingDocuments.CompanyRegistration.title": "Prova de registo da empresa (com menos de 3 meses)",
"supportingDocuments.GeneralAssemblyMinutes.description": "Ata da última assembleia geral da associação.",
"supportingDocuments.GeneralAssemblyMinutes.title": "Ata da assembleia geral",
"supportingDocuments.Other.description": "Outros",
"supportingDocuments.Other.title": "Outros",
"supportingDocuments.PowerOfAttorney.description": "Um documento assinado e datado autorizando uma pessoa a representar ou agir em nome do representante legal de uma empresa.",
Expand Down
1 change: 1 addition & 0 deletions clients/banking/src/pages/AccountDetailsSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ const UpdateAccountForm = ({
fr: { name: "Français", cca3: "FRA" },
it: { name: "Italiano", cca3: "ITA" },
nl: { name: "Nederlands", cca3: "NLD" },
pt: { name: "Português", cca3: "PRT" },
};

return Dict.entries(map).map(([value, { name }]) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { isNotNullish, isNullish } from "@swan-io/lake/src/utils/nullish";
import {
Document,
SupportingDocumentPurpose,
uploadableDocumentTypes,
} from "@swan-io/shared-business/src/components/SupportingDocument";
import {
companyFallbackCountry,
Expand All @@ -28,6 +29,7 @@ import { OnboardingHeader } from "../../components/OnboardingHeader";
import {
CompanyAccountHolderFragment,
GetOnboardingQuery,
SupportingDocumentPurposeEnum,
UpdateCompanyOnboardingDocument,
} from "../../graphql/unauthenticated";
import { locale, t } from "../../utils/i18n";
Expand Down Expand Up @@ -91,6 +93,8 @@ const getPreviousStep = (
.getWithDefault(currentStep);
};

const uploadableDocuments: SupportingDocumentPurposeEnum[] = uploadableDocumentTypes;

export const OnboardingCompanyWizard = ({ onboarding, onboardingId, holder }: Props) => {
const route = Router.useRoute(companyOnboardingRoutes);

Expand Down Expand Up @@ -130,8 +134,9 @@ export const OnboardingCompanyWizard = ({ onboarding, onboardingId, holder }: Pr
const isRegistered = holder.isRegistered ?? true;

const requiredDocuments =
onboarding?.supportingDocumentCollection.requiredSupportingDocumentPurposes.map(d => d.name) ??
[];
onboarding?.supportingDocumentCollection.requiredSupportingDocumentPurposes
.map(d => d.name)
.filter(name => uploadableDocuments.includes(name)) ?? [];

const documents: Document[] =
onboarding?.supportingDocumentCollection.supportingDocuments.filter(isNotNullish).map(doc => ({
Expand Down
10 changes: 10 additions & 0 deletions scripts/graphql/dist/partner-idless-objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"AccountVerificationAlreadyRejectedRejection",
"AccountVerificationWrongStatusRejection",
"ActivatePhysicalCardSuccessPayload",
"ActiveMerchantPaymentLinkStatusInfo",
"AddAccountMembershipsSuccessPayload",
"AddAccountMembershipSuccessPayload",
"AddCardsSuccessPayload",
Expand Down Expand Up @@ -70,6 +71,7 @@
"CancelDigitalCardSuccessPayload",
"CanceledFundingSourceStatusInfo",
"CanceledIdentificationLevelStatusInfo",
"CanceledMerchantPaymentLinkStatusInfo",
"CanceledMerchantPaymentMethodStatusInfo",
"CanceledMerchantProfileStatusInfo",
"CanceledTransactionStatusInfo",
Expand Down Expand Up @@ -99,6 +101,7 @@
"CloseAccountSuccessPayload",
"CompanyInfo",
"CompanyShareholder",
"CompletedMerchantPaymentLinkStatusInfo",
"ConsentConnection",
"ConsentEdge",
"ConsentNotFoundRejection",
Expand All @@ -107,8 +110,10 @@
"ConsentsNotFoundRejection",
"ConsentTypeNotSupportedByServerConsentRejection",
"CreateCapitalDepositCaseSuccessPayload",
"CreateMerchantPaymentLinkSuccessPayload",
"CreateMultiConsentSuccessPayload",
"CsvStatement",
"Customer",
"DateField",
"DebtorAccountClosedRejection",
"DebtorAccountNotAllowedRejection",
Expand All @@ -135,6 +140,7 @@
"EnabledMerchantProfileStatusInfo",
"EnableReceivedDirectDebitMandateSuccessPayload",
"ExpiredIdentificationLevelStatusInfo",
"ExpiredMerchantPaymentLinkStatusInfo",
"ExternalAccountAlreadyExistsRejection",
"ExternalAccountBalanceAlreadyExistsRejection",
"ExternalAccountConnection",
Expand All @@ -146,6 +152,7 @@
"FeeInDebtor",
"FeeOutCreditor",
"FeeOutDebtor",
"FeeSettingsNotFoundRejection",
"FinalizeOnboardingSuccessPayload",
"ForbiddenRejection",
"FundingLimit",
Expand Down Expand Up @@ -223,6 +230,7 @@
"LegalDocumentInactiveStatusInfo",
"LegalDocumentUpcomingStatusInfo",
"LegalRepresentativeAccountMembershipCannotBeDisabledRejection",
"MerchantPaymentMethodNotActiveRejection",
"MerchantProfileConnection",
"MerchantProfileEdge",
"MerchantProfileWrongStatusRejection",
Expand Down Expand Up @@ -390,6 +398,8 @@
"SuspendPhysicalCardSuccessPayload",
"SuspendReceivedDirectDebitMandatedRejection",
"SuspendReceivedDirectDebitMandateSuccessPayload",
"SwanTCUDocumentNotFoundRejection",
"SwanTCUDocumentStatusNotAllowedRejection",
"TextField",
"TooManyChildConsentsRejection",
"TooManyItemsRejection",
Expand Down
Loading

0 comments on commit b9f1a4c

Please sign in to comment.