From 6666acebf46bf2c52feeb4f32b300a8667427d7d Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Fri, 19 Apr 2024 17:16:08 +0300 Subject: [PATCH 01/37] feat: added title page markup --- .../TitlePage/TitlePage.stories.tsx | 19 ++++ .../case-information/TitlePage/TitlePage.tsx | 83 ++++++++++++++++++ .../assets/title-page-ballerine-logo.png | Bin 0 -> 4530 bytes .../pdfs/case-information/TitlePage/index.ts | 1 + 4 files changed, 103 insertions(+) create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.stories.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/assets/title-page-ballerine-logo.png create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.stories.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.stories.tsx new file mode 100644 index 0000000000..c47b0d1c7a --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.stories.tsx @@ -0,0 +1,19 @@ +import { registerFont } from '@ballerine/react-pdf-toolkit'; +import { Document, Font, PDFViewer } from '@react-pdf/renderer'; +import { TitlePage } from './TitlePage'; + +registerFont(Font); + +export default { + component: TitlePage, +}; + +export const Default = { + render: () => ( + + + + + + ), +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.tsx new file mode 100644 index 0000000000..e4ac875086 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.tsx @@ -0,0 +1,83 @@ +import { Image, List, ListItem, Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { Page, View } from '@react-pdf/renderer'; +import poweredByLogo from './assets/title-page-ballerine-logo.png'; + +export const TitlePage = () => { + return ( + + + {/* Powered by section --- start */} + + Powered by + + + {/* Powered by section --- end */} + {/* Company Info section --- start */} + + + + Singapore Airlines Limited + {'\n'} Onboarding Data Report + + + {/* Company Info section --- end */} + {/* Document information section --- start*/} + + + Created at + + {new Date().toISOString()} + + {/* Document information section --- end*/} + {/* Table of contents section --- start */} + + + Table of Contents + + + + 1. Registry Information + + + 2. Company Ownership + + + 3. Company Sanctions + + + 4. Individual Identity verifications + + + 5. Individual PEP/Sanctions + + + + {/* Table of contents section --- end */} + {/* Disclaimer section --- start */} + + + Ballerine Inc. Report Disclaimer + + + This report is provided “as is” by Ballerine Inc. for informational purposes. It is + derived from data submitted by our Payfac customers and third parties. Ballerine Inc. + does not guarantee the accuracy, completeness, or usefulness of any information in the + report and is not responsible for any errors or omissions, or for results obtained from + the use of this information. + + + By using this report, you agree that Ballerine Inc. shall not be liable for any direct, + indirect, incidental, or consequential damages arising from your use of or reliance on + any information contained herein. This report is not intended to provide legal, + financial, or professional advice. + + + Use of this report is at your sole risk. Ballerine Inc. disclaims all liability for any + loss or damage arising out of your use of or reliance on the report. + + + {/* Disclaimer section --- end */} + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/assets/title-page-ballerine-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c6388031d755b4165c45bb13fb6b4371617fdc57 GIT binary patch literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h z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w~l$Sslf z{+xQx*0N^(I{|G6t{Ytu#nd`OMp$D7}H4_}Z2~khTCrJfD2qCLsi|HMEUp`^_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ literal 0 HcmV?d00001 diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts new file mode 100644 index 0000000000..4a5067236c --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts @@ -0,0 +1 @@ +export * from './TitlePage'; From f92550e5020be1de0425127e7d406b13ea9c733c Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Fri, 19 Apr 2024 18:19:04 +0300 Subject: [PATCH 02/37] feat: added registry information page report --- .../CaseInformationDisclaimer.tsx | 27 ++++ .../CaseInformationPageContainer.tsx | 16 +++ .../CaseInformationPageHeader.tsx | 20 +++ .../CaseInformationPageSection.tsx | 12 ++ .../CaseInformationPageSectionHeader.tsx | 19 +++ .../RegistryInformationPage.tsx | 116 ++++++++++++++++++ .../assets/title-page-ballerine-logo.png | Bin 0 -> 4530 bytes .../pages/RegistryInformationPage/index.ts | 1 + .../pages/TitlePage/TitlePage.stories.tsx | 19 +++ .../pages/TitlePage/TitlePage.tsx | 60 +++++++++ .../case-information/pages/TitlePage/index.ts | 1 + 11 files changed, 291 insertions(+) create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/assets/title-page-ballerine-logo.png create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/index.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.stories.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer.tsx new file mode 100644 index 0000000000..12b413b1c6 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer.tsx @@ -0,0 +1,27 @@ +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; + +export const CaseInformationDisclaimer = () => ( + + + Ballerine Inc. Report Disclaimer + + + This report is provided “as is” by Ballerine Inc. for informational purposes. It is derived + from data submitted by our Payfac customers and third parties. Ballerine Inc. does not + guarantee the accuracy, completeness, or usefulness of any information in the report and is + not responsible for any errors or omissions, or for results obtained from the use of this + information. + + + By using this report, you agree that Ballerine Inc. shall not be liable for any direct, + indirect, incidental, or consequential damages arising from your use of or reliance on any + information contained herein. This report is not intended to provide legal, financial, or + professional advice. + + + Use of this report is at your sole risk. Ballerine Inc. disclaims all liability for any loss + or damage arising out of your use of or reliance on the report. + + +); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx new file mode 100644 index 0000000000..a3a8c4197a --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx @@ -0,0 +1,16 @@ +import { tw } from '@ballerine/react-pdf-toolkit'; +import { AnyChildren } from '@ballerine/ui'; +import { Page, View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +interface ICaseInformationPageContainer { + children: AnyChildren; +} + +export const CaseInformationPageContainer: FunctionComponent = ({ + children, +}) => ( + + {children} + +); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader.tsx new file mode 100644 index 0000000000..164542c20d --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader.tsx @@ -0,0 +1,20 @@ +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { Image, View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +interface ICaseInformationPageHeaderProps { + companyLogo: string; + companyName: string; +} + +export const CaseInformationPageHeader: FunctionComponent = ({ + companyLogo, + companyName, +}) => ( + + + + {companyName} + + +); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx new file mode 100644 index 0000000000..108485a5a5 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx @@ -0,0 +1,12 @@ +import { tw } from '@ballerine/react-pdf-toolkit'; +import { AnyChildren } from '@ballerine/ui'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +interface ICaseInformationPageSectionProps { + children: AnyChildren; +} + +export const CaseInformationPageSection: FunctionComponent = ({ + children, +}) => {children}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader.tsx new file mode 100644 index 0000000000..63da36cb51 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader.tsx @@ -0,0 +1,19 @@ +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +interface ICaseInformationPageSectionHeaderProps { + title: string; + subtitle: string; +} + +export const CaseInformationPageSectionHeader: FunctionComponent< + ICaseInformationPageSectionHeaderProps +> = ({ title, subtitle }) => ( + + + {title} + + {subtitle} + +); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx new file mode 100644 index 0000000000..fb2180d066 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx @@ -0,0 +1,116 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { Link, Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import poweredByLogo from './assets/title-page-ballerine-logo.png'; + +interface IRegistryItem { + key: string; + title: string; + value: string; + valueType?: 'text' | 'link'; +} + +const registryItems: IRegistryItem[] = [ + { + key: 'name', + title: 'Name', + value: 'Singapore Airlines Limited', + }, + { + key: 'registrationNumber', + title: 'Registration number', + value: '128947342867', + }, + { + key: 'incorporationDate', + title: 'Incorporation date', + value: '12/12/2012', + }, + { + key: 'companyType', + title: 'Company type', + value: 'Public Company', + }, + { + key: 'currentStatus', + title: 'Current status', + value: 'Active', + }, + { + key: 'lastUpdate', + title: 'Last update', + value: '12/12/2021', + }, + { + key: 'registeredAddress', + title: 'Registered Address', + value: 'Singapore', + }, + { + key: 'createdAt', + title: 'Created at', + value: '12/12/2021', + }, + { + key: 'registryPage', + title: 'Registry page', + value: 'https://www.example.com', + valueType: 'link', + }, +]; + +export const RegistryInformationPage = () => { + return ( + + + + + + + + {/* Registry Information section --- start */} + + + + {registryItems.map(item => ( + + {item.title} + + ))} + + + {registryItems.map(item => + item.valueType === 'link' ? ( + + ) : ( + + {item.value} + + ), + )} + + + {/* Registry Information section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/assets/title-page-ballerine-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c6388031d755b4165c45bb13fb6b4371617fdc57 GIT binary patch literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALE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PdsQRxIyB1KS!w!1(CD zLH>F}m|6cR1c%em^{2J2Quy{@yL`z8#A`enw1EO-IntV1p9Wl$n#!qqP3w~l$Sslf z{+xQx*0N^(I{|G6t{Ytu#nd`OMp$D7}H4_}Z2~khTCrJfD2qCLsi|HMEUp`^_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ literal 0 HcmV?d00001 diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/index.ts new file mode 100644 index 0000000000..ecc32147f3 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/index.ts @@ -0,0 +1 @@ +export * from './RegistryInformationPage'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.stories.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.stories.tsx new file mode 100644 index 0000000000..c47b0d1c7a --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.stories.tsx @@ -0,0 +1,19 @@ +import { registerFont } from '@ballerine/react-pdf-toolkit'; +import { Document, Font, PDFViewer } from '@react-pdf/renderer'; +import { TitlePage } from './TitlePage'; + +registerFont(Font); + +export default { + component: TitlePage, +}; + +export const Default = { + render: () => ( + + + + + + ), +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx new file mode 100644 index 0000000000..63c140cef7 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx @@ -0,0 +1,60 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { Image, List, ListItem, Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import poweredByLogo from './assets/title-page-ballerine-logo.png'; + +export const TitlePage = () => { + return ( + + {/* Powered by section --- start */} + + Powered by + + + {/* Powered by section --- end */} + {/* Company Info section --- start */} + + + + Singapore Airlines Limited + {'\n'} Onboarding Data Report + + + {/* Company Info section --- end */} + {/* Document information section --- start*/} + + + Created at + + {new Date().toISOString()} + + {/* Document information section --- end*/} + {/* Table of contents section --- start */} + + + Table of Contents + + + + 1. Registry Information + + + 2. Company Ownership + + + 3. Company Sanctions + + + 4. Individual Identity verifications + + + 5. Individual PEP/Sanctions + + + + {/* Table of contents section --- end */} + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts new file mode 100644 index 0000000000..4a5067236c --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts @@ -0,0 +1 @@ +export * from './TitlePage'; From cfb9feba3cf08619d8b8fec29d7191b84ece0420 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Fri, 19 Apr 2024 18:37:44 +0300 Subject: [PATCH 03/37] feat: added company ownership page --- .../CompanyOwnershipPage.tsx | 104 ++++++++++++++++++ .../assets/title-page-ballerine-logo.png | Bin 0 -> 4530 bytes .../pages/CompanyOwnershipPage/index.ts | 1 + 3 files changed, 105 insertions(+) create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/assets/title-page-ballerine-logo.png create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx new file mode 100644 index 0000000000..da913fd37c --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx @@ -0,0 +1,104 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import poweredByLogo from './assets/title-page-ballerine-logo.png'; + +interface ICompanyOwnershipItem { + name: string; + type: string; + percentage: string; + level: number; +} + +const tableItems: ICompanyOwnershipItem[] = [ + { + name: 'AIR STAR ALLIANCE GLOBAL SINGAPORE PTE. LTD.', + type: 'COMPANY', + percentage: '100%', + level: 1, + }, + { + name: 'MENG, XIANGHONG', + type: 'PERSON', + percentage: '100%', + level: 3, + }, +]; + +export const CompanyOwnershipPage = () => { + return ( + + + + + + + + {/* Company Ownership section --- start */} + + + + {/* Table Header --- start */} + + + + Name + + + + + Type + + + + + Percentage + + + + + Level + + + + {/* Table Header --- end */} + + {/* Table Body --- start */} + {tableItems.map(item => ( + + + + {item.name} + + + + {item.type} + + + {item.percentage} + + + {item.level} + + + ))} + {/* Table Body --- end */} + + {/* Company Ownership section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/assets/title-page-ballerine-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c6388031d755b4165c45bb13fb6b4371617fdc57 GIT binary patch literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h zK_fy4AyEgb=a{JhOn3#-q;`J|hx92q9!qB9=EEiq1rSag^l=gb+d&We0nw9WgHg zd)Tk0V?-7qge-)>Zag-)3>EBU3Lu0KvIr6D>#TKFVV#B0jYY`yqVIY@J7`py8r4Y* zyh1swJG=EWw0m3z{mku;&+^ug_8Sm#_>}Sx+O9re9KrZt$*PN-=N|0<@YoIAJj;L3 z2Gx)mC}}|cVNCZEE{ndL76T%<4$^nxOOd`UPg>NyY8edu3*#M=>IxX=-{1^57k#(S z)t%sQBF2v(tH$ao3b-tHu)Ed->qe*LpJx({TGO5Rg4?D>xgZd$t_mavfvw+RkjzZ{ z1?8|lpi7T-b%fm*)2_Xd%~?Jjb?Z_0+Ue~;LqgV1fbE^oG!djYr3{FtWBV1Cr!l7E zD5WK!H6)K9WW5AOTC0nlI9S4fkn5qs)|Y1u0Ic zC@kv?MAPYrR=WSEpH27k*G~S2cCDmAnKcv6kfxz)BR_-Tret00VRy5#?asgw1|**N zypdAHkbdZMR zS>x-KJJ=0e19A=lclVO@q5ZpX zA?rhp$hT-W3+{24nS9&*jjWu2`8K#&rN6e)XJfp6hxHR-ua6W0+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&bW4ZM?$IvTf7{8Fy#Q8p$`_1jIpR7^ z1Aio3h52{S&aHn<=(}>sV3)KmLe|NYJ#jgFu|8@29>^B0A<@FBo2h{vO{*R9yY6~D z{z5yU3YU#p_v~2SgB;T!FN|6T2H#^ow`7C$hoG0H!e#H-dWtoEIZu3)qv!<8P8rBjb?9=8wxYy(uHU1UypJju#k$b*v@6mgURA}4k2J>yE z)aR|<2hPaXO)?@C=AA9-OlQu);3^UL)^Q@%OT^`To$C8mcZr}Z70Q%PjZqr7i1C_; zaq0zhRmev$Pt@cN{%5~4>W(Obzw4K#GhC8ivV)Q$l_w|m| zi|VkrVg$AhbZbZ>MqOI2l6C*46aBL0n9ES}RoBE%T{#-$BPdsQRxIyB1KS!w!1(CD zLH>F}m|6cR1c%em^{2J2Quy{@yL`z8#A`enw1EO-IntV1p9Wl$n#!qqP3w~l$Sslf z{+xQx*0N^(I{|G6t{Ytu#nd`OMp$D7}H4_}Z2~khTCrJfD2qCLsi|HMEUp`^_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ literal 0 HcmV?d00001 diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts new file mode 100644 index 0000000000..d6568df34c --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts @@ -0,0 +1 @@ +export * from './CompanyOwnershipPage'; From e1d0ad1deb07eee9ed630f934c0be5b43978e01f Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Fri, 19 Apr 2024 19:38:02 +0300 Subject: [PATCH 04/37] feat: added company sanctions page --- .../CompanySanctionsPage.tsx | 199 ++++++++++++++++++ .../assets/title-page-ballerine-logo.png | Bin 0 -> 4530 bytes .../CompanySanctionsMatchSection.tsx | 133 ++++++++++++ .../pages/CompanySanctionsPage/index.ts | 1 + 4 files changed, 333 insertions(+) create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/assets/title-page-ballerine-logo.png create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx new file mode 100644 index 0000000000..0d9d3a2497 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx @@ -0,0 +1,199 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { + CompanySanctionsMatchSection, + ICompanySanctionsMatchSectionAddress, +} from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection'; +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import poweredByLogo from './assets/title-page-ballerine-logo.png'; + +interface ICompanySanctionsItem { + primaryName: string; + lastReviewed: string; + labels: string[]; + matchReasons: string[]; + //urls + sources: string[]; + //address line + addresses: ICompanySanctionsMatchSectionAddress[]; +} + +const matches: ICompanySanctionsItem[] = [ + { + primaryName: 'Singapore Airlines Limited', + lastReviewed: '12/12/2021', + labels: [ + 'PEP', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'PEP', + 'Sanction', + 'PEP', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'PEP', + 'Sanction', + 'PEP', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'Sanction', + 'PEP', + 'Sanction', + ], + matchReasons: [ + 'Name', + 'Address', + 'Address', + 'Address', + 'Address', + 'Address', + 'Address', + 'Address', + 'Name', + 'Address', + 'Address', + 'Address', + 'Address', + 'Address', + 'Address', + 'Address', + 'Name', + 'Address', + 'Address', + 'Address', + 'Address', + 'Address', + 'Address', + 'Address', + ], + sources: [ + 'https://www.singaporeairlines.com', + 'https://www.example.com', + 'https://www.example.com', + 'https://www.example.com', + 'https://www.example.com', + 'https://www.example.com', + 'https://www.example.com', + 'https://www.example.com', + ], + addresses: [ + { + addresses: [ + 'Sutton yard, 65 Goswell Road, London, United Kingdom', + 'Sutton yard, 65 Goswell Road, London, United Kingdom', + 'Sutton yard, 65 Goswell Road, London, United Kingdom', + 'Sutton yard, 65 Goswell Road, London, United Kingdom', + ], + city: 'London', + country: 'United Kingdom', + }, + { + addresses: ['Sutton yard, 65 Goswell Road, London, United Kingdom'], + city: 'London', + country: 'United Kingdom', + }, + ], + }, + { + primaryName: 'Singapore Airlines Limited', + lastReviewed: '12/12/2021', + labels: ['PEP', 'Sanction'], + matchReasons: ['Name', 'Address'], + sources: [ + 'https://www.singaporeairlines.com', + 'https://www.example.com', + 'https://www.example.com', + ], + addresses: [ + { + addresses: ['Sutton yard, 65 Goswell Road, London, United Kingdom'], + city: 'London', + country: 'United Kingdom', + }, + { + addresses: ['Sutton yard, 65 Goswell Road, London, United Kingdom'], + city: 'London', + country: 'United Kingdom', + }, + ], + }, +]; + +export const CompanySanctionsPage = () => { + return ( + + + + + + + + {/* Company Sanctions section --- start */} + + + + + + Scan Status + + + Completed + + + + + Total Matches + + + + {matches.length} + {' matches'} + + + + + {matches.map((item, index) => ( + + ))} + + {/* Company Sanctions section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/assets/title-page-ballerine-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c6388031d755b4165c45bb13fb6b4371617fdc57 GIT binary patch literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h zK_fy4AyEgb=a{JhOn3#-q;`J|hx92q9!qB9=EEiq1rSag^l=gb+d&We0nw9WgHg zd)Tk0V?-7qge-)>Zag-)3>EBU3Lu0KvIr6D>#TKFVV#B0jYY`yqVIY@J7`py8r4Y* zyh1swJG=EWw0m3z{mku;&+^ug_8Sm#_>}Sx+O9re9KrZt$*PN-=N|0<@YoIAJj;L3 z2Gx)mC}}|cVNCZEE{ndL76T%<4$^nxOOd`UPg>NyY8edu3*#M=>IxX=-{1^57k#(S z)t%sQBF2v(tH$ao3b-tHu)Ed->qe*LpJx({TGO5Rg4?D>xgZd$t_mavfvw+RkjzZ{ z1?8|lpi7T-b%fm*)2_Xd%~?Jjb?Z_0+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4J*M%7LmDDx2{?`tDNj4Zi zf=F=iN*rGwjuXE+qa>o8GC$&SsLM!CgMGq$>m0$Dt^vaqhuFgAqSAne9Y`s(KJ}b9 z>)$M}%Z@+lfw8&*p_pt__c#M3+!FV_LvY!=Aa()2V7>vzcZF;tuIW(ywAcSHT)l-TDr_hBF3o~&{e_C1K_^zDWbCyfsLI} zXG9qU_WKZnzLL5wrQcfTrR04-^ReUHwIkJ&bW4ZM?$IvTf7{8Fy#Q8p$`_1jIpR7^ z1Aio3h52{S&aHn<=(}>sV3)KmLe|NYJ#jgFu|8@29>^B0A<@FBo2h{vO{*R9yY6~D z{z5yU3YU#p_v~2SgB;T!FN|6T2H#^ow`7C$hoG0H!e#H-dWtoEIZu3)qv!<8P8rBjb?9=8wxYy(uHU1UypJju#k$b*v@6mgURA}4k2J>yE z)aR|<2hPaXO)?@C=AA9-OlQu);3^UL)^Q@%OT^`To$C8mcZr}Z70Q%PjZqr7i1C_; zaq0zhRmev$Pt@cN{%5~4>W(Obzw4K#GhC8ivV)Q$l_w|m| zi|VkrVg$AhbZbZ>MqOI2l6C*46aBL0n9ES}RoBE%T{#-$BPdsQRxIyB1KS!w!1(CD zLH>F}m|6cR1c%em^{2J2Quy{@yL`z8#A`enw1EO-IntV1p9Wl$n#!qqP3w~l$Sslf z{+xQx*0N^(I{|G6t{Ytu#nd`OMp$D7}H4_}Z2~khTCrJfD2qCLsi|HMEUp`^_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ literal 0 HcmV?d00001 diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection.tsx new file mode 100644 index 0000000000..b3b8e54c24 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection.tsx @@ -0,0 +1,133 @@ +import { Link, Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +export interface ICompanySanctionsMatchSectionAddress { + addresses: string[]; + city: string; + country: string; +} + +interface ICompanySanctionsMatchSectionProps { + primaryName: string; + matchNumber: number; + lastReviewedDate: string; + labels: string[]; + matchReasons: string[]; + sources: string[]; + addresses: ICompanySanctionsMatchSectionAddress[]; +} + +export const CompanySanctionsMatchSection: FunctionComponent< + ICompanySanctionsMatchSectionProps +> = ({ primaryName, matchNumber, lastReviewedDate, labels, matchReasons, sources, addresses }) => { + return ( + + + Match {matchNumber} + + + + + + + Primary Name + + + + {primaryName} + + + + + + Last Reviewed + + + + + {lastReviewedDate} + + + + + + + Labels + + + + + {labels?.join(' - ')} + + + + + + + Reasons for Match + + + + + {matchReasons?.join(' - ')} + + + + + + + Sources + + + + {sources.map(url => ( + + ))} + + + + + + {/* Table Header --- start */} + + + + Addresses + + + + + City + + + + + Country + + + + {/* Table Header --- end */} + + {/* Table Body --- start */} + {addresses.map((item, index) => ( + + + + {item.addresses.join(' , ')} + + + + {item.city} + + + {item.country} + + + ))} + {/* Table Body --- end */} + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts new file mode 100644 index 0000000000..e80f6bb04c --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts @@ -0,0 +1 @@ +export * from './CompanySanctionsPage'; From d33c33dfd23e9f18c3b1fe0f52bc613f92bceaba Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Sat, 20 Apr 2024 18:49:54 +0300 Subject: [PATCH 05/37] feat: added identity verifications page --- .../CaseInformationPageSectionHeader.tsx | 2 +- .../IdentityVerificationsPage.tsx | 65 ++++++++ .../assets/title-page-ballerine-logo.png | Bin 0 -> 4530 bytes .../components/IdentityItem/IdentityItem.tsx | 142 ++++++++++++++++++ .../pages/IdentityVerificationsPage/index.ts | 1 + 5 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/assets/title-page-ballerine-logo.png create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader.tsx index 63da36cb51..fc527ef8e1 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader.tsx @@ -4,7 +4,7 @@ import { FunctionComponent } from 'react'; interface ICaseInformationPageSectionHeaderProps { title: string; - subtitle: string; + subtitle?: string; } export const CaseInformationPageSectionHeader: FunctionComponent< diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx new file mode 100644 index 0000000000..65ccda8cba --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx @@ -0,0 +1,65 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { + IIdentityItem, + IdentityItem, +} from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem'; +import { tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import poweredByLogo from './assets/title-page-ballerine-logo.png'; + +const identities: IIdentityItem[] = [ + { + checkedAt: '12/12/2021', + result: 'approved', + reason: 'Matched with known PEP', + firstName: 'John', + lastName: 'Doe', + dateOfBirth: '01/01/1990', + id: '123', + gender: 'Male', + nationality: 'Singaporean', + }, + { + checkedAt: '12/12/2021', + result: 'rejected', + reason: 'Matched with known PEP', + firstName: 'Jane', + lastName: 'Doe', + dateOfBirth: '01/01/1990', + id: '123', + gender: 'Female', + nationality: 'Singaporean', + }, +]; + +export const IdentityVerificationsPage = () => { + return ( + + + + + + + + {/* Individual Identity verifications section --- start */} + + + {identities.map((item, index) => ( + + ))} + + {/* Individual Identity verifications section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/assets/title-page-ballerine-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c6388031d755b4165c45bb13fb6b4371617fdc57 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=AA9-OlQu);3^UL)^Q@%OT^`To$C8mcZr}Z70Q%PjZqr7i1C_; zaq0zhRmev$Pt@cN{%5~4>W(Obzw4K#GhC8ivV)Q$l_w|m| zi|VkrVg$AhbZbZ>MqOI2l6C*46aBL0n9ES}RoBE%T{#-$BPdsQRxIyB1KS!w!1(CD zLH>F}m|6cR1c%em^{2J2Quy{@yL`z8#A`enw1EO-IntV1p9Wl$n#!qqP3w~l$Sslf z{+xQx*0N^(I{|G6t{Ytu#nd`OMp$D7}H4_}Z2~khTCrJfD2qCLsi|HMEUp`^_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ literal 0 HcmV?d00001 diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx new file mode 100644 index 0000000000..4fd6cc383f --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx @@ -0,0 +1,142 @@ +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +export interface IIdentityItem { + checkedAt: string; + result: 'approved' | 'rejected'; + reason: string; + firstName: string; + lastName: string; + dateOfBirth: string; + id: string; + gender: string; + nationality: string; +} + +interface IIdentityItemProps { + item: IIdentityItem; +} + +export const IdentityItem: FunctionComponent = ({ item }) => { + const { checkedAt, reason, result, firstName, lastName, dateOfBirth, id, gender, nationality } = + item; + + return ( + + + {`${firstName} ${lastName}`} + + + + + + Checked at + + + + {checkedAt} + + + + + + Result + + + + {result === 'approved' && ( + + Approved + + )} + {result === 'rejected' && ( + + Rejected + + )} + + + + + + Reason + + + + {reason} + + + + + + First Name + + + + {firstName} + + + + + + Last Name + + + + {lastName} + + + + + + Date of Birth + + + + {dateOfBirth} + + + + + + ID Number + + + + {id} + + + + + + Gender + + + + {gender} + + + + + + Nationality + + + + {nationality} + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts new file mode 100644 index 0000000000..f577e5d1e3 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts @@ -0,0 +1 @@ +export * from './IdentityVerificationsPage'; From e6d42b737b0be8d806bc7dedb9451bc34aa88286 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 24 Apr 2024 13:25:29 +0300 Subject: [PATCH 06/37] feat: added individual sanctions page --- .../IndividualSanctionsPage.tsx | 65 +++++++++ .../assets/title-page-ballerine-logo.png | Bin 0 -> 4530 bytes .../IndividualSanctionsItem.tsx | 130 ++++++++++++++++++ .../IndividualSanctionsItem/ValueOrNone.tsx | 39 ++++++ .../IndividualSanctionsItem/value-or-none.ts | 3 + .../pages/IndividualSanctionsPage/index.ts | 1 + .../assets/title-page-ballerine-logo.png | Bin 0 -> 4530 bytes 7 files changed, 238 insertions(+) create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/assets/title-page-ballerine-logo.png create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/value-or-none.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/index.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx new file mode 100644 index 0000000000..b68777d0cf --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx @@ -0,0 +1,65 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { + IIndividualSanctionsItem, + IndividualSanctionsItem, +} from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem'; +import { tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import poweredByLogo from '../TitlePage/assets/title-page-ballerine-logo.png'; + +const individualSanctions: IIndividualSanctionsItem[] = [ + { + checkedAt: '12/12/2021', + matchesCount: 2, + names: ['John Doe', 'Jane Doe'], + warnings: [], + sanctions: [], + PEP: [], + adverseMedia: [], + firstName: 'John', + lastName: 'Doe', + }, + { + checkedAt: '12/12/2021', + matchesCount: 0, + names: ['John Doe', 'Jane Doe'], + warnings: ['Matched with known PEP', 'Matched with known PEP'], + sanctions: ['PEP', 'PEP'], + PEP: ['PEP', 'PEP'], + adverseMedia: ['PEP', 'PEP'], + firstName: 'John', + lastName: 'Doe', + }, +]; + +export const IndividualSanctionsPage = () => { + return ( + + + + + + + + {/* Company Sanctions section --- start */} + + + {individualSanctions.map((item, index) => ( + + ))} + + {/* Company Sanctions section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/assets/title-page-ballerine-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c6388031d755b4165c45bb13fb6b4371617fdc57 GIT binary patch literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h zK_fy4AyEgb=a{JhOn3#-q;`J|hx92q9!qB9=EEiq1rSag^l=gb+d&We0nw9WgHg zd)Tk0V?-7qge-)>Zag-)3>EBU3Lu0KvIr6D>#TKFVV#B0jYY`yqVIY@J7`py8r4Y* zyh1swJG=EWw0m3z{mku;&+^ug_8Sm#_>}Sx+O9re9KrZt$*PN-=N|0<@YoIAJj;L3 z2Gx)mC}}|cVNCZEE{ndL76T%<4$^nxOOd`UPg>NyY8edu3*#M=>IxX=-{1^57k#(S z)t%sQBF2v(tH$ao3b-tHu)Ed->qe*LpJx({TGO5Rg4?D>xgZd$t_mavfvw+RkjzZ{ z1?8|lpi7T-b%fm*)2_Xd%~?Jjb?Z_0+Ue~;LqgV1fbE^oG!djYr3{FtWBV1Cr!l7E zD5WK!H6)K9WW5AOTC0nlI9S4fk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>m0$Dt^vaqhuFgAqSAne9Y`s(KJ}b9 z>)$M}%Z@+lfw8&*p_pt__c#M3+!FV_LvY!=Aa()2V7>vzcZF;tuIW(ywAcSHT)l-TDr_hBF3o~&{e_C1K_^zDWbCyfsLI} zXG9qU_WKZnzLL5wrQcfTrR04-^ReUHwIkJ&bW4ZM?$IvTf7{8Fy#Q8p$`_1jIpR7^ z1Aio3h52{S&aHn<=(}>sV3)KmLe|NYJ#jgFu|8@29>^B0A<@FBo2h{vO{*R9yY6~D z{z5yU3YU#p_v~2SgB;T!FN|6T2H#^ow`7C$hoG0H!e#H-dWtoEIZu3)qv!<8P8rBjb?9=8wxYy(uHU1UypJju#k$b*v@6mgURA}4k2J>yE z)aR|<2hPaXO)?@C=AA9-OlQu);3^UL)^Q@%OT^`To$C8mcZr}Z70Q%PjZqr7i1C_; zaq0zhRmev$Pt@cN{%5~4>W(Obzw4K#GhC8ivV)Q$l_w|m| zi|VkrVg$AhbZbZ>MqOI2l6C*46aBL0n9ES}RoBE%T{#-$BPdsQRxIyB1KS!w!1(CD zLH>F}m|6cR1c%em^{2J2Quy{@yL`z8#A`enw1EO-IntV1p9Wl$n#!qqP3w~l$Sslf z{+xQx*0N^(I{|G6t{Ytu#nd`OMp$D7}H4_}Z2~khTCrJfD2qCLsi|HMEUp`^_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ literal 0 HcmV?d00001 diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx new file mode 100644 index 0000000000..5a83938dbb --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx @@ -0,0 +1,130 @@ +import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +export interface IIndividualSanctionsItem { + checkedAt: string; + matchesCount: number; + names: string[]; + warnings: string[]; + sanctions: string[]; + PEP: string[]; + adverseMedia: string[]; + firstName: string; + lastName: string; +} + +interface IIndividualSanctionsItemProps { + item: IIndividualSanctionsItem; +} + +export const IndividualSanctionsItem: FunctionComponent = ({ + item, +}) => { + const { + checkedAt, + matchesCount, + names, + warnings, + sanctions, + PEP, + adverseMedia, + firstName, + lastName, + } = item; + + return ( + + + {`${firstName} ${lastName}`} + + + + + + Checked at + + + + + + + + + + Result + + + + + {`${matchesCount} Matche${matchesCount === 1 ? '' : 's'}`} + + + + + + + Names + + + + + + + + + + Warnings + + + + + + + + + + Sanctions + + + + + + + + + + PEP + + + + + + + + + + Adverse Media + + + + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx new file mode 100644 index 0000000000..07ae150f10 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx @@ -0,0 +1,39 @@ +import { valueOrFallback } from '@/common/utils/value-or-fallback/value-or-fallback'; +import { valueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/value-or-none'; +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { AnyChildren } from '@ballerine/ui'; +import { FunctionComponent } from 'react'; + +interface IValueOrNoneProps { + value?: unknown; +} + +const NONE_TEXT_HEX_COLOR = '#999999'; +const valueOrNoneTextColor = valueOrFallback(NONE_TEXT_HEX_COLOR, { checkFalsy: true }); + +export const ValueOrNone: FunctionComponent = ({ value }) => { + console.log( + { value }, + `text-[8px] leading-[1.45rem] ${ + valueOrNoneTextColor(value) === NONE_TEXT_HEX_COLOR + ? `text-[${valueOrNoneTextColor(value)}]` + : '' + }}`, + ); + + return ( + + {valueOrNone(value) as AnyChildren} + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/value-or-none.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/value-or-none.ts new file mode 100644 index 0000000000..0ce55373d9 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/value-or-none.ts @@ -0,0 +1,3 @@ +import { valueOrFallback } from '@/common/utils/value-or-fallback/value-or-fallback'; + +export const valueOrNone = valueOrFallback('None', { checkFalsy: true }); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/index.ts new file mode 100644 index 0000000000..51a9dd6c3e --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/index.ts @@ -0,0 +1 @@ +export * from './IndividualSanctionsPage'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c6388031d755b4165c45bb13fb6b4371617fdc57 GIT binary patch literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNsh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$l_w|m| zi|VkrVg$AhbZbZ>MqOI2l6C*46aBL0n9ES}RoBE%T{#-$BPdsQRxIyB1KS!w!1(CD zLH>F}m|6cR1c%em^{2J2Quy{@yL`z8#A`enw1EO-IntV1p9Wl$n#!qqP3w~l$Sslf z{+xQx*0N^(I{|G6t{Ytu#nd`OMp$D7}H4_}Z2~khTCrJfD2qCLsi|HMEUp`^_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ literal 0 HcmV?d00001 From dbddedb85a19649d4e92ed771c8a80ee3e3f21be Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 24 Apr 2024 14:53:29 +0300 Subject: [PATCH 07/37] feat: added validation schemas --- .../pdfs/case-information/TitlePage/index.ts | 1 + .../TitlePage/title-page.schema.ts | 3 + .../company-ownership.schema.ts | 13 ++++ .../pages/CompanyOwnershipPage/index.ts | 1 + .../company-sanctions.schema.ts | 15 +++++ .../pages/CompanySanctionsPage/index.ts | 1 + .../identity-verifications.schema.ts | 18 ++++++ .../pages/IdentityVerificationsPage/index.ts | 1 + .../individual-sanctions.schema.ts | 14 ++++ .../registry-information.schema.ts | 14 ++++ .../pages/TitlePage/TitlePage.stories.tsx | 19 ------ .../pages/TitlePage/TitlePage.tsx | 60 ------------------ .../assets/title-page-ballerine-logo.png | Bin 4530 -> 0 bytes .../case-information/pages/TitlePage/index.ts | 1 - .../base-case-information-pdf.schema.ts | 7 ++ 15 files changed, 88 insertions(+), 80 deletions(-) create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/title-page.schema.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.stories.tsx delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts index 4a5067236c..b44736ab63 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts @@ -1 +1,2 @@ export * from './TitlePage'; +export * from './title-page.schema'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/title-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/title-page.schema.ts new file mode 100644 index 0000000000..b7646970e6 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/title-page.schema.ts @@ -0,0 +1,3 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; + +export const TitlePageSchema = BaseCaseInformationPdfSchema.extend({}); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema.ts new file mode 100644 index 0000000000..2d44207c25 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema.ts @@ -0,0 +1,13 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const CompanyOwnershipItem = z.object({ + companyName: z.string(), + companyType: z.string(), + ownershipPercentage: z.number(), + level: z.number(), +}); + +export const CompanyOwnershipSchema = BaseCaseInformationPdfSchema.extend({ + companies: z.array(CompanyOwnershipItem), +}); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts index d6568df34c..09b6f203bb 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts @@ -1 +1,2 @@ export * from './CompanyOwnershipPage'; +export * from './company-ownership.schema'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema.ts new file mode 100644 index 0000000000..1b1dc1d774 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema.ts @@ -0,0 +1,15 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const CompanySanctionsMatchSchema = z.object({ + name: z.string(), + reviewDate: z.date(), + labels: z.array(z.string()), + matchReasons: z.array(z.string()), + sources: z.array(z.string()), + addresses: z.array(z.string()), +}); + +export const CompanySanctionsSchema = BaseCaseInformationPdfSchema.extend({ + matches: z.array(CompanySanctionsMatchSchema), +}); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts index e80f6bb04c..a3cf34912b 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts @@ -1 +1,2 @@ export * from './CompanySanctionsPage'; +export * from './company-sanctions.schema'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema.ts new file mode 100644 index 0000000000..e1b7af966b --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema.ts @@ -0,0 +1,18 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const IdentityVerificationsItemSchema = z.object({ + checkDate: z.date(), + result: z.string(), + reason: z.string(), + firstName: z.string(), + lastName: z.string(), + dateOfBirth: z.date(), + id: z.string(), + gender: z.string(), + nationality: z.string(), +}); + +export const IdentityVerificationsSchema = BaseCaseInformationPdfSchema.extend({ + items: z.array(IdentityVerificationsItemSchema), +}); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts index f577e5d1e3..c05d73665a 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts @@ -1 +1,2 @@ export * from './IdentityVerificationsPage'; +export * from './identity-verifications.schema'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema.ts new file mode 100644 index 0000000000..c0d052454a --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema.ts @@ -0,0 +1,14 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const IndividualSanctionsItem = z.object({ + checkDate: z.date(), + matchesCount: z.number(), + names: z.array(z.string()), + warnings: z.array(z.string()), + sanctions: z.array(z.string()), + PEP: z.array(z.string()), + adverseMedia: z.array(z.string()), +}); + +export const IndividualSanctionsSchema = BaseCaseInformationPdfSchema.extend({}); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts new file mode 100644 index 0000000000..ae9f2ef18b --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts @@ -0,0 +1,14 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const registryInformationSchema = BaseCaseInformationPdfSchema.extend({ + companyName: z.string(), + registrationNumber: z.string(), + incorporationDate: z.string(), + companyType: z.string(), + companyStatus: z.string().optional(), + lastUpdate: z.date(), + registeredAt: z.string(), + registrationAddress: z.string(), + registryPage: z.string(), +}); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.stories.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.stories.tsx deleted file mode 100644 index c47b0d1c7a..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.stories.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { registerFont } from '@ballerine/react-pdf-toolkit'; -import { Document, Font, PDFViewer } from '@react-pdf/renderer'; -import { TitlePage } from './TitlePage'; - -registerFont(Font); - -export default { - component: TitlePage, -}; - -export const Default = { - render: () => ( - - - - - - ), -}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx deleted file mode 100644 index 63c140cef7..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; -import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; -import { Image, List, ListItem, Typography, tw } from '@ballerine/react-pdf-toolkit'; -import { View } from '@react-pdf/renderer'; -import poweredByLogo from './assets/title-page-ballerine-logo.png'; - -export const TitlePage = () => { - return ( - - {/* Powered by section --- start */} - - Powered by - - - {/* Powered by section --- end */} - {/* Company Info section --- start */} - - - - Singapore Airlines Limited - {'\n'} Onboarding Data Report - - - {/* Company Info section --- end */} - {/* Document information section --- start*/} - - - Created at - - {new Date().toISOString()} - - {/* Document information section --- end*/} - {/* Table of contents section --- start */} - - - Table of Contents - - - - 1. Registry Information - - - 2. Company Ownership - - - 3. Company Sanctions - - - 4. Individual Identity verifications - - - 5. Individual PEP/Sanctions - - - - {/* Table of contents section --- end */} - - - ); -}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png deleted file mode 100644 index c6388031d755b4165c45bb13fb6b4371617fdc57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h zK_fy4AyEgb=a{JhOn3#-q;`J|hx92q9!qB9=EEiq1rSag^l=gb+d&We0nw9WgHg zd)Tk0V?-7qge-)>Zag-)3>EBU3Lu0KvIr6D>#TKFVV#B0jYY`yqVIY@J7`py8r4Y* zyh1swJG=EWw0m3z{mku;&+^ug_8Sm#_>}Sx+O9re9KrZt$*PN-=N|0<@YoIAJj;L3 z2Gx)mC}}|cVNCZEE{ndL76T%<4$^nxOOd`UPg>NyY8edu3*#M=>IxX=-{1^57k#(S z)t%sQBF2v(tH$ao3b-tHu)Ed->qe*LpJx({TGO5Rg4?D>xgZd$t_mavfvw+RkjzZ{ z1?8|lpi7T-b%fm*)2_Xd%~?Jjb?Z_0+Ue~;LqgV1fbE^oG!djYr3{FtWBV1Cr!l7E zD5WK!H6)K9WW5AOTC0nlI9S4fkn5qs)|Y1u0Ic zC@kv?MAPYrR=WSEpH27k*G~S2cCDmAnKcv6kfxz)BR_-Tret00VRy5#?asgw1|**N zypdAHkbdZMR zS>x-KJJ=0e19A=lclVO@q5ZpX zA?rhp$hT-W3+{24nS9&*jjWu2`8K#&rN6e)XJfp6hxHR-ua6W0+)|W=&b0Pu>+GNK?UNA@LI|cAkhP9PE3~tTh}Pv| zE$6L9X*6ihb+Ymrgb)J10SP!PWUHk80c%@35VWqV%9y^v?X$ET0RP63N$9Sz7Fdu^Ks);U zTu3&!E+Xvr<{=n$ModG{8le);P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hoG0H!e#H-dWtoEIZu3)qv!<8P8rBjb?9=8wxYy(uHU1UypJju#k$b*v@6mgURA}4k2J>yE z)aR|<2hPaXO)?@C=AA9-OlQu);3^UL)^Q@%OT^`To$C8mcZr}Z70Q%PjZqr7i1C_; zaq0zhRmev$Pt@cN{%5~4>W(Obzw4K#GhC8ivV)Q$l_w|m| zi|VkrVg$AhbZbZ>MqOI2l6C*46aBL0n9ES}RoBE%T{#-$BPdsQRxIyB1KS!w!1(CD zLH>F}m|6cR1c%em^{2J2Quy{@yL`z8#A`enw1EO-IntV1p9Wl$n#!qqP3w~l$Sslf z{+xQx*0N^(I{|G6t{Ytu#nd`OMp$D7}H4_}Z2~khTCrJfD2qCLsi|HMEUp`^_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts deleted file mode 100644 index 4a5067236c..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './TitlePage'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts new file mode 100644 index 0000000000..a703c919ab --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const BaseCaseInformationPdfSchema = z.object({ + companyName: z.string(), + creationDate: z.date(), + logoUrl: z.string(), +}); From 5e1cf17c4ef379f5280f23fd3578d4011d9170eb Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 24 Apr 2024 15:43:53 +0300 Subject: [PATCH 08/37] feat: added download certificate logic & ui --- .../Entity/components/Case/Case.Actions.tsx | 4 +- .../components/CaseOptions/CaseOptions.tsx | 27 ++++++++ .../CaseOptions/useCaseOptionsLogic.tsx | 62 +++++++++++++++++++ .../IndividualSanctionsPage.tsx | 2 +- 4 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/useCaseOptionsLogic.tsx diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx index 11f67de2ca..71c9bbdc10 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx @@ -3,6 +3,7 @@ import { Badge } from '@ballerine/ui'; import { FunctionComponent } from 'react'; import { ActionsVariant } from '@/pages/Entity/components/Case/actions-variants/ActionsVariant/ActionsVariant'; +import { CaseOptions } from '@/pages/Entity/components/Case/components/CaseOptions/CaseOptions'; import { AssignDropdown } from '../../../../common/components/atoms/AssignDropdown/AssignDropdown'; import { ctw } from '../../../../common/utils/ctw/ctw'; import { tagToBadgeData } from './consts'; @@ -39,7 +40,7 @@ export const Actions: FunctionComponent = ({ return (
-
+
= ({ }} authenticatedUserId={authenticatedUser?.id} /> +
diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx new file mode 100644 index 0000000000..746e85b995 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx @@ -0,0 +1,27 @@ +import { Button } from '@/common/components/atoms/Button/Button'; +import { DropdownMenu } from '@/common/components/molecules/DropdownMenu/DropdownMenu'; +import { DropdownMenuContent } from '@/common/components/molecules/DropdownMenu/DropdownMenu.Content'; +import { DropdownMenuItem } from '@/common/components/molecules/DropdownMenu/DropdownMenu.Item'; +import { DropdownMenuTrigger } from '@/common/components/molecules/DropdownMenu/DropdownMenu.Trigger'; +import { useCaseOptionsLogic } from '@/pages/Entity/components/Case/components/CaseOptions/useCaseOptionsLogic'; + +export const CaseOptions = () => { + const { isGeneratingPDF, genereateAndDownloadPDFCertificate } = useCaseOptionsLogic(); + + return ( + + + + + + + Download PDF Certificate + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/useCaseOptionsLogic.tsx new file mode 100644 index 0000000000..2911a182ee --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/useCaseOptionsLogic.tsx @@ -0,0 +1,62 @@ +import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery'; +import { TitlePage } from '@/pages/Entity/pdfs/case-information/TitlePage'; +import { CompanyOwnershipPage } from '@/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage'; +import { CompanySanctionsPage } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage'; +import { IdentityVerificationsPage } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage'; +import { IndividualSanctionsPage } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage'; +import { RegistryInformationPage } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage'; +import { registerFont } from '@ballerine/react-pdf-toolkit'; +import { Document, Font, pdf } from '@react-pdf/renderer'; +import { useCallback, useState } from 'react'; +import { toast } from 'sonner'; + +registerFont(Font); + +const downloadFile = (file: File) => { + const link = document.createElement('a'); + + link.href = URL.createObjectURL(file); + link.download = file.name; + + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + + URL.revokeObjectURL(link.href); +}; + +export const useCaseOptionsLogic = () => { + const [isGeneratingPDF, setIsGeneratingPDF] = useState(false); + const { data: workflow } = useCurrentCaseQuery(); + + const genereateAndDownloadPDFCertificate = useCallback(async () => { + try { + setIsGeneratingPDF(true); + + const PDFBlob = await pdf( + + + + + + + + , + ).toBlob(); + + const pdfFile = new File([PDFBlob], 'certificate.pdf'); + + downloadFile(pdfFile); + } catch (error) { + console.error(`Failed to download PDF certificate: ${error}`); + toast.error('Failed to download PDF certificate.'); + } finally { + setIsGeneratingPDF(false); + } + }, [workflow]); + + return { + isGeneratingPDF, + genereateAndDownloadPDFCertificate, + }; +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx index b68777d0cf..73096c0d93 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx @@ -9,7 +9,7 @@ import { } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem'; import { tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; -import poweredByLogo from '../TitlePage/assets/title-page-ballerine-logo.png'; +import poweredByLogo from './assets/title-page-ballerine-logo.png'; const individualSanctions: IIndividualSanctionsItem[] = [ { From f956d85d66af74d13b506cd72f6f6bf5c55c061f Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Sun, 28 Apr 2024 11:52:23 +0300 Subject: [PATCH 09/37] feat: added mapping for title & registry page --- apps/backoffice-v2/package.json | 2 + .../renderers/pdf-renderer.abstract.ts | 14 ++++ .../renderers/registry-page.pdf.tsx | 25 ++++++ .../renderers/title-page.pdf.tsx | 25 ++++++ .../useCaseOptionsLogic.tsx | 2 +- .../TitlePage/TitlePage.stories.tsx | 19 ----- .../IndividualSanctionsItem/ValueOrNone.tsx | 2 +- .../RegistryInformationPage.tsx | 68 +++------------- .../registry-information.schema.ts | 2 + .../pages/RegistryInformationPage/types.ts | 6 ++ .../utils/create-registry-items.ts | 74 ++++++++++++++++++ .../{ => pages}/TitlePage/TitlePage.tsx | 15 +++- .../assets/title-page-ballerine-logo.png | Bin .../{ => pages}/TitlePage/index.ts | 0 .../TitlePage/title-page.schema.ts | 3 + .../value-or-none.ts | 0 16 files changed, 176 insertions(+), 81 deletions(-) create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx rename apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/{ => hooks/useCaseOptionsLogic}/useCaseOptionsLogic.tsx (99%) delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.stories.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/types.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts rename apps/backoffice-v2/src/pages/Entity/pdfs/case-information/{ => pages}/TitlePage/TitlePage.tsx (90%) rename apps/backoffice-v2/src/pages/Entity/pdfs/case-information/{ => pages}/TitlePage/assets/title-page-ballerine-logo.png (100%) rename apps/backoffice-v2/src/pages/Entity/pdfs/case-information/{ => pages}/TitlePage/index.ts (100%) rename apps/backoffice-v2/src/pages/Entity/pdfs/case-information/{ => pages}/TitlePage/title-page.schema.ts (69%) rename apps/backoffice-v2/src/pages/Entity/pdfs/case-information/{pages/IndividualSanctionsPage/components/IndividualSanctionsItem => utils}/value-or-none.ts (100%) diff --git a/apps/backoffice-v2/package.json b/apps/backoffice-v2/package.json index d50bf70bc0..f2ac2a7e97 100644 --- a/apps/backoffice-v2/package.json +++ b/apps/backoffice-v2/package.json @@ -90,6 +90,7 @@ "i18next-http-backend": "^2.1.1", "leaflet": "^1.9.4", "libphonenumber-js": "^1.10.49", + "lodash": "^4.17.21", "lucide-react": "^0.239.0", "match-sorter": "^6.3.1", "msw": "^1.0.0", @@ -131,6 +132,7 @@ "@testing-library/react": "^13.3.0", "@total-typescript/ts-reset": "^0.5.1", "@types/leaflet": "^1.9.3", + "@types/lodash": "^4.14.191", "@types/node": "^18.11.13", "@types/qs": "^6.9.7", "@types/react": "^18.0.14", diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts new file mode 100644 index 0000000000..2f01a9d9cc --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts @@ -0,0 +1,14 @@ +import { TWorkflowById } from '@/domains/workflows/fetchers'; +import { z } from 'zod'; + +export abstract class IPDFRenderer { + static PDF_NAME: string; + + constructor(readonly workflow: TWorkflowById, readonly validationSchema: z.ZodAny) {} + + abstract render(): JSX.Element; + + abstract getData(): TPDFData; + + abstract isValid(): boolean; +} diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx new file mode 100644 index 0000000000..9908ff4186 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx @@ -0,0 +1,25 @@ +import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; +import { TTitlePageData, TitlePage } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; +import get from 'lodash/get'; + +export class RegistryPagePDF extends IPDFRenderer { + static PDF_NAME = 'titlePage'; + + render(): JSX.Element { + return ; + } + + getData() { + const pdfData: TTitlePageData = { + companyName: get(this.workflow.context, 'entity.data.companyName', ''), + creationDate: new Date(), + logoUrl: '', + }; + + return pdfData; + } + + isValid(): boolean { + return true; + } +} diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx new file mode 100644 index 0000000000..858e6a22e8 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx @@ -0,0 +1,25 @@ +import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; +import { TTitlePageData, TitlePage } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; +import get from 'lodash/get'; + +export class TitlePagePDF extends IPDFRenderer { + static PDF_NAME = 'titlePage'; + + render(): JSX.Element { + return ; + } + + getData() { + const pdfData: TTitlePageData = { + companyName: get(this.workflow.context, 'entity.data.companyName', ''), + creationDate: new Date(), + logoUrl: '', + }; + + return pdfData; + } + + isValid(): boolean { + return true; + } +} diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx similarity index 99% rename from apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/useCaseOptionsLogic.tsx rename to apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index 2911a182ee..748bc7f34b 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -1,10 +1,10 @@ import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery'; -import { TitlePage } from '@/pages/Entity/pdfs/case-information/TitlePage'; import { CompanyOwnershipPage } from '@/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage'; import { CompanySanctionsPage } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage'; import { IdentityVerificationsPage } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage'; import { IndividualSanctionsPage } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage'; import { RegistryInformationPage } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage'; +import { TitlePage } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; import { registerFont } from '@ballerine/react-pdf-toolkit'; import { Document, Font, pdf } from '@react-pdf/renderer'; import { useCallback, useState } from 'react'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.stories.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.stories.tsx deleted file mode 100644 index c47b0d1c7a..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.stories.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { registerFont } from '@ballerine/react-pdf-toolkit'; -import { Document, Font, PDFViewer } from '@react-pdf/renderer'; -import { TitlePage } from './TitlePage'; - -registerFont(Font); - -export default { - component: TitlePage, -}; - -export const Default = { - render: () => ( - - - - - - ), -}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx index 07ae150f10..d5358dd49e 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx @@ -1,5 +1,5 @@ import { valueOrFallback } from '@/common/utils/value-or-fallback/value-or-fallback'; -import { valueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/value-or-none'; +import { valueOrNone } from '@/pages/Entity/pdfs/case-information/utils/value-or-none'; import { Typography, tw } from '@ballerine/react-pdf-toolkit'; import { AnyChildren } from '@ballerine/ui'; import { FunctionComponent } from 'react'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx index fb2180d066..959f27f526 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx @@ -3,71 +3,27 @@ import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-informati import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema'; +import { createRegistryItems } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items'; import { Link, Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; -import poweredByLogo from './assets/title-page-ballerine-logo.png'; +import { FunctionComponent } from 'react'; -interface IRegistryItem { - key: string; - title: string; - value: string; - valueType?: 'text' | 'link'; +export interface IRegistryInformationPageProps { + data: TRegistryInformationData; } -const registryItems: IRegistryItem[] = [ - { - key: 'name', - title: 'Name', - value: 'Singapore Airlines Limited', - }, - { - key: 'registrationNumber', - title: 'Registration number', - value: '128947342867', - }, - { - key: 'incorporationDate', - title: 'Incorporation date', - value: '12/12/2012', - }, - { - key: 'companyType', - title: 'Company type', - value: 'Public Company', - }, - { - key: 'currentStatus', - title: 'Current status', - value: 'Active', - }, - { - key: 'lastUpdate', - title: 'Last update', - value: '12/12/2021', - }, - { - key: 'registeredAddress', - title: 'Registered Address', - value: 'Singapore', - }, - { - key: 'createdAt', - title: 'Created at', - value: '12/12/2021', - }, - { - key: 'registryPage', - title: 'Registry page', - value: 'https://www.example.com', - valueType: 'link', - }, -]; +export const RegistryInformationPage: FunctionComponent = ({ + data, +}) => { + const { companyName, logoUrl } = data; + + const registryItems = createRegistryItems(data); -export const RegistryInformationPage = () => { return ( - + diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts index ae9f2ef18b..f68477676c 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts @@ -12,3 +12,5 @@ export const registryInformationSchema = BaseCaseInformationPdfSchema.extend({ registrationAddress: z.string(), registryPage: z.string(), }); + +export type TRegistryInformationData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/types.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/types.ts new file mode 100644 index 0000000000..19c62c8679 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/types.ts @@ -0,0 +1,6 @@ +export type IRegistryInformationItem = { + key: string; + title: string; + value: string; + valueType?: 'text' | 'link'; +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts new file mode 100644 index 0000000000..82b354b9a0 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts @@ -0,0 +1,74 @@ +import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema'; +import { IRegistryInformationItem } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/types'; +import { valueOrNone } from '@/pages/Entity/pdfs/case-information/utils/value-or-none'; + +export const createRegistryItems = ( + registryInformationData: TRegistryInformationData, +): IRegistryInformationItem[] => { + const { + companyName, + registrationNumber, + registryPage, + registrationAddress, + incorporationDate, + companyType, + companyStatus, + lastUpdate, + creationDate, + registeredAt, + } = registryInformationData; + + return [ + { + key: 'name', + title: 'Name', + value: valueOrNone(companyName), + }, + { + key: 'registrationNumber', + title: 'Registration number', + value: valueOrNone(registrationNumber), + }, + { + key: 'incorporationDate', + title: 'Incorporation date', + value: valueOrNone(incorporationDate), + }, + { + key: 'companyType', + title: 'Company type', + value: valueOrNone(companyType), + }, + { + key: 'currentStatus', + title: 'Current status', + value: valueOrNone(companyStatus), + }, + { + key: 'lastUpdate', + title: 'Last update', + value: valueOrNone(lastUpdate?.toISOString()), + }, + { + key: 'registeredAt', + title: 'Registered At', + value: valueOrNone(registeredAt), + }, + { + key: 'registeredAddress', + title: 'Registered Address', + value: valueOrNone(registrationAddress), + }, + { + key: 'createdAt', + title: 'Created at', + value: valueOrNone(creationDate?.toISOString()), + }, + { + key: 'registryPage', + title: 'Registry page', + value: valueOrNone(registryPage), + valueType: 'link', + }, + ]; +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx similarity index 90% rename from apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.tsx rename to apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx index e4ac875086..a03b20920a 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/TitlePage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx @@ -1,8 +1,16 @@ +import { TTitlePageData } from '@/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema'; import { Image, List, ListItem, Typography, tw } from '@ballerine/react-pdf-toolkit'; import { Page, View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; import poweredByLogo from './assets/title-page-ballerine-logo.png'; -export const TitlePage = () => { +export interface ITitlePageProps { + data: TTitlePageData; +} + +export const TitlePage: FunctionComponent = ({ data }) => { + const { companyName, creationDate } = data; + return ( @@ -16,15 +24,14 @@ export const TitlePage = () => { - Singapore Airlines Limited - {'\n'} Onboarding Data Report + {companyName} {/* Company Info section --- end */} {/* Document information section --- start*/} - Created at + {new Date(creationDate).toISOString()} {new Date().toISOString()} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png similarity index 100% rename from apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/assets/title-page-ballerine-logo.png rename to apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts similarity index 100% rename from apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/index.ts rename to apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/title-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts similarity index 69% rename from apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/title-page.schema.ts rename to apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts index b7646970e6..2c975d6ce0 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/TitlePage/title-page.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts @@ -1,3 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; export const TitlePageSchema = BaseCaseInformationPdfSchema.extend({}); + +export type TTitlePageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/value-or-none.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/utils/value-or-none.ts similarity index 100% rename from apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/value-or-none.ts rename to apps/backoffice-v2/src/pages/Entity/pdfs/case-information/utils/value-or-none.ts From de8484e17fe80d9148e5232743a6a06a06154918 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Sun, 28 Apr 2024 17:07:58 +0300 Subject: [PATCH 10/37] feat: added partial rendering of pdfs --- apps/backoffice-v2/package.json | 2 + .../src/common/utils/svg-to-png/svg-to-png.ts | 23 +++ .../src/domains/customer/fetchers.ts | 34 ++-- .../useUbosRegistryProvidedBlock.tsx | 6 +- .../components/CaseOptions/CaseOptions.tsx | 2 +- .../renderers/company-ownership-page.pdf.tsx | 39 +++++ .../renderers/company-sanctions-page.pdf.tsx | 45 +++++ .../renderers/pdf-renderer.abstract.ts | 17 +- .../renderers/registry-page.pdf.tsx | 46 +++++- .../renderers/title-page.pdf.tsx | 21 ++- .../useCaseOptionsLogic.tsx | 40 +++-- .../CompanyOwnershipPage.tsx | 47 ++---- .../company-ownership.schema.ts | 8 +- .../CompanySanctionsPage.tsx | 154 ++---------------- .../company-sanctions.schema.ts | 10 +- .../CompanySanctionsMatchSection.tsx | 15 +- .../IndividualSanctionsItem/ValueOrNone.tsx | 9 - .../RegistryInformationPage.tsx | 9 +- .../utils/create-registry-items.ts | 21 ++- .../pages/TitlePage/TitlePage.tsx | 14 +- pnpm-lock.yaml | 53 +++++- 21 files changed, 340 insertions(+), 275 deletions(-) create mode 100644 apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx diff --git a/apps/backoffice-v2/package.json b/apps/backoffice-v2/package.json index f2ac2a7e97..d0daf59d4d 100644 --- a/apps/backoffice-v2/package.json +++ b/apps/backoffice-v2/package.json @@ -52,6 +52,7 @@ "dependencies": { "@ballerine/blocks": "0.2.2", "@ballerine/common": "0.9.4", + "@ballerine/react-pdf-toolkit": "^1.2.1", "@ballerine/ui": "^0.5.1", "@ballerine/workflow-browser-sdk": "0.6.7", "@ballerine/workflow-node-sdk": "0.6.7", @@ -74,6 +75,7 @@ "@radix-ui/react-slot": "^1.0.1", "@radix-ui/react-switch": "^1.0.3", "@radix-ui/react-tabs": "^1.0.4", + "@react-pdf/renderer": "^3.1.14", "@rjsf/utils": "^5.9.0", "@tanstack/react-query": "^4.19.1", "@tanstack/react-table": "^8.9.2", diff --git a/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts b/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts new file mode 100644 index 0000000000..1f0d488362 --- /dev/null +++ b/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts @@ -0,0 +1,23 @@ +export const svgToPng = (imageUrl: string): Promise => { + return new Promise((resolve, reject) => { + const img = new Image(); + img.crossOrigin = 'Anonymous'; + img.onload = () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('2d'); + + canvas.width = img.width; + canvas.height = img.height; + context?.drawImage(img, 0, 0); + + const dataUrl = canvas.toDataURL('image/png'); + + resolve(dataUrl); + document.body.removeChild(canvas); + }; + img.onerror = error => { + reject(error); + }; + img.src = imageUrl; + }); +}; diff --git a/apps/backoffice-v2/src/domains/customer/fetchers.ts b/apps/backoffice-v2/src/domains/customer/fetchers.ts index 5318107a7e..c5c62bde98 100644 --- a/apps/backoffice-v2/src/domains/customer/fetchers.ts +++ b/apps/backoffice-v2/src/domains/customer/fetchers.ts @@ -1,25 +1,29 @@ -import { apiClient } from '../../common/api-client/api-client'; import { z } from 'zod'; -import { handleZodError } from '../../common/utils/handle-zod-error/handle-zod-error'; +import { apiClient } from '../../common/api-client/api-client'; import { Method } from '../../common/enums'; +import { handleZodError } from '../../common/utils/handle-zod-error/handle-zod-error'; + +const CustomerSchema = z + .object({ + id: z.string(), + name: z.string(), + displayName: z.string(), + logoImageUri: z.union([z.string(), z.null()]).optional(), + // Remove default once data migration is done + faviconImageUri: z.string().default(''), + customerStatus: z.string().optional(), + country: z.union([z.string(), z.null()]).optional(), + language: z.union([z.string(), z.null()]).optional(), + }) + .optional(); + +export type TCustomer = z.infer; export const fetchCustomer = async () => { const [filter, error] = await apiClient({ endpoint: `customers`, method: Method.GET, - schema: z - .object({ - id: z.string(), - name: z.string(), - displayName: z.string(), - logoImageUri: z.union([z.string(), z.null()]).optional(), - // Remove default once data migration is done - faviconImageUri: z.string().default(''), - customerStatus: z.string().optional(), - country: z.union([z.string(), z.null()]).optional(), - language: z.union([z.string(), z.null()]).optional(), - }) - .optional(), + schema: CustomerSchema, }); return handleZodError(error, filter); diff --git a/apps/backoffice-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.tsx b/apps/backoffice-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.tsx index 3184d54571..2e44daad94 100644 --- a/apps/backoffice-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.tsx +++ b/apps/backoffice-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.tsx @@ -1,8 +1,8 @@ -import { useCallback, useMemo } from 'react'; -import { createBlocksTyped } from '@/lib/blocks/create-blocks-typed/create-blocks-typed'; import { WarningFilledSvg } from '@/common/components/atoms/icons'; +import { createBlocksTyped } from '@/lib/blocks/create-blocks-typed/create-blocks-typed'; +import { useCallback, useMemo } from 'react'; -type Ubo = { +export type Ubo = { name?: string; type?: string; level?: number; diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx index 746e85b995..26aaed2abb 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx @@ -3,7 +3,7 @@ import { DropdownMenu } from '@/common/components/molecules/DropdownMenu/Dropdow import { DropdownMenuContent } from '@/common/components/molecules/DropdownMenu/DropdownMenu.Content'; import { DropdownMenuItem } from '@/common/components/molecules/DropdownMenu/DropdownMenu.Item'; import { DropdownMenuTrigger } from '@/common/components/molecules/DropdownMenu/DropdownMenu.Trigger'; -import { useCaseOptionsLogic } from '@/pages/Entity/components/Case/components/CaseOptions/useCaseOptionsLogic'; +import { useCaseOptionsLogic } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic'; export const CaseOptions = () => { const { isGeneratingPDF, genereateAndDownloadPDFCertificate } = useCaseOptionsLogic(); diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx new file mode 100644 index 0000000000..8581a5d625 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx @@ -0,0 +1,39 @@ +import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; +import { + CompanyOwnershipPage, + CompanyOwnershipSchema, + TCompanyOwnershipData, +} from '@/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage'; +import get from 'lodash/get'; +import map from 'lodash/map'; + +export class CompanyOwnershipPagePDF extends IPDFRenderer { + static PDF_NAME = 'companyOwnershipPage'; + + async render(): Promise { + const pdfData = await this.getData(); + this.isValid(pdfData); + + return ; + } + + async getData() { + const pdfData: TCompanyOwnershipData = { + companyName: get(this.workflow.context, 'entity.data.companyName', ''), + creationDate: new Date(), + logoUrl: await this.getLogoUrl(), + items: map(get(this?.workflow, 'context.pluginsOutput.ubo.data.uboGraph', []), ubo => ({ + companyName: ubo?.name, + companyType: ubo?.type, + ownershipPercentage: ubo?.shareHolders?.[0]?.sharePercentage, + level: ubo?.level, + })), + }; + + return pdfData; + } + + isValid(data: TCompanyOwnershipData) { + CompanyOwnershipSchema.parse(data); + } +} diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx new file mode 100644 index 0000000000..bdea1bbd22 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx @@ -0,0 +1,45 @@ +import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; +import { + CompanySanctionsPage, + CompanySanctionsSchema, + TCompanySanctionsData, +} from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage'; +import get from 'lodash/get'; +import map from 'lodash/map'; + +export class CompanySanctionsPagePDF extends IPDFRenderer { + static PDF_NAME = 'companySanctionsPage'; + + async render(): Promise { + const pdfData = await this.getData(); + console.log({ pdfData }); + this.isValid(pdfData); + + return ; + } + + async getData() { + const pdfData: TCompanySanctionsData = { + companyName: get(this.workflow.context, 'entity.data.companyName', ''), + creationDate: new Date(), + logoUrl: await this.getLogoUrl(), + sanctions: map( + get(this.workflow.context, 'pluginsOutput.companySanctions.data', []), + sanction => ({ + name: get(sanction, 'entity.name', ''), + reviewDate: get(sanction, 'entity.lastReviewed', ''), + labels: get(sanction, 'entity.categories', []), + sources: map(get(sanction, 'entity.sources', []), source => get(source, 'url', '')), + addresses: get(sanction, 'entity.places', []), + matchReasons: get(sanction, 'matchedFields', []), + }), + ), + }; + + return pdfData; + } + + isValid(data: TCompanySanctionsData) { + CompanySanctionsSchema.parse(data); + } +} diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts index 2f01a9d9cc..087928fb01 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts @@ -1,14 +1,19 @@ +import { svgToPng } from '@/common/utils/svg-to-png/svg-to-png'; +import { TCustomer } from '@/domains/customer/fetchers'; import { TWorkflowById } from '@/domains/workflows/fetchers'; -import { z } from 'zod'; -export abstract class IPDFRenderer { +export abstract class IPDFRenderer { static PDF_NAME: string; - constructor(readonly workflow: TWorkflowById, readonly validationSchema: z.ZodAny) {} + constructor(readonly workflow: TWorkflowById, readonly customer: TCustomer) {} - abstract render(): JSX.Element; + abstract render(): Promise; - abstract getData(): TPDFData; + abstract getData(): Promise; - abstract isValid(): boolean; + abstract isValid(data: TPDFData): void; + + getLogoUrl(): Promise { + return svgToPng(this.customer?.logoImageUri || ''); + } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx index 9908ff4186..5549edfe39 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx @@ -1,25 +1,55 @@ import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; -import { TTitlePageData, TitlePage } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; +import { RegistryInformationPage } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage'; +import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema'; +import { + TTitlePageData, + TitlePageSchema, +} from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; import get from 'lodash/get'; export class RegistryPagePDF extends IPDFRenderer { static PDF_NAME = 'titlePage'; - render(): JSX.Element { - return ; + async render(): Promise { + const pdfData = await this.getData(); + this.isValid(pdfData); + + return ; } - getData() { - const pdfData: TTitlePageData = { + async getData() { + const pdfData: TRegistryInformationData = { companyName: get(this.workflow.context, 'entity.data.companyName', ''), creationDate: new Date(), - logoUrl: '', + logoUrl: await this.getLogoUrl(), + registrationNumber: get(this.workflow.context, 'entity.data.registrationNumber', ''), + incorporationDate: get( + this.workflow.context, + 'entity.data.additionalInfo.dateOfEstablishment', + null, + ), + companyType: get(this.workflow.context, 'entity.data.businessType', ''), + // companyStatus is missing in context + companyStatus: get(this.workflow.context, 'entity.data.status', ''), + + registrationAddress: [ + get(this.workflow.context, 'entity.data.headquarters.street', ''), + get(this.workflow.context, 'entity.data.headquarters.streetNumber', ''), + get(this.workflow.context, 'entity.data.headquarters.city', ''), + get(this.workflow.context, 'entity.data.headquarters.country', ''), + get(this.workflow.context, 'entity.data.headquarters.postalCode', ''), + ] + .filter(Boolean) + .join(', '), + registryPage: get(this.workflow.context, 'entity.data.registryPage', ''), + lastUpdate: new Date(), + registeredAt: get(this.workflow.context, 'entity.data.registeredAt', ''), }; return pdfData; } - isValid(): boolean { - return true; + isValid(data: TTitlePageData) { + TitlePageSchema.parse(data); } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx index 858e6a22e8..3be66304b0 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx @@ -1,25 +1,32 @@ import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; -import { TTitlePageData, TitlePage } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; +import { + TTitlePageData, + TitlePage, + TitlePageSchema, +} from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; import get from 'lodash/get'; export class TitlePagePDF extends IPDFRenderer { static PDF_NAME = 'titlePage'; - render(): JSX.Element { - return ; + async render(): Promise { + const pdfData = await this.getData(); + this.isValid(pdfData); + + return ; } - getData() { + async getData() { const pdfData: TTitlePageData = { companyName: get(this.workflow.context, 'entity.data.companyName', ''), creationDate: new Date(), - logoUrl: '', + logoUrl: await this.getLogoUrl(), }; return pdfData; } - isValid(): boolean { - return true; + isValid(data: TTitlePageData) { + TitlePageSchema.parse(data); } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index 748bc7f34b..b2ba3e0f04 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -1,10 +1,12 @@ +import { svgToPng } from '@/common/utils/svg-to-png/svg-to-png'; +import { TCustomer } from '@/domains/customer/fetchers'; +import { useCustomerQuery } from '@/domains/customer/hook/queries/useCustomerQuery/userCustomerQuery'; +import { TWorkflowById } from '@/domains/workflows/fetchers'; +import { CompanyOwnershipPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf'; +import { CompanySanctionsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf'; +import { RegistryPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf'; +import { TitlePagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf'; import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery'; -import { CompanyOwnershipPage } from '@/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage'; -import { CompanySanctionsPage } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage'; -import { IdentityVerificationsPage } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage'; -import { IndividualSanctionsPage } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage'; -import { RegistryInformationPage } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage'; -import { TitlePage } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; import { registerFont } from '@ballerine/react-pdf-toolkit'; import { Document, Font, pdf } from '@react-pdf/renderer'; import { useCallback, useState } from 'react'; @@ -28,21 +30,25 @@ const downloadFile = (file: File) => { export const useCaseOptionsLogic = () => { const [isGeneratingPDF, setIsGeneratingPDF] = useState(false); const { data: workflow } = useCurrentCaseQuery(); + const { data: customer } = useCustomerQuery(); + + console.log('customer', customer); const genereateAndDownloadPDFCertificate = useCallback(async () => { + await svgToPng(customer?.logoImageUri || '').then(result => console.log(result)); try { setIsGeneratingPDF(true); - const PDFBlob = await pdf( - - - - - - - - , - ).toBlob(); + const pdfs = [ + TitlePagePDF, + RegistryPagePDF, + CompanyOwnershipPagePDF, + CompanySanctionsPagePDF, + ]; + const renderers = pdfs.map(PDF => new PDF(workflow as TWorkflowById, customer as TCustomer)); + const pages = await Promise.all(renderers.map(renderer => renderer.render())); + + const PDFBlob = await pdf({pages}).toBlob(); const pdfFile = new File([PDFBlob], 'certificate.pdf'); @@ -53,7 +59,7 @@ export const useCaseOptionsLogic = () => { } finally { setIsGeneratingPDF(false); } - }, [workflow]); + }, [workflow, customer]); return { isGeneratingPDF, diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx index da913fd37c..aae1a3cb1f 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx @@ -3,40 +3,23 @@ import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-informati import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { TCompanyOwnershipData } from '@/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema'; +import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; import { Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; -import poweredByLogo from './assets/title-page-ballerine-logo.png'; +import { FunctionComponent } from 'react'; -interface ICompanyOwnershipItem { - name: string; - type: string; - percentage: string; - level: number; +export interface ICompanyOwnershipPageProps { + data: TCompanyOwnershipData; } -const tableItems: ICompanyOwnershipItem[] = [ - { - name: 'AIR STAR ALLIANCE GLOBAL SINGAPORE PTE. LTD.', - type: 'COMPANY', - percentage: '100%', - level: 1, - }, - { - name: 'MENG, XIANGHONG', - type: 'PERSON', - percentage: '100%', - level: 3, - }, -]; +export const CompanyOwnershipPage: FunctionComponent = ({ data }) => { + const { items, companyName, logoUrl } = data; -export const CompanyOwnershipPage = () => { return ( - + @@ -74,21 +57,23 @@ export const CompanyOwnershipPage = () => { {/* Table Header --- end */} {/* Table Body --- start */} - {tableItems.map(item => ( - + {items.map(({ companyName, companyType, ownershipPercentage, level }) => ( + - {item.name} + - {item.type} + - {item.percentage} + - {item.level} + ))} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema.ts index 2d44207c25..158dabe5d2 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema.ts @@ -4,10 +4,12 @@ import { z } from 'zod'; export const CompanyOwnershipItem = z.object({ companyName: z.string(), companyType: z.string(), - ownershipPercentage: z.number(), - level: z.number(), + ownershipPercentage: z.string().optional(), + level: z.string().optional(), }); export const CompanyOwnershipSchema = BaseCaseInformationPdfSchema.extend({ - companies: z.array(CompanyOwnershipItem), + items: z.array(CompanyOwnershipItem), }); + +export type TCompanyOwnershipData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx index 0d9d3a2497..180d4d09dd 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx @@ -1,150 +1,26 @@ +import { isValidUrl } from '@/common/utils/is-valid-url'; import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; -import { - CompanySanctionsMatchSection, - ICompanySanctionsMatchSectionAddress, -} from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection'; +import { TCompanySanctionsData } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema'; +import { CompanySanctionsMatchSection } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection'; import { Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; -import poweredByLogo from './assets/title-page-ballerine-logo.png'; +import { FunctionComponent } from 'react'; -interface ICompanySanctionsItem { - primaryName: string; - lastReviewed: string; - labels: string[]; - matchReasons: string[]; - //urls - sources: string[]; - //address line - addresses: ICompanySanctionsMatchSectionAddress[]; +interface ICompanySanctionsPageProps { + data: TCompanySanctionsData; } -const matches: ICompanySanctionsItem[] = [ - { - primaryName: 'Singapore Airlines Limited', - lastReviewed: '12/12/2021', - labels: [ - 'PEP', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'PEP', - 'Sanction', - 'PEP', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'PEP', - 'Sanction', - 'PEP', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'Sanction', - 'PEP', - 'Sanction', - ], - matchReasons: [ - 'Name', - 'Address', - 'Address', - 'Address', - 'Address', - 'Address', - 'Address', - 'Address', - 'Name', - 'Address', - 'Address', - 'Address', - 'Address', - 'Address', - 'Address', - 'Address', - 'Name', - 'Address', - 'Address', - 'Address', - 'Address', - 'Address', - 'Address', - 'Address', - ], - sources: [ - 'https://www.singaporeairlines.com', - 'https://www.example.com', - 'https://www.example.com', - 'https://www.example.com', - 'https://www.example.com', - 'https://www.example.com', - 'https://www.example.com', - 'https://www.example.com', - ], - addresses: [ - { - addresses: [ - 'Sutton yard, 65 Goswell Road, London, United Kingdom', - 'Sutton yard, 65 Goswell Road, London, United Kingdom', - 'Sutton yard, 65 Goswell Road, London, United Kingdom', - 'Sutton yard, 65 Goswell Road, London, United Kingdom', - ], - city: 'London', - country: 'United Kingdom', - }, - { - addresses: ['Sutton yard, 65 Goswell Road, London, United Kingdom'], - city: 'London', - country: 'United Kingdom', - }, - ], - }, - { - primaryName: 'Singapore Airlines Limited', - lastReviewed: '12/12/2021', - labels: ['PEP', 'Sanction'], - matchReasons: ['Name', 'Address'], - sources: [ - 'https://www.singaporeairlines.com', - 'https://www.example.com', - 'https://www.example.com', - ], - addresses: [ - { - addresses: ['Sutton yard, 65 Goswell Road, London, United Kingdom'], - city: 'London', - country: 'United Kingdom', - }, - { - addresses: ['Sutton yard, 65 Goswell Road, London, United Kingdom'], - city: 'London', - country: 'United Kingdom', - }, - ], - }, -]; +export const CompanySanctionsPage: FunctionComponent = ({ data }) => { + const { sanctions, companyName, logoUrl } = data; -export const CompanySanctionsPage = () => { return ( - + @@ -170,21 +46,21 @@ export const CompanySanctionsPage = () => { - {matches.length} + {sanctions.length} {' matches'} - {matches.map((item, index) => ( + {sanctions.map((item, index) => ( isValidUrl(source))} addresses={item.addresses} /> ))} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema.ts index 1b1dc1d774..3f89b5c03d 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema.ts @@ -1,15 +1,17 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const CompanySanctionsMatchSchema = z.object({ +export const CompanySanctionSchema = z.object({ name: z.string(), - reviewDate: z.date(), + reviewDate: z.string().optional(), labels: z.array(z.string()), matchReasons: z.array(z.string()), sources: z.array(z.string()), - addresses: z.array(z.string()), + addresses: z.array(z.object({ country: z.string(), city: z.string(), address: z.string() })), }); export const CompanySanctionsSchema = BaseCaseInformationPdfSchema.extend({ - matches: z.array(CompanySanctionsMatchSchema), + sanctions: z.array(CompanySanctionSchema), }); + +export type TCompanySanctionsData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection.tsx index b3b8e54c24..57b5112ae0 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection.tsx @@ -1,9 +1,10 @@ +import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; import { Link, Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; export interface ICompanySanctionsMatchSectionAddress { - addresses: string[]; + address: string; city: string; country: string; } @@ -11,7 +12,7 @@ export interface ICompanySanctionsMatchSectionAddress { interface ICompanySanctionsMatchSectionProps { primaryName: string; matchNumber: number; - lastReviewedDate: string; + lastReviewedDate?: Date; labels: string[]; matchReasons: string[]; sources: string[]; @@ -45,9 +46,11 @@ export const CompanySanctionsMatchSection: FunctionComponent< - - {lastReviewedDate} - + @@ -114,7 +117,7 @@ export const CompanySanctionsMatchSection: FunctionComponent< - {item.addresses.join(' , ')} + {item.address} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx index d5358dd49e..50e05f1ac5 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx @@ -12,15 +12,6 @@ const NONE_TEXT_HEX_COLOR = '#999999'; const valueOrNoneTextColor = valueOrFallback(NONE_TEXT_HEX_COLOR, { checkFalsy: true }); export const ValueOrNone: FunctionComponent = ({ value }) => { - console.log( - { value }, - `text-[8px] leading-[1.45rem] ${ - valueOrNoneTextColor(value) === NONE_TEXT_HEX_COLOR - ? `text-[${valueOrNoneTextColor(value)}]` - : '' - }}`, - ); - return ( @@ -47,7 +50,7 @@ export const RegistryInformationPage: FunctionComponent {registryItems.map(item => - item.valueType === 'link' ? ( + item.valueType === 'link' && item.value ? ( ) : ( - - {item.value} - + ), )} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts index 82b354b9a0..fca9f3bce4 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts @@ -1,6 +1,5 @@ import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema'; import { IRegistryInformationItem } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/types'; -import { valueOrNone } from '@/pages/Entity/pdfs/case-information/utils/value-or-none'; export const createRegistryItems = ( registryInformationData: TRegistryInformationData, @@ -22,52 +21,52 @@ export const createRegistryItems = ( { key: 'name', title: 'Name', - value: valueOrNone(companyName), + value: companyName || '', }, { key: 'registrationNumber', title: 'Registration number', - value: valueOrNone(registrationNumber), + value: registrationNumber || '', }, { key: 'incorporationDate', title: 'Incorporation date', - value: valueOrNone(incorporationDate), + value: incorporationDate || '', }, { key: 'companyType', title: 'Company type', - value: valueOrNone(companyType), + value: companyType || '', }, { key: 'currentStatus', title: 'Current status', - value: valueOrNone(companyStatus), + value: companyStatus || '', }, { key: 'lastUpdate', title: 'Last update', - value: valueOrNone(lastUpdate?.toISOString()), + value: lastUpdate?.toISOString() || '', }, { key: 'registeredAt', title: 'Registered At', - value: valueOrNone(registeredAt), + value: registeredAt || '', }, { key: 'registeredAddress', title: 'Registered Address', - value: valueOrNone(registrationAddress), + value: registrationAddress || '', }, { key: 'createdAt', title: 'Created at', - value: valueOrNone(creationDate?.toISOString()), + value: creationDate?.toISOString(), }, { key: 'registryPage', title: 'Registry page', - value: valueOrNone(registryPage), + value: registryPage || '', valueType: 'link', }, ]; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx index a03b20920a..2a08d90421 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx @@ -1,6 +1,6 @@ import { TTitlePageData } from '@/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema'; -import { Image, List, ListItem, Typography, tw } from '@ballerine/react-pdf-toolkit'; -import { Page, View } from '@react-pdf/renderer'; +import { List, ListItem, Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { Image, Page, View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; import poweredByLogo from './assets/title-page-ballerine-logo.png'; @@ -9,20 +9,20 @@ export interface ITitlePageProps { } export const TitlePage: FunctionComponent = ({ data }) => { - const { companyName, creationDate } = data; + const { companyName, creationDate, logoUrl } = data; return ( {/* Powered by section --- start */} - + Powered by - + {/* Powered by section --- end */} {/* Company Info section --- start */} - - + + {companyName} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bd4bb96eda..396b622838 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -66,6 +66,9 @@ importers: '@ballerine/common': specifier: 0.9.4 version: link:../../packages/common + '@ballerine/react-pdf-toolkit': + specifier: ^1.2.1 + version: link:../../packages/react-pdf-toolkit '@ballerine/ui': specifier: ^0.5.1 version: link:../../packages/ui @@ -132,6 +135,9 @@ importers: '@radix-ui/react-tabs': specifier: ^1.0.4 version: 1.0.4(@types/react-dom@18.2.15)(@types/react@18.2.37)(react-dom@18.2.0)(react@18.2.0) + '@react-pdf/renderer': + specifier: ^3.1.14 + version: 3.1.14(react@18.2.0) '@rjsf/utils': specifier: ^5.9.0 version: 5.14.2(react@18.2.0) @@ -147,6 +153,9 @@ importers: broadcast-channel: specifier: ^7.0.0 version: 7.0.0 + canvg: + specifier: ^4.0.2 + version: 4.0.2 class-variance-authority: specifier: ^0.6.0 version: 0.6.1 @@ -180,6 +189,9 @@ importers: libphonenumber-js: specifier: ^1.10.49 version: 1.10.49 + lodash: + specifier: ^4.17.21 + version: 4.17.21 lucide-react: specifier: ^0.239.0 version: 0.239.0(react@18.2.0) @@ -298,6 +310,9 @@ importers: '@types/leaflet': specifier: ^1.9.3 version: 1.9.8 + '@types/lodash': + specifier: ^4.14.191 + version: 4.14.201 '@types/node': specifier: ^18.11.13 version: 18.17.19 @@ -8513,7 +8528,7 @@ packages: magic-string: 0.27.0 react-docgen-typescript: 2.2.2(typescript@4.9.5) typescript: 4.9.5 - vite: 4.5.3(@types/node@20.9.2) + vite: 4.5.3(@types/node@18.17.19) dev: true /@joshwooding/vite-plugin-react-docgen-typescript@0.3.0(typescript@5.1.6)(vite@4.5.3): @@ -14122,7 +14137,7 @@ packages: react: 18.2.0 react-docgen: 6.0.4 react-dom: 18.2.0(react@18.2.0) - vite: 4.5.3(@types/node@20.9.2) + vite: 4.5.3(@types/node@18.17.19) transitivePeerDependencies: - '@preact/preset-vite' - encoding @@ -15534,6 +15549,10 @@ packages: resolution: {integrity: sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==} dev: true + /@types/raf@3.4.3: + resolution: {integrity: sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==} + dev: false + /@types/range-parser@1.2.7: resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} dev: true @@ -18486,6 +18505,17 @@ packages: resolution: {integrity: sha512-1Pbh5FLmn5y4+QhNyJE9j3/7dK44dGB83/ZMjv/qJk86TvDbjk0LosiZo0i0WB0Vx607qMX9jYrn1VLHCkN4rw==} dev: true + /canvg@4.0.2: + resolution: {integrity: sha512-/7kIZger/mdFci4KXdtMr+NQB4GU1InkJ4RwSyDBRcvy4BUlg1hD+ZUWo550sWPyWaKZ8purqby6kjf09qVriw==} + engines: {node: '>=12.0.0'} + dependencies: + '@types/raf': 3.4.3 + raf: 3.4.1 + rgbcolor: 1.0.1 + stackblur-canvas: 2.7.0 + svg-pathdata: 6.0.3 + dev: false + /capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} dependencies: @@ -29231,6 +29261,11 @@ packages: resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} dev: true + /rgbcolor@1.0.1: + resolution: {integrity: sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==} + engines: {node: '>= 0.8.15'} + dev: false + /rimraf@2.6.3: resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} hasBin: true @@ -30023,6 +30058,11 @@ packages: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true + /stackblur-canvas@2.7.0: + resolution: {integrity: sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==} + engines: {node: '>=0.1.14'} + dev: false + /statuses@2.0.1: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} @@ -30547,6 +30587,11 @@ packages: /svg-arc-to-cubic-bezier@3.2.0: resolution: {integrity: sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==} + /svg-pathdata@6.0.3: + resolution: {integrity: sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==} + engines: {node: '>=12.0.0'} + dev: false + /swagger-ui-dist@4.15.5: resolution: {integrity: sha512-V3eIa28lwB6gg7/wfNvAbjwJYmDXy1Jo1POjyTzlB6wPcHiGlRxq39TSjYGVjQrUSAzpv+a7nzp7mDxgNy57xA==} dev: true @@ -32483,7 +32528,7 @@ packages: kolorist: 1.8.0 sirv: 2.0.3 ufo: 1.3.2 - vite: 4.5.3(@types/node@20.9.2) + vite: 4.5.3(@types/node@18.17.19) transitivePeerDependencies: - rollup - supports-color @@ -32500,7 +32545,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) globrex: 0.1.2 tsconfck: 2.1.2(typescript@4.9.5) - vite: 4.5.3(@types/node@20.9.2) + vite: 4.5.3(@types/node@18.17.19) transitivePeerDependencies: - supports-color - typescript From f57e4822ef97809ddca6852ca803a0da4bc5c5b9 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 30 Apr 2024 13:15:11 +0300 Subject: [PATCH 11/37] feat: implemented mapping for identity verifications page --- .../src/domains/workflows/fetchers.ts | 15 +++--- .../identity-verifications-page.pdf.tsx | 54 +++++++++++++++++++ .../useCaseOptionsLogic.tsx | 4 +- .../IdentityVerificationsPage.tsx | 48 +++++------------ .../components/IdentityItem/IdentityItem.tsx | 39 ++++++-------- .../identity-verifications.schema.ts | 13 +++-- 6 files changed, 101 insertions(+), 72 deletions(-) create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx diff --git a/apps/backoffice-v2/src/domains/workflows/fetchers.ts b/apps/backoffice-v2/src/domains/workflows/fetchers.ts index 9e0e30ae94..2703da0cbf 100644 --- a/apps/backoffice-v2/src/domains/workflows/fetchers.ts +++ b/apps/backoffice-v2/src/domains/workflows/fetchers.ts @@ -1,16 +1,16 @@ -import { env } from '@/common/env/env'; -import qs from 'qs'; -import { deepCamelKeys } from 'string-ts'; -import { z } from 'zod'; import { apiClient } from '@/common/api-client/api-client'; import { Method, States } from '@/common/enums'; +import { env } from '@/common/env/env'; +import { getOriginUrl } from '@/common/utils/get-origin-url/get-url-origin'; import { handleZodError } from '@/common/utils/handle-zod-error/handle-zod-error'; +import { WorkflowDefinitionByIdSchema } from '@/domains/workflow-definitions/fetchers'; +import { AmlSchema } from '@/lib/blocks/components/AmlBlock/utils/aml-adapter'; import { ObjectWithIdSchema } from '@/lib/zod/utils/object-with-id/object-with-id'; import { zPropertyKey } from '@/lib/zod/utils/z-property-key/z-property-key'; +import qs from 'qs'; +import { deepCamelKeys } from 'string-ts'; +import { z } from 'zod'; import { IWorkflowId } from './interfaces'; -import { getOriginUrl } from '@/common/utils/get-origin-url/get-url-origin'; -import { WorkflowDefinitionByIdSchema } from '@/domains/workflow-definitions/fetchers'; -import { AmlSchema } from '@/lib/blocks/components/AmlBlock/utils/aml-adapter'; export const fetchWorkflows = async (params: { filterId: string; @@ -94,6 +94,7 @@ export const BaseWorkflowByIdSchema = z.object({ .or(z.undefined()), }) .optional(), + childWorkflows: z.any().optional(), }), entity: ObjectWithIdSchema.extend({ name: z.string(), diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx new file mode 100644 index 0000000000..890ac1a5b3 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx @@ -0,0 +1,54 @@ +import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; +import { + IdentityVerificationsPage, + IdentityVerificationsSchema, + TIdentityVerificationsData, +} from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage'; +import get from 'lodash/get'; +import map from 'lodash/map'; +import values from 'lodash/values'; + +export class IdentityVerificationsPagePDF extends IPDFRenderer { + static PDF_NAME = 'identityVerificationsPage'; + + async render(): Promise { + const pdfData = await this.getData(); + this.isValid(pdfData); + + return ; + } + + async getData() { + const pdfData: TIdentityVerificationsData = { + companyName: get(this.workflow?.context, 'entity.data.companyName', ''), + creationDate: new Date(), + logoUrl: await this.getLogoUrl(), + items: map( + values(get(this.workflow?.context, 'childWorkflows.kyc_email_session_example', {})), + (session): TIdentityVerificationsData['items'][number] => ({ + firstName: get(session, 'result.childEntity.firstName', ''), + lastName: get(session, 'result.childEntity.lastName', ''), + dateOfBirth: get(session, 'result.entity.data.dateOfBirth'), + status: get(session, 'result.vendorResult.decision.status', '') as + | 'approved' + | 'rejected', + checkDate: get(session, 'result.vendorResult.aml.createdAt'), + id: get(session, 'result.vendorResult.metadata.id', ''), + gender: get(session, 'result.vendorResult.entity.data.additionalInfo.gender', ''), + nationality: get( + session, + 'result.vendorResult.entity.data.additionalInfo.nationality', + '', + ), + reason: get(session, 'result.vendorResult.decision.reason', ''), + }), + ), + }; + + return pdfData; + } + + isValid(data: TIdentityVerificationsData) { + IdentityVerificationsSchema.parse(data); + } +} diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index b2ba3e0f04..98761edcc1 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -4,6 +4,7 @@ import { useCustomerQuery } from '@/domains/customer/hook/queries/useCustomerQue import { TWorkflowById } from '@/domains/workflows/fetchers'; import { CompanyOwnershipPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf'; import { CompanySanctionsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf'; +import { IdentityVerificationsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf'; import { RegistryPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf'; import { TitlePagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf'; import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery'; @@ -32,7 +33,7 @@ export const useCaseOptionsLogic = () => { const { data: workflow } = useCurrentCaseQuery(); const { data: customer } = useCustomerQuery(); - console.log('customer', customer); + console.log({ workflow }); const genereateAndDownloadPDFCertificate = useCallback(async () => { await svgToPng(customer?.logoImageUri || '').then(result => console.log(result)); @@ -44,6 +45,7 @@ export const useCaseOptionsLogic = () => { RegistryPagePDF, CompanyOwnershipPagePDF, CompanySanctionsPagePDF, + IdentityVerificationsPagePDF, ]; const renderers = pdfs.map(PDF => new PDF(workflow as TWorkflowById, customer as TCustomer)); const pages = await Promise.all(renderers.map(renderer => renderer.render())); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx index 65ccda8cba..14e2271b7a 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx @@ -3,47 +3,25 @@ import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-informati import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; -import { - IIdentityItem, - IdentityItem, -} from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem'; +import { IdentityItem } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem'; +import { TIdentityVerificationsData } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema'; import { tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; -import poweredByLogo from './assets/title-page-ballerine-logo.png'; +import { FunctionComponent } from 'react'; -const identities: IIdentityItem[] = [ - { - checkedAt: '12/12/2021', - result: 'approved', - reason: 'Matched with known PEP', - firstName: 'John', - lastName: 'Doe', - dateOfBirth: '01/01/1990', - id: '123', - gender: 'Male', - nationality: 'Singaporean', - }, - { - checkedAt: '12/12/2021', - result: 'rejected', - reason: 'Matched with known PEP', - firstName: 'Jane', - lastName: 'Doe', - dateOfBirth: '01/01/1990', - id: '123', - gender: 'Female', - nationality: 'Singaporean', - }, -]; +interface IIDentityVerificationPageProps { + data: TIdentityVerificationsData; +} + +export const IdentityVerificationsPage: FunctionComponent = ({ + data, +}) => { + const { logoUrl, companyName, items } = data; -export const IdentityVerificationsPage = () => { return ( - + @@ -51,7 +29,7 @@ export const IdentityVerificationsPage = () => { {/* Individual Identity verifications section --- start */} - {identities.map((item, index) => ( + {items.map((item, index) => ( ))} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx index 4fd6cc383f..4303195852 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx @@ -1,25 +1,15 @@ +import { TIdentityVerificationsItemData } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema'; +import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; import { Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; -export interface IIdentityItem { - checkedAt: string; - result: 'approved' | 'rejected'; - reason: string; - firstName: string; - lastName: string; - dateOfBirth: string; - id: string; - gender: string; - nationality: string; -} - interface IIdentityItemProps { - item: IIdentityItem; + item: TIdentityVerificationsItemData; } export const IdentityItem: FunctionComponent = ({ item }) => { - const { checkedAt, reason, result, firstName, lastName, dateOfBirth, id, gender, nationality } = + const { checkDate, reason, status, firstName, lastName, dateOfBirth, id, gender, nationality } = item; return ( @@ -38,7 +28,7 @@ export const IdentityItem: FunctionComponent = ({ item }) => - {checkedAt} + @@ -48,7 +38,7 @@ export const IdentityItem: FunctionComponent = ({ item }) => - {result === 'approved' && ( + {status === 'approved' && ( = ({ item }) => Approved )} - {result === 'rejected' && ( + {status === 'rejected' && ( = ({ item }) => Rejected )} + {!status && } @@ -73,7 +64,7 @@ export const IdentityItem: FunctionComponent = ({ item }) => - {reason} + @@ -83,7 +74,7 @@ export const IdentityItem: FunctionComponent = ({ item }) => - {firstName} + @@ -93,7 +84,7 @@ export const IdentityItem: FunctionComponent = ({ item }) => - {lastName} + @@ -103,7 +94,7 @@ export const IdentityItem: FunctionComponent = ({ item }) => - {dateOfBirth} + @@ -113,7 +104,7 @@ export const IdentityItem: FunctionComponent = ({ item }) => - {id} + @@ -123,7 +114,7 @@ export const IdentityItem: FunctionComponent = ({ item }) => - {gender} + @@ -133,7 +124,7 @@ export const IdentityItem: FunctionComponent = ({ item }) => - {nationality} + diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema.ts index e1b7af966b..a990b8b3bb 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema.ts @@ -2,17 +2,20 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-informati import { z } from 'zod'; export const IdentityVerificationsItemSchema = z.object({ - checkDate: z.date(), - result: z.string(), + checkDate: z.string().optional(), + status: z.enum(['approved', 'rejected']), reason: z.string(), firstName: z.string(), lastName: z.string(), - dateOfBirth: z.date(), + dateOfBirth: z.string().optional(), id: z.string(), - gender: z.string(), - nationality: z.string(), + gender: z.union([z.string(), z.null()]), + nationality: z.union([z.string(), z.null()]), }); export const IdentityVerificationsSchema = BaseCaseInformationPdfSchema.extend({ items: z.array(IdentityVerificationsItemSchema), }); + +export type TIdentityVerificationsItemData = z.output; +export type TIdentityVerificationsData = z.output; From 47eb7e1e3723dad261e33ec9de88d49ef1241987 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 30 Apr 2024 18:00:27 +0300 Subject: [PATCH 12/37] feat: implemented individual sanctions page --- .../identity-verifications-page.pdf.tsx | 46 ++++---- .../individual-sanctions-page.pdf.tsx | 108 ++++++++++++++++++ .../useCaseOptionsLogic.tsx | 2 + .../IndividualSanctionsPage.tsx | 42 ++----- .../IndividualSanctionsItem.tsx | 94 +++++++++------ .../individual-sanctions.schema.ts | 18 ++- 6 files changed, 218 insertions(+), 92 deletions(-) create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx index 890ac1a5b3..0d478a46de 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx @@ -19,30 +19,36 @@ export class IdentityVerificationsPagePDF extends IPDFRenderer ({ - firstName: get(session, 'result.childEntity.firstName', ''), - lastName: get(session, 'result.childEntity.lastName', ''), - dateOfBirth: get(session, 'result.entity.data.dateOfBirth'), - status: get(session, 'result.vendorResult.decision.status', '') as - | 'approved' - | 'rejected', - checkDate: get(session, 'result.vendorResult.aml.createdAt'), - id: get(session, 'result.vendorResult.metadata.id', ''), - gender: get(session, 'result.vendorResult.entity.data.additionalInfo.gender', ''), - nationality: get( - session, - 'result.vendorResult.entity.data.additionalInfo.nationality', - '', - ), - reason: get(session, 'result.vendorResult.decision.reason', ''), - }), - ), + items: childWorkflowSessions + .map(childWorkflowSession => { + return map( + values(childWorkflowSession), + (session): TIdentityVerificationsData['items'][number] => ({ + firstName: get(session, 'result.childEntity.firstName', ''), + lastName: get(session, 'result.childEntity.lastName', ''), + dateOfBirth: get(session, 'result.entity.data.dateOfBirth'), + status: get(session, 'result.vendorResult.decision.status', '') as + | 'approved' + | 'rejected', + checkDate: get(session, 'result.vendorResult.aml.createdAt'), + id: get(session, 'result.vendorResult.metadata.id', ''), + gender: get(session, 'result.vendorResult.entity.data.additionalInfo.gender', ''), + nationality: get( + session, + 'result.vendorResult.entity.data.additionalInfo.nationality', + '', + ), + reason: get(session, 'result.vendorResult.decision.reason', ''), + }), + ); + }) + .flat(), }; return pdfData; diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx new file mode 100644 index 0000000000..b556564946 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx @@ -0,0 +1,108 @@ +import { amlAdapter } from '@/lib/blocks/components/AmlBlock/utils/aml-adapter'; +import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; +import { IndividualSanctionsPage } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage'; +import { + IndividualSanctionsSchema, + TIndividualSanctionsData, +} from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema'; +import get from 'lodash/get'; +import values from 'lodash/values'; + +export class IndividualSantcionsPagePDF extends IPDFRenderer { + static PDF_NAME = 'individualSanctionsPage'; + + async render(): Promise { + const pdfData = await this.getData(); + this.isValid(pdfData); + + return ; + } + + async getData() { + const pdfData: TIndividualSanctionsData = { + companyName: get(this.workflow.context, 'entity.data.companyName', ''), + creationDate: new Date(), + logoUrl: await this.getLogoUrl(), + items: this.extractAmlSessions().map(session => { + const rawAml = get(session, 'result.vendorResult.aml', {}); + const amlData = amlAdapter(rawAml); + + return { + checkDate: amlData.dateOfCheck ?? undefined, + fullName: `${get(session, 'result.childEntity.firstName', '')} ${get( + session, + 'result.childEntity.lastName', + '', + ).trim()}`, + matchesCount: amlData.totalMatches, + names: amlData.matches.map(match => match.aka).flat(0), + warnings: amlData.matches + .map(match => + match.warnings.map( + warning => + ({ + sourceUrl: warning.source, + name: warning.warning, + } as { sourceUrl: string; name: string }), + ), + ) + .flat(1) + .filter(warning => warning.name && warning.sourceUrl), + sanctions: amlData.matches + .map(match => + match.sanctions.map( + sanction => + ({ + sourceUrl: sanction.source, + name: sanction.sanction, + } as { sourceUrl: string; name: string }), + ), + ) + .flat(1) + .filter(sanction => sanction.name && sanction.sourceUrl), + PEP: amlData.matches + .map(match => + match.pep.map( + pep => + ({ sourceUrl: pep.source, name: pep.person } as { + sourceUrl: string; + name: string; + }), + ), + ) + .flat(1) + .filter(pep => pep.name && pep.sourceUrl), + adverseMedia: amlData.matches + .map(match => + match.adverseMedia.map( + adverseMedia => + ({ + sourceUrl: adverseMedia.source, + name: adverseMedia.entry, + } as { sourceUrl: string; name: string }), + ), + ) + .flat(1) + .filter(adverseMedia => adverseMedia.name && adverseMedia.sourceUrl), + }; + }), + }; + + return pdfData; + } + + private extractAmlSessions() { + const childWorkflowSessions = values(get(this.workflow?.context, 'childWorkflows', {})); + const sessions = childWorkflowSessions + .map(childWorkflowSession => { + return values(childWorkflowSession); + }) + .flat(1); + + return sessions; + } + + isValid(data: TIndividualSanctionsData) { + IndividualSanctionsSchema.parse(data); + } +} diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index 98761edcc1..2635c382ac 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -5,6 +5,7 @@ import { TWorkflowById } from '@/domains/workflows/fetchers'; import { CompanyOwnershipPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf'; import { CompanySanctionsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf'; import { IdentityVerificationsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf'; +import { IndividualSantcionsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf'; import { RegistryPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf'; import { TitlePagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf'; import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery'; @@ -46,6 +47,7 @@ export const useCaseOptionsLogic = () => { CompanyOwnershipPagePDF, CompanySanctionsPagePDF, IdentityVerificationsPagePDF, + IndividualSantcionsPagePDF, ]; const renderers = pdfs.map(PDF => new PDF(workflow as TWorkflowById, customer as TCustomer)); const pages = await Promise.all(renderers.map(renderer => renderer.render())); diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx index 73096c0d93..5b985e0b9a 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx @@ -3,40 +3,22 @@ import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-informati import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; -import { - IIndividualSanctionsItem, - IndividualSanctionsItem, -} from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem'; +import { IndividualSanctionsItem } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem'; +import { TIndividualSanctionsData } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema'; import { tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; import poweredByLogo from './assets/title-page-ballerine-logo.png'; -const individualSanctions: IIndividualSanctionsItem[] = [ - { - checkedAt: '12/12/2021', - matchesCount: 2, - names: ['John Doe', 'Jane Doe'], - warnings: [], - sanctions: [], - PEP: [], - adverseMedia: [], - firstName: 'John', - lastName: 'Doe', - }, - { - checkedAt: '12/12/2021', - matchesCount: 0, - names: ['John Doe', 'Jane Doe'], - warnings: ['Matched with known PEP', 'Matched with known PEP'], - sanctions: ['PEP', 'PEP'], - PEP: ['PEP', 'PEP'], - adverseMedia: ['PEP', 'PEP'], - firstName: 'John', - lastName: 'Doe', - }, -]; +interface IIndividualSanctionsPageProps { + data: TIndividualSanctionsData; +} + +export const IndividualSanctionsPage: FunctionComponent = ({ + data, +}) => { + const { items } = data; -export const IndividualSanctionsPage = () => { return ( @@ -51,7 +33,7 @@ export const IndividualSanctionsPage = () => { {/* Company Sanctions section --- start */} - {individualSanctions.map((item, index) => ( + {items.map((item, index) => ( ))} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx index 5a83938dbb..15b0644738 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx @@ -1,46 +1,24 @@ import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { TIndividualSanctionsItemData } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema'; +import { Link, Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; -export interface IIndividualSanctionsItem { - checkedAt: string; - matchesCount: number; - names: string[]; - warnings: string[]; - sanctions: string[]; - PEP: string[]; - adverseMedia: string[]; - firstName: string; - lastName: string; -} - interface IIndividualSanctionsItemProps { - item: IIndividualSanctionsItem; + item: TIndividualSanctionsItemData; } export const IndividualSanctionsItem: FunctionComponent = ({ item, }) => { - const { - checkedAt, - matchesCount, - names, - warnings, - sanctions, - PEP, - adverseMedia, - firstName, - lastName, - } = item; + const { checkDate, matchesCount, names, warnings, sanctions, PEP, adverseMedia, fullName } = item; return ( - {`${firstName} ${lastName}`} + + {fullName} + @@ -50,7 +28,7 @@ export const IndividualSanctionsItem: FunctionComponent - + @@ -70,7 +48,7 @@ export const IndividualSanctionsItem: FunctionComponent - {`${matchesCount} Matche${matchesCount === 1 ? '' : 's'}`} + {`${matchesCount} Match${matchesCount === 1 ? '' : 'es'}`} @@ -90,8 +68,19 @@ export const IndividualSanctionsItem: FunctionComponent - - + + {warnings.length ? ( + warnings.map((warning, index) => ( + + )) + ) : ( + + )} @@ -101,7 +90,18 @@ export const IndividualSanctionsItem: FunctionComponent - + {sanctions.length ? ( + sanctions.map((sanction, index) => ( + + )) + ) : ( + + )} @@ -111,7 +111,18 @@ export const IndividualSanctionsItem: FunctionComponent - + {PEP.length ? ( + PEP.map((PEP, index) => ( + + )) + ) : ( + + )} @@ -121,7 +132,18 @@ export const IndividualSanctionsItem: FunctionComponent - + {adverseMedia.length ? ( + adverseMedia.map((adverseMedia, index) => ( + + )) + ) : ( + + )} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema.ts index c0d052454a..25701eb893 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema.ts @@ -2,13 +2,19 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-informati import { z } from 'zod'; export const IndividualSanctionsItem = z.object({ - checkDate: z.date(), + checkDate: z.string().optional(), + fullName: z.string(), matchesCount: z.number(), names: z.array(z.string()), - warnings: z.array(z.string()), - sanctions: z.array(z.string()), - PEP: z.array(z.string()), - adverseMedia: z.array(z.string()), + warnings: z.array(z.object({ sourceUrl: z.string(), name: z.string() })), + sanctions: z.array(z.object({ sourceUrl: z.string(), name: z.string() })), + PEP: z.array(z.object({ sourceUrl: z.string(), name: z.string() })), + adverseMedia: z.array(z.object({ sourceUrl: z.string(), name: z.string() })), }); -export const IndividualSanctionsSchema = BaseCaseInformationPdfSchema.extend({}); +export const IndividualSanctionsSchema = BaseCaseInformationPdfSchema.extend({ + items: z.array(IndividualSanctionsItem), +}); + +export type TIndividualSanctionsItemData = z.output; +export type TIndividualSanctionsData = z.output; From da3d438cb6e270e32aad174c72c08053ef71980a Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 1 May 2024 12:50:24 +0300 Subject: [PATCH 13/37] feat: implemented empty state pages --- .../renderers/company-ownership-page.pdf.tsx | 11 ++++ .../renderers/company-sanctions-page.pdf.tsx | 12 +++- .../identity-verifications-page.pdf.tsx | 9 +++ .../individual-sanctions-page.pdf.tsx | 13 +++- .../renderers/registry-page.pdf.tsx | 41 ++++++++++--- .../EmptyCompanyOwnershipPage.tsx | 45 ++++++++++++++ .../empty-company-ownership-page.schema.ts | 6 ++ .../pages/CompanyOwnershipPage/index.ts | 1 + .../EmptyCompanySanctionsPage.tsx | 61 +++++++++++++++++++ .../empty-company-sanctions.schema.ts | 6 ++ .../pages/CompanySanctionsPage/index.ts | 1 + .../EmptyIdentityVerificationsPage.tsx | 42 +++++++++++++ .../empty-identity-verfications.schema.ts | 7 +++ .../pages/IdentityVerificationsPage/index.ts | 1 + .../EmptyIndividualSanctionsPage.tsx | 43 +++++++++++++ .../empty-individual-sanctions.schema.ts | 5 ++ .../pages/IndividualSanctionsPage/index.ts | 1 + .../EmptyRegistryInformationPage.tsx | 45 ++++++++++++++ .../RegistryInformationPage.tsx | 2 - .../empty-registry-information-page.schema.ts | 6 ++ .../pages/RegistryInformationPage/index.ts | 1 + .../pages/TitlePage/TitlePage.tsx | 3 +- 22 files changed, 349 insertions(+), 13 deletions(-) create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx create mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx index 8581a5d625..0cee66933b 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx @@ -2,6 +2,7 @@ import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOpti import { CompanyOwnershipPage, CompanyOwnershipSchema, + EmptyCompanyOwnershipPage, TCompanyOwnershipData, } from '@/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage'; import get from 'lodash/get'; @@ -14,6 +15,8 @@ export class CompanyOwnershipPagePDF extends IPDFRenderer const pdfData = await this.getData(); this.isValid(pdfData); + if (this.isEmpty(pdfData)) return ; + return ; } @@ -36,4 +39,12 @@ export class CompanyOwnershipPagePDF extends IPDFRenderer isValid(data: TCompanyOwnershipData) { CompanyOwnershipSchema.parse(data); } + + private isEmpty(data: TCompanyOwnershipData) { + if (!data.items?.length) { + return true; + } + + return false; + } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx index bdea1bbd22..123b925784 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx @@ -2,6 +2,7 @@ import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOpti import { CompanySanctionsPage, CompanySanctionsSchema, + EmptyCompanySanctionsPage, TCompanySanctionsData, } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage'; import get from 'lodash/get'; @@ -12,9 +13,10 @@ export class CompanySanctionsPagePDF extends IPDFRenderer async render(): Promise { const pdfData = await this.getData(); - console.log({ pdfData }); this.isValid(pdfData); + if (this.isEmpty(pdfData)) return ; + return ; } @@ -42,4 +44,12 @@ export class CompanySanctionsPagePDF extends IPDFRenderer isValid(data: TCompanySanctionsData) { CompanySanctionsSchema.parse(data); } + + private isEmpty(data: TCompanySanctionsData) { + if (!data.sanctions?.length) { + return true; + } + + return false; + } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx index 0d478a46de..16b42d5418 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx @@ -1,5 +1,6 @@ import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; import { + EmptyIdentityVerificationsPage, IdentityVerificationsPage, IdentityVerificationsSchema, TIdentityVerificationsData, @@ -15,6 +16,8 @@ export class IdentityVerificationsPagePDF extends IPDFRenderer; + return ; } @@ -57,4 +60,10 @@ export class IdentityVerificationsPagePDF extends IPDFRenderer; + return ; } @@ -105,4 +110,10 @@ export class IndividualSantcionsPagePDF extends IPDFRenderer { +export class RegistryPagePDF extends IPDFRenderer { static PDF_NAME = 'titlePage'; async render(): Promise { const pdfData = await this.getData(); this.isValid(pdfData); + if (this.isEmpty(pdfData)) return ; + return ; } @@ -49,7 +51,32 @@ export class RegistryPagePDF extends IPDFRenderer { return pdfData; } - isValid(data: TTitlePageData) { + isValid(data: TRegistryInformationData) { TitlePageSchema.parse(data); } + + private isEmpty(data: TRegistryInformationData) { + const values = [ + data.registrationNumber, + data.incorporationDate, + data.companyType, + data.companyStatus, + data.registrationAddress, + data.registryPage, + data.lastUpdate, + data.registeredAt, + ]; + + if ( + values.every(value => { + if (Array.isArray(value) && !value.length) return true; + + return !value; + }) + ) { + return true; + } + + return false; + } } diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx new file mode 100644 index 0000000000..0c9cd9e4bb --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx @@ -0,0 +1,45 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { TEmptyRegistryInformationPageData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema'; +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +interface IEmptyRegistryInformationPageProps { + data: TEmptyRegistryInformationPageData; +} + +export const EmptyCompanyOwnershipPage: FunctionComponent = ({ + data, +}) => { + const { logoUrl, companyName } = data; + + return ( + + + + + + + + {/* Registry Information section --- start */} + + + + Company ownership not available + + + {/* Registry Information section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts new file mode 100644 index 0000000000..7f53e2c727 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts @@ -0,0 +1,6 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const emptyCompanyOwnershipPageSchema = BaseCaseInformationPdfSchema.extend({}); + +export type TEmptyCompanyOwnershipPageeData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts index 09b6f203bb..6d5cfcfabf 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/index.ts @@ -1,2 +1,3 @@ export * from './CompanyOwnershipPage'; +export * from './EmptyCompanyOwnershipPage'; export * from './company-ownership.schema'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx new file mode 100644 index 0000000000..c9ba8af6ef --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx @@ -0,0 +1,61 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { TEmptyCompanySanctionsPageData } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema'; +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +interface IEmptyCompanySanctionsPageProps { + data: TEmptyCompanySanctionsPageData; +} + +export const EmptyCompanySanctionsPage: FunctionComponent = ({ + data, +}) => { + const { companyName, logoUrl } = data; + + return ( + + + + + + + + {/* Company Sanctions section --- start */} + + + + + + Scan Status + + + Completed + + + + + Total Matches + + + + {0} + {' matches'} + + + + {/* Company Sanctions section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts new file mode 100644 index 0000000000..77c5a43544 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts @@ -0,0 +1,6 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const emptyCompanySanctionsPageSchema = BaseCaseInformationPdfSchema.extend({}); + +export type TEmptyCompanySanctionsPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts index a3cf34912b..8196e881b1 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/index.ts @@ -1,2 +1,3 @@ export * from './CompanySanctionsPage'; +export * from './EmptyCompanySanctionsPage'; export * from './company-sanctions.schema'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx new file mode 100644 index 0000000000..0035665f5c --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx @@ -0,0 +1,42 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { TEmptyIdentityVerificationsPageData } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema'; +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +interface IEmptyIdentityVerificationPageProps { + data: TEmptyIdentityVerificationsPageData; +} + +export const EmptyIdentityVerificationsPage: FunctionComponent< + IEmptyIdentityVerificationPageProps +> = ({ data }) => { + const { logoUrl, companyName } = data; + + return ( + + + + + + + + {/* Individual Identity verifications section --- start */} + + + + Individual identity verifications not available + + + {/* Individual Identity verifications section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts new file mode 100644 index 0000000000..39ce8b671d --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts @@ -0,0 +1,7 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const emptyIdentityVerificationsPageSchema = BaseCaseInformationPdfSchema.extend({}); +export type TEmptyIdentityVerificationsPageData = z.infer< + typeof emptyIdentityVerificationsPageSchema +>; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts index c05d73665a..35a259bb68 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/index.ts @@ -1,2 +1,3 @@ +export * from './EmptyIdentityVerificationsPage'; export * from './IdentityVerificationsPage'; export * from './identity-verifications.schema'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx new file mode 100644 index 0000000000..36b87a220f --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx @@ -0,0 +1,43 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { TEmptyIndividualSanctionsPageData } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema'; +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; +import poweredByLogo from './assets/title-page-ballerine-logo.png'; + +interface IEmptyIndividualSanctionsPageProps { + data: TEmptyIndividualSanctionsPageData; +} + +export const EmptyIndividualSanctionsPage: FunctionComponent< + IEmptyIndividualSanctionsPageProps +> = ({ data }) => { + const { companyName } = data; + + return ( + + + + + + + + {/* Company Sanctions section --- start */} + + + + Individual PEP/Sanctions not available + + + {/* Company Sanctions section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts new file mode 100644 index 0000000000..1b406c9418 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts @@ -0,0 +1,5 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const emptyIndividualSanctionsPageSchema = BaseCaseInformationPdfSchema.extend({}); +export type TEmptyIndividualSanctionsPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/index.ts index 51a9dd6c3e..e9635d59d4 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/index.ts @@ -1 +1,2 @@ +export * from './EmptyIndividualSanctionsPage'; export * from './IndividualSanctionsPage'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx new file mode 100644 index 0000000000..43d416cdb1 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx @@ -0,0 +1,45 @@ +import { CaseInformationDisclaimer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationDisclaimer/CaseInformationDisclaimer'; +import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer'; +import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; +import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; +import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; +import { TEmptyRegistryInformationPageData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema'; +import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { View } from '@react-pdf/renderer'; +import { FunctionComponent } from 'react'; + +interface IEmptyRegistryInformationPageProps { + data: TEmptyRegistryInformationPageData; +} + +export const EmptyRegistryInformationPage: FunctionComponent< + IEmptyRegistryInformationPageProps +> = ({ data }) => { + const { logoUrl, companyName } = data; + + return ( + + + + + + + + {/* Registry Information section --- start */} + + + + Registry Information not available + + + {/* Registry Information section --- end */} + + + + + + ); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx index fd87e21926..526632d53f 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx @@ -21,8 +21,6 @@ export const RegistryInformationPage: FunctionComponent diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts new file mode 100644 index 0000000000..898d192b76 --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts @@ -0,0 +1,6 @@ +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; +import { z } from 'zod'; + +export const emptyRegistryInformationPageSchema = BaseCaseInformationPdfSchema.extend({}); + +export type TEmptyRegistryInformationPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/index.ts index ecc32147f3..cd28bb3de5 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/index.ts @@ -1 +1,2 @@ +export * from './EmptyRegistryInformationPage'; export * from './RegistryInformationPage'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx index 2a08d90421..e03b22b9d8 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx @@ -30,10 +30,9 @@ export const TitlePage: FunctionComponent = ({ data }) => { {/* Company Info section --- end */} {/* Document information section --- start*/} - + {new Date(creationDate).toISOString()} - {new Date().toISOString()} {/* Document information section --- end*/} {/* Table of contents section --- start */} From 8f213483c303c0c41116e2cb14557f77dd7cfd6f Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 1 May 2024 12:54:26 +0300 Subject: [PATCH 14/37] fix: lock fix --- .../useCaseOptionsLogic.tsx | 2 - pnpm-lock.yaml | 41 ++----------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index 2635c382ac..8d22acec79 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -34,8 +34,6 @@ export const useCaseOptionsLogic = () => { const { data: workflow } = useCurrentCaseQuery(); const { data: customer } = useCustomerQuery(); - console.log({ workflow }); - const genereateAndDownloadPDFCertificate = useCallback(async () => { await svgToPng(customer?.logoImageUri || '').then(result => console.log(result)); try { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 396b622838..b99618b5cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -153,9 +153,6 @@ importers: broadcast-channel: specifier: ^7.0.0 version: 7.0.0 - canvg: - specifier: ^4.0.2 - version: 4.0.2 class-variance-authority: specifier: ^0.6.0 version: 0.6.1 @@ -8528,7 +8525,7 @@ packages: magic-string: 0.27.0 react-docgen-typescript: 2.2.2(typescript@4.9.5) typescript: 4.9.5 - vite: 4.5.3(@types/node@18.17.19) + vite: 4.5.3(@types/node@20.9.2) dev: true /@joshwooding/vite-plugin-react-docgen-typescript@0.3.0(typescript@5.1.6)(vite@4.5.3): @@ -14137,7 +14134,7 @@ packages: react: 18.2.0 react-docgen: 6.0.4 react-dom: 18.2.0(react@18.2.0) - vite: 4.5.3(@types/node@18.17.19) + vite: 4.5.3(@types/node@20.9.2) transitivePeerDependencies: - '@preact/preset-vite' - encoding @@ -15549,10 +15546,6 @@ packages: resolution: {integrity: sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==} dev: true - /@types/raf@3.4.3: - resolution: {integrity: sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==} - dev: false - /@types/range-parser@1.2.7: resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} dev: true @@ -18505,17 +18498,6 @@ packages: resolution: {integrity: sha512-1Pbh5FLmn5y4+QhNyJE9j3/7dK44dGB83/ZMjv/qJk86TvDbjk0LosiZo0i0WB0Vx607qMX9jYrn1VLHCkN4rw==} dev: true - /canvg@4.0.2: - resolution: {integrity: sha512-/7kIZger/mdFci4KXdtMr+NQB4GU1InkJ4RwSyDBRcvy4BUlg1hD+ZUWo550sWPyWaKZ8purqby6kjf09qVriw==} - engines: {node: '>=12.0.0'} - dependencies: - '@types/raf': 3.4.3 - raf: 3.4.1 - rgbcolor: 1.0.1 - stackblur-canvas: 2.7.0 - svg-pathdata: 6.0.3 - dev: false - /capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} dependencies: @@ -29261,11 +29243,6 @@ packages: resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} dev: true - /rgbcolor@1.0.1: - resolution: {integrity: sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==} - engines: {node: '>= 0.8.15'} - dev: false - /rimraf@2.6.3: resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} hasBin: true @@ -30058,11 +30035,6 @@ packages: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true - /stackblur-canvas@2.7.0: - resolution: {integrity: sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==} - engines: {node: '>=0.1.14'} - dev: false - /statuses@2.0.1: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} @@ -30587,11 +30559,6 @@ packages: /svg-arc-to-cubic-bezier@3.2.0: resolution: {integrity: sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==} - /svg-pathdata@6.0.3: - resolution: {integrity: sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==} - engines: {node: '>=12.0.0'} - dev: false - /swagger-ui-dist@4.15.5: resolution: {integrity: sha512-V3eIa28lwB6gg7/wfNvAbjwJYmDXy1Jo1POjyTzlB6wPcHiGlRxq39TSjYGVjQrUSAzpv+a7nzp7mDxgNy57xA==} dev: true @@ -32528,7 +32495,7 @@ packages: kolorist: 1.8.0 sirv: 2.0.3 ufo: 1.3.2 - vite: 4.5.3(@types/node@18.17.19) + vite: 4.5.3(@types/node@20.9.2) transitivePeerDependencies: - rollup - supports-color @@ -32545,7 +32512,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) globrex: 0.1.2 tsconfck: 2.1.2(typescript@4.9.5) - vite: 4.5.3(@types/node@18.17.19) + vite: 4.5.3(@types/node@20.9.2) transitivePeerDependencies: - supports-color - typescript From 2fe223b224ee49de94300d1e2cf53f378f2c2a08 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 21 May 2024 16:12:31 +0300 Subject: [PATCH 15/37] fix: removed reduntant canvas removal from body --- apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts b/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts index 1f0d488362..20ea8989ff 100644 --- a/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts +++ b/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts @@ -13,7 +13,6 @@ export const svgToPng = (imageUrl: string): Promise => { const dataUrl = canvas.toDataURL('image/png'); resolve(dataUrl); - document.body.removeChild(canvas); }; img.onerror = error => { reject(error); From d9046420a458a979c4fa6c0f31955c79c1942f15 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 11:03:29 +0300 Subject: [PATCH 16/37] fix: schemas --- .../src/domains/workflows/fetchers.ts | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/apps/backoffice-v2/src/domains/workflows/fetchers.ts b/apps/backoffice-v2/src/domains/workflows/fetchers.ts index 2703da0cbf..f8e52ef2dd 100644 --- a/apps/backoffice-v2/src/domains/workflows/fetchers.ts +++ b/apps/backoffice-v2/src/domains/workflows/fetchers.ts @@ -55,8 +55,6 @@ export const fetchWorkflows = async (params: { return handleZodError(error, workflows); }; -export type TWorkflowById = z.output; - export const BaseWorkflowByIdSchema = z.object({ id: z.string(), status: z.string(), @@ -108,19 +106,7 @@ export const BaseWorkflowByIdSchema = z.object({ }).nullable(), }); -export const WorkflowByIdSchema = BaseWorkflowByIdSchema.extend({ - childWorkflows: z - .array( - BaseWorkflowByIdSchema.omit({ - context: true, - }).extend({ - context: BaseWorkflowByIdSchema.shape.context.omit({ - flowConfig: true, - }), - }), - ) - .optional(), -}); +export type TWorkflowById = z.output; export const fetchWorkflowById = async ({ workflowId, @@ -132,7 +118,7 @@ export const fetchWorkflowById = async ({ const [workflow, error] = await apiClient({ endpoint: `workflows/${workflowId}?filterId=${filterId}`, method: Method.GET, - schema: WorkflowByIdSchema.transform(data => ({ + schema: BaseWorkflowByIdSchema.transform(data => ({ ...data, context: { ...data.context, @@ -249,7 +235,7 @@ export const updateWorkflowDecision = async ({ }`, method: Method.PATCH, body, - schema: WorkflowByIdSchema.pick({ + schema: BaseWorkflowByIdSchema.pick({ context: true, }), }); From a7cdae1437028f1b539016ba35b681b6873a0119 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 11:20:02 +0300 Subject: [PATCH 17/37] fix: refactor --- .../renderers/company-ownership-page.pdf.tsx | 6 +----- .../renderers/company-sanctions-page.pdf.tsx | 6 +----- .../renderers/identity-verifications-page.pdf.tsx | 4 +--- .../renderers/individual-sanctions-page.pdf.tsx | 4 +--- .../renderers/registry-page.pdf.tsx | 14 ++++---------- 5 files changed, 8 insertions(+), 26 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx index 0cee66933b..6d2a6d1994 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx @@ -41,10 +41,6 @@ export class CompanyOwnershipPagePDF extends IPDFRenderer } private isEmpty(data: TCompanyOwnershipData) { - if (!data.items?.length) { - return true; - } - - return false; + return !data.items?.length; } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx index 123b925784..60ae468a31 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx @@ -46,10 +46,6 @@ export class CompanySanctionsPagePDF extends IPDFRenderer } private isEmpty(data: TCompanySanctionsData) { - if (!data.sanctions?.length) { - return true; - } - - return false; + return !data.sanctions?.length; } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx index 16b42d5418..510c111ea0 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx @@ -62,8 +62,6 @@ export class IdentityVerificationsPagePDF extends IPDFRenderer { data.registeredAt, ]; - if ( - values.every(value => { - if (Array.isArray(value) && !value.length) return true; + return values.every(value => { + if (Array.isArray(value) && !value.length) return true; - return !value; - }) - ) { - return true; - } - - return false; + return !value; + }); } } From 624e673513fa1f71b2a063e9055dff3e38795c29 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 11:27:19 +0300 Subject: [PATCH 18/37] fix: registerFont moved to main file --- apps/backoffice-v2/src/main.tsx | 4 ++++ .../hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/backoffice-v2/src/main.tsx b/apps/backoffice-v2/src/main.tsx index 0103491fb7..69f60893e9 100644 --- a/apps/backoffice-v2/src/main.tsx +++ b/apps/backoffice-v2/src/main.tsx @@ -7,11 +7,15 @@ import '@ballerine/ui/dist/style.css'; import '@fontsource/inter'; import { Toaster } from '@/common/components/organisms/Toaster/Toaster'; +import { registerFont } from '@ballerine/react-pdf-toolkit'; +import { Font } from '@react-pdf/renderer'; import { Router } from './Router/Router'; import { env } from './common/env/env'; import './i18n'; import './index.css'; +registerFont(Font); + export const TOAST_DURATION_IN_MS = 1000 * 3; const rootElement = document.getElementById('root'); diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index 8d22acec79..5fab201b82 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -9,13 +9,10 @@ import { IndividualSantcionsPagePDF } from '@/pages/Entity/components/Case/compo import { RegistryPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf'; import { TitlePagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf'; import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery'; -import { registerFont } from '@ballerine/react-pdf-toolkit'; -import { Document, Font, pdf } from '@react-pdf/renderer'; +import { Document, pdf } from '@react-pdf/renderer'; import { useCallback, useState } from 'react'; import { toast } from 'sonner'; -registerFont(Font); - const downloadFile = (file: File) => { const link = document.createElement('a'); From 83703f241e64e65235335f0397f436e82464c46c Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 11:30:18 +0300 Subject: [PATCH 19/37] fix: removed reduntant method call --- .../hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index 5fab201b82..de6957ff1a 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -1,4 +1,3 @@ -import { svgToPng } from '@/common/utils/svg-to-png/svg-to-png'; import { TCustomer } from '@/domains/customer/fetchers'; import { useCustomerQuery } from '@/domains/customer/hook/queries/useCustomerQuery/userCustomerQuery'; import { TWorkflowById } from '@/domains/workflows/fetchers'; @@ -32,7 +31,6 @@ export const useCaseOptionsLogic = () => { const { data: customer } = useCustomerQuery(); const genereateAndDownloadPDFCertificate = useCallback(async () => { - await svgToPng(customer?.logoImageUri || '').then(result => console.log(result)); try { setIsGeneratingPDF(true); From b44b1d9098511e3432811c6b0e99e1d9f5b62775 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 11:48:29 +0300 Subject: [PATCH 20/37] fix: fixed type --- .../CaseInformationPageContainer.tsx | 11 ++--------- .../CaseInformationPageSection.tsx | 13 ++++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx index a3a8c4197a..20980f3c02 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx @@ -1,15 +1,8 @@ +import { FunctionComponentWithChildren } from '@/common/types'; import { tw } from '@ballerine/react-pdf-toolkit'; -import { AnyChildren } from '@ballerine/ui'; import { Page, View } from '@react-pdf/renderer'; -import { FunctionComponent } from 'react'; -interface ICaseInformationPageContainer { - children: AnyChildren; -} - -export const CaseInformationPageContainer: FunctionComponent = ({ - children, -}) => ( +export const CaseInformationPageContainer: FunctionComponentWithChildren = ({ children }) => ( {children} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx index 108485a5a5..c505c0871e 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx @@ -1,12 +1,7 @@ +import { FunctionComponentWithChildren } from '@/common/types'; import { tw } from '@ballerine/react-pdf-toolkit'; -import { AnyChildren } from '@ballerine/ui'; import { View } from '@react-pdf/renderer'; -import { FunctionComponent } from 'react'; -interface ICaseInformationPageSectionProps { - children: AnyChildren; -} - -export const CaseInformationPageSection: FunctionComponent = ({ - children, -}) => {children}; +export const CaseInformationPageSection: FunctionComponentWithChildren = ({ children }) => ( + {children} +); From 7b70e501c2a9db7057c991d6dbdba61e9d98dc5d Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 11:51:30 +0300 Subject: [PATCH 21/37] fix: schema --- .../empty-company-ownership-page.schema.ts | 2 +- .../pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx | 3 +-- .../CompanySanctionsPage/empty-company-sanctions.schema.ts | 2 +- .../empty-identity-verfications.schema.ts | 2 +- .../empty-individual-sanctions.schema.ts | 2 +- .../empty-registry-information-page.schema.ts | 2 +- .../pdfs/case-information/pages/TitlePage/title-page.schema.ts | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts index 7f53e2c727..9d0d36003b 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyCompanyOwnershipPageSchema = BaseCaseInformationPdfSchema.extend({}); +export const emptyCompanyOwnershipPageSchema = BaseCaseInformationPdfSchema export type TEmptyCompanyOwnershipPageeData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx index c9ba8af6ef..22ca4a4ce8 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx @@ -46,8 +46,7 @@ export const EmptyCompanySanctionsPage: FunctionComponent - {0} - {' matches'} + 0 matches diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts index 77c5a43544..924e3923c7 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyCompanySanctionsPageSchema = BaseCaseInformationPdfSchema.extend({}); +export const emptyCompanySanctionsPageSchema = BaseCaseInformationPdfSchema; export type TEmptyCompanySanctionsPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts index 39ce8b671d..270da1ff6a 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts @@ -1,7 +1,7 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyIdentityVerificationsPageSchema = BaseCaseInformationPdfSchema.extend({}); +export const emptyIdentityVerificationsPageSchema = BaseCaseInformationPdfSchema export type TEmptyIdentityVerificationsPageData = z.infer< typeof emptyIdentityVerificationsPageSchema >; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts index 1b406c9418..6209825050 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts @@ -1,5 +1,5 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyIndividualSanctionsPageSchema = BaseCaseInformationPdfSchema.extend({}); +export const emptyIndividualSanctionsPageSchema = BaseCaseInformationPdfSchema export type TEmptyIndividualSanctionsPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts index 898d192b76..deb8cfc795 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyRegistryInformationPageSchema = BaseCaseInformationPdfSchema.extend({}); +export const emptyRegistryInformationPageSchema = BaseCaseInformationPdfSchema export type TEmptyRegistryInformationPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts index 2c975d6ce0..0c56121e9e 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const TitlePageSchema = BaseCaseInformationPdfSchema.extend({}); +export const TitlePageSchema = BaseCaseInformationPdfSchema export type TTitlePageData = z.infer; From 97325c3b372205adee5724ae9e5f6a197b9e78ff Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 12:25:56 +0300 Subject: [PATCH 22/37] feat: pdf now opened in new tab instead of download --- .../useCaseOptionsLogic.tsx | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index de6957ff1a..773780adee 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -12,17 +12,13 @@ import { Document, pdf } from '@react-pdf/renderer'; import { useCallback, useState } from 'react'; import { toast } from 'sonner'; -const downloadFile = (file: File) => { - const link = document.createElement('a'); +const openFile = (blob: Blob) => { + const url = URL.createObjectURL(blob); + window.open(url, '_blank'); - link.href = URL.createObjectURL(file); - link.download = file.name; - - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - - URL.revokeObjectURL(link.href); + setTimeout(() => { + URL.revokeObjectURL(url); + }, 10_000); }; export const useCaseOptionsLogic = () => { @@ -47,9 +43,7 @@ export const useCaseOptionsLogic = () => { const PDFBlob = await pdf({pages}).toBlob(); - const pdfFile = new File([PDFBlob], 'certificate.pdf'); - - downloadFile(pdfFile); + openFile(PDFBlob); } catch (error) { console.error(`Failed to download PDF certificate: ${error}`); toast.error('Failed to download PDF certificate.'); From f77727b497c71006e979569706264299672f5de2 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 12:30:37 +0300 Subject: [PATCH 23/37] fix: refactor --- .../empty-company-ownership-page.schema.ts | 2 +- .../empty-identity-verfications.schema.ts | 2 +- .../empty-individual-sanctions.schema.ts | 2 +- .../RegistryInformationPage/RegistryInformationPage.tsx | 4 ++-- .../empty-registry-information-page.schema.ts | 2 +- .../RegistryInformationPage/utils/create-registry-items.ts | 6 ++---- .../case-information/pages/TitlePage/title-page.schema.ts | 2 +- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts index 9d0d36003b..b23201a92c 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyCompanyOwnershipPageSchema = BaseCaseInformationPdfSchema +export const emptyCompanyOwnershipPageSchema = BaseCaseInformationPdfSchema; export type TEmptyCompanyOwnershipPageeData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts index 270da1ff6a..eb8e6a87b4 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts @@ -1,7 +1,7 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyIdentityVerificationsPageSchema = BaseCaseInformationPdfSchema +export const emptyIdentityVerificationsPageSchema = BaseCaseInformationPdfSchema; export type TEmptyIdentityVerificationsPageData = z.infer< typeof emptyIdentityVerificationsPageSchema >; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts index 6209825050..a56c540a6a 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts @@ -1,5 +1,5 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyIndividualSanctionsPageSchema = BaseCaseInformationPdfSchema +export const emptyIndividualSanctionsPageSchema = BaseCaseInformationPdfSchema; export type TEmptyIndividualSanctionsPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx index 526632d53f..5e6dd82a28 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx @@ -5,7 +5,7 @@ import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema'; -import { createRegistryItems } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items'; +import { registryItemsAdapter } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items'; import { Link, Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; @@ -19,7 +19,7 @@ export const RegistryInformationPage: FunctionComponent { const { companyName, logoUrl } = data; - const registryItems = createRegistryItems(data); + const registryItems = registryItemsAdapter(data); return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts index deb8cfc795..5724df61c3 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyRegistryInformationPageSchema = BaseCaseInformationPdfSchema +export const emptyRegistryInformationPageSchema = BaseCaseInformationPdfSchema; export type TEmptyRegistryInformationPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts index fca9f3bce4..fbef34f502 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts @@ -1,9 +1,7 @@ import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema'; import { IRegistryInformationItem } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/types'; -export const createRegistryItems = ( - registryInformationData: TRegistryInformationData, -): IRegistryInformationItem[] => { +export const registryItemsAdapter = (registryInformationData: TRegistryInformationData) => { const { companyName, registrationNumber, @@ -69,5 +67,5 @@ export const createRegistryItems = ( value: registryPage || '', valueType: 'link', }, - ]; + ] satisfies IRegistryInformationItem[]; }; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts index 0c56121e9e..9de2280782 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const TitlePageSchema = BaseCaseInformationPdfSchema +export const TitlePageSchema = BaseCaseInformationPdfSchema; export type TTitlePageData = z.infer; From 4399427412bdc04f0ad2db5255a00fd08eada34d Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 12:51:51 +0300 Subject: [PATCH 24/37] fix: refactor & cleaned assets --- .../assets/title-page-ballerine-logo.png | Bin .../empty-company-ownership-page.schema.ts | 4 ++-- .../assets/title-page-ballerine-logo.png | Bin 4530 -> 0 bytes .../empty-company-sanctions.schema.ts | 4 ++-- .../assets/title-page-ballerine-logo.png | Bin 4530 -> 0 bytes .../empty-identity-verfications.schema.ts | 4 ++-- .../EmptyIndividualSanctionsPage.tsx | 2 +- .../IndividualSanctionsPage.tsx | 2 +- .../assets/title-page-ballerine-logo.png | Bin 4530 -> 0 bytes .../empty-individual-sanctions.schema.ts | 4 ++-- .../assets/title-page-ballerine-logo.png | Bin 4530 -> 0 bytes .../empty-registry-information-page.schema.ts | 4 ++-- .../registry-information.schema.ts | 4 ++-- 13 files changed, 14 insertions(+), 14 deletions(-) rename apps/backoffice-v2/src/pages/Entity/pdfs/case-information/{pages/CompanyOwnershipPage => }/assets/title-page-ballerine-logo.png (100%) delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/assets/title-page-ballerine-logo.png delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/assets/title-page-ballerine-logo.png delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/assets/title-page-ballerine-logo.png delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/assets/title-page-ballerine-logo.png diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/assets/title-page-ballerine-logo.png similarity index 100% rename from apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/assets/title-page-ballerine-logo.png rename to apps/backoffice-v2/src/pages/Entity/pdfs/case-information/assets/title-page-ballerine-logo.png diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts index b23201a92c..d49fb1e375 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyCompanyOwnershipPageSchema = BaseCaseInformationPdfSchema; +export const EmptyCompanyOwnershipPageSchema = BaseCaseInformationPdfSchema; -export type TEmptyCompanyOwnershipPageeData = z.infer; +export type TEmptyCompanyOwnershipPageeData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/assets/title-page-ballerine-logo.png deleted file mode 100644 index c6388031d755b4165c45bb13fb6b4371617fdc57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h zK_fy4AyEgb=a{JhOn3#-q;`J|hx92q9!qB9=EEiq1rSag^l=gb+d&We0nw9WgHg zd)Tk0V?-7qge-)>Zag-)3>EBU3Lu0K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QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts index 924e3923c7..d2fefba6ad 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyCompanySanctionsPageSchema = BaseCaseInformationPdfSchema; +export const EmptyCompanySanctionsPageSchema = BaseCaseInformationPdfSchema; -export type TEmptyCompanySanctionsPageData = z.infer; +export type TEmptyCompanySanctionsPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/assets/title-page-ballerine-logo.png deleted file mode 100644 index c6388031d755b4165c45bb13fb6b4371617fdc57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h zK_fy4AyEgb=a{JhOn3#-q;`J|hx92q9!qB9=EEiq1rSag^l=gb+d&We0nw9WgHg zd)Tk0V?-7qge-)>Zag-)3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 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts index eb8e6a87b4..2a2d838bbd 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts @@ -1,7 +1,7 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyIdentityVerificationsPageSchema = BaseCaseInformationPdfSchema; +export const EmptyIdentityVerificationsPageSchema = BaseCaseInformationPdfSchema; export type TEmptyIdentityVerificationsPageData = z.infer< - typeof emptyIdentityVerificationsPageSchema + typeof EmptyIdentityVerificationsPageSchema >; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx index 36b87a220f..9f8efb873d 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx @@ -7,7 +7,7 @@ import { TEmptyIndividualSanctionsPageData } from '@/pages/Entity/pdfs/case-info import { Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; -import poweredByLogo from './assets/title-page-ballerine-logo.png'; +import poweredByLogo from '../../assets/title-page-ballerine-logo.png'; interface IEmptyIndividualSanctionsPageProps { data: TEmptyIndividualSanctionsPageData; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx index 5b985e0b9a..fd2add7590 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx @@ -8,7 +8,7 @@ import { TIndividualSanctionsData } from '@/pages/Entity/pdfs/case-information/p import { tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; -import poweredByLogo from './assets/title-page-ballerine-logo.png'; +import poweredByLogo from '../../assets/title-page-ballerine-logo.png'; interface IIndividualSanctionsPageProps { data: TIndividualSanctionsData; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/assets/title-page-ballerine-logo.png deleted file mode 100644 index c6388031d755b4165c45bb13fb6b4371617fdc57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h zK_fy4AyEgb=a{JhOn3#-q;`J|hx92q9!qB9=EEiq1rSag^l=gb+d&We0nw9WgHg zd)Tk0V?-7qge-)>Zag-)3>EB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?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts index a56c540a6a..fe83980909 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts @@ -1,5 +1,5 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyIndividualSanctionsPageSchema = BaseCaseInformationPdfSchema; -export type TEmptyIndividualSanctionsPageData = z.infer; +export const EmptyIndividualSanctionsPageSchema = BaseCaseInformationPdfSchema; +export type TEmptyIndividualSanctionsPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/assets/title-page-ballerine-logo.png deleted file mode 100644 index c6388031d755b4165c45bb13fb6b4371617fdc57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h zK_fy4AyEgb=a{JhOn3#-q;`J|hx92q9!qB9=EEiq1rSag^l=gb+d&We0nw9WgHg zd)Tk0V?-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_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts index 5724df61c3..bc4146e163 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts @@ -1,6 +1,6 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const emptyRegistryInformationPageSchema = BaseCaseInformationPdfSchema; +export const EmptyRegistryInformationPageSchema = BaseCaseInformationPdfSchema; -export type TEmptyRegistryInformationPageData = z.infer; +export type TEmptyRegistryInformationPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts index f68477676c..bbaa706459 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts @@ -1,7 +1,7 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const registryInformationSchema = BaseCaseInformationPdfSchema.extend({ +export const ReigstryInformationSchema = BaseCaseInformationPdfSchema.extend({ companyName: z.string(), registrationNumber: z.string(), incorporationDate: z.string(), @@ -13,4 +13,4 @@ export const registryInformationSchema = BaseCaseInformationPdfSchema.extend({ registryPage: z.string(), }); -export type TRegistryInformationData = z.infer; +export type TRegistryInformationData = z.infer; From 1b3e676b270bea3ec9fb2ab19b44f0ca5b9e3298 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 13:02:43 +0300 Subject: [PATCH 25/37] fix: fixed date formats --- .../pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx | 3 ++- .../pages/CompanySanctionsPage/CompanySanctionsPage.tsx | 3 ++- .../pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx | 3 ++- .../RegistryInformationPage/EmptyRegistryInformationPage.tsx | 3 ++- .../pages/RegistryInformationPage/RegistryInformationPage.tsx | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx index 0c9cd9e4bb..9e702cd587 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx @@ -6,6 +6,7 @@ import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-infor import { TEmptyRegistryInformationPageData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema'; import { Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; +import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; interface IEmptyRegistryInformationPageProps { @@ -28,7 +29,7 @@ export const EmptyCompanyOwnershipPage: FunctionComponent diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx index 180d4d09dd..86102eaf68 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx @@ -8,6 +8,7 @@ import { TCompanySanctionsData } from '@/pages/Entity/pdfs/case-information/page import { CompanySanctionsMatchSection } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection'; import { Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; +import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; interface ICompanySanctionsPageProps { @@ -28,7 +29,7 @@ export const CompanySanctionsPage: FunctionComponent {/* Company Sanctions section --- start */} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx index 22ca4a4ce8..64fab65fa7 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx @@ -6,6 +6,7 @@ import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-infor import { TEmptyCompanySanctionsPageData } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema'; import { Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; +import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; interface IEmptyCompanySanctionsPageProps { @@ -28,7 +29,7 @@ export const EmptyCompanySanctionsPage: FunctionComponent diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx index 43d416cdb1..1c33e649d3 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx @@ -6,6 +6,7 @@ import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-infor import { TEmptyRegistryInformationPageData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema'; import { Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; +import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; interface IEmptyRegistryInformationPageProps { @@ -28,7 +29,7 @@ export const EmptyRegistryInformationPage: FunctionComponent< {/* Registry Information section --- start */} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx index 5e6dd82a28..94efbf624a 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx @@ -8,6 +8,7 @@ import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/p import { registryItemsAdapter } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items'; import { Link, Typography, tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; +import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; export interface IRegistryInformationPageProps { @@ -32,7 +33,7 @@ export const RegistryInformationPage: FunctionComponent From 649e021b140725d4b3638cb0575e48685cf26612 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 22 May 2024 14:07:41 +0300 Subject: [PATCH 26/37] feat: refactored mapping & removed lodash --- apps/backoffice-v2/package.json | 2 - .../renderers/company-ownership-page.pdf.tsx | 6 +-- .../renderers/company-sanctions-page.pdf.tsx | 21 ++++----- .../identity-verifications-page.pdf.tsx | 43 +++++++------------ .../individual-sanctions-page.pdf.tsx | 18 +++----- .../renderers/registry-page.pdf.tsx | 31 ++++++------- .../renderers/title-page.pdf.tsx | 3 +- pnpm-lock.yaml | 10 +---- 8 files changed, 50 insertions(+), 84 deletions(-) diff --git a/apps/backoffice-v2/package.json b/apps/backoffice-v2/package.json index 2e7135d896..d183f478bf 100644 --- a/apps/backoffice-v2/package.json +++ b/apps/backoffice-v2/package.json @@ -93,7 +93,6 @@ "i18next-http-backend": "^2.1.1", "leaflet": "^1.9.4", "libphonenumber-js": "^1.10.49", - "lodash": "^4.17.21", "lucide-react": "^0.239.0", "match-sorter": "^6.3.1", "msw": "^1.0.0", @@ -135,7 +134,6 @@ "@testing-library/react": "^13.3.0", "@total-typescript/ts-reset": "^0.5.1", "@types/leaflet": "^1.9.3", - "@types/lodash": "^4.14.191", "@types/node": "^18.11.13", "@types/qs": "^6.9.7", "@types/react": "^18.0.14", diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx index 6d2a6d1994..68796866db 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx @@ -5,8 +5,6 @@ import { EmptyCompanyOwnershipPage, TCompanyOwnershipData, } from '@/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage'; -import get from 'lodash/get'; -import map from 'lodash/map'; export class CompanyOwnershipPagePDF extends IPDFRenderer { static PDF_NAME = 'companyOwnershipPage'; @@ -22,10 +20,10 @@ export class CompanyOwnershipPagePDF extends IPDFRenderer async getData() { const pdfData: TCompanyOwnershipData = { - companyName: get(this.workflow.context, 'entity.data.companyName', ''), + companyName: this.workflow?.context?.entity?.data?.companyName || '', creationDate: new Date(), logoUrl: await this.getLogoUrl(), - items: map(get(this?.workflow, 'context.pluginsOutput.ubo.data.uboGraph', []), ubo => ({ + items: (this.workflow?.context?.pluginsOutput?.ubo?.data?.uboGraph || []).map((ubo: any) => ({ companyName: ubo?.name, companyType: ubo?.type, ownershipPercentage: ubo?.shareHolders?.[0]?.sharePercentage, diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx index 60ae468a31..a3b17729d0 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx @@ -5,8 +5,6 @@ import { EmptyCompanySanctionsPage, TCompanySanctionsData, } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage'; -import get from 'lodash/get'; -import map from 'lodash/map'; export class CompanySanctionsPagePDF extends IPDFRenderer { static PDF_NAME = 'companySanctionsPage'; @@ -22,18 +20,17 @@ export class CompanySanctionsPagePDF extends IPDFRenderer async getData() { const pdfData: TCompanySanctionsData = { - companyName: get(this.workflow.context, 'entity.data.companyName', ''), + companyName: this.workflow?.context?.entity?.data?.companyName || '', creationDate: new Date(), logoUrl: await this.getLogoUrl(), - sanctions: map( - get(this.workflow.context, 'pluginsOutput.companySanctions.data', []), - sanction => ({ - name: get(sanction, 'entity.name', ''), - reviewDate: get(sanction, 'entity.lastReviewed', ''), - labels: get(sanction, 'entity.categories', []), - sources: map(get(sanction, 'entity.sources', []), source => get(source, 'url', '')), - addresses: get(sanction, 'entity.places', []), - matchReasons: get(sanction, 'matchedFields', []), + sanctions: (this.workflow?.context?.pluginsOutput?.companySanctions?.data || []).map( + (sanction: any) => ({ + name: sanction.entity.name, + reviewDate: sanction.entity.lastReviewed, + labels: sanction.entity.categories, + sources: sanction.entity.sources.map((source: { url: string }) => source.url), + addresses: sanction.entity.places, + matchReasons: sanction.matchedFields, }), ), }; diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx index 510c111ea0..8300555caa 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx @@ -2,12 +2,8 @@ import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOpti import { EmptyIdentityVerificationsPage, IdentityVerificationsPage, - IdentityVerificationsSchema, TIdentityVerificationsData, } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage'; -import get from 'lodash/get'; -import map from 'lodash/map'; -import values from 'lodash/values'; export class IdentityVerificationsPagePDF extends IPDFRenderer { static PDF_NAME = 'identityVerificationsPage'; @@ -22,32 +18,27 @@ export class IdentityVerificationsPagePDF extends IPDFRenderer { - return map( - values(childWorkflowSession), - (session): TIdentityVerificationsData['items'][number] => ({ - firstName: get(session, 'result.childEntity.firstName', ''), - lastName: get(session, 'result.childEntity.lastName', ''), - dateOfBirth: get(session, 'result.entity.data.dateOfBirth'), - status: get(session, 'result.vendorResult.decision.status', '') as - | 'approved' - | 'rejected', - checkDate: get(session, 'result.vendorResult.aml.createdAt'), - id: get(session, 'result.vendorResult.metadata.id', ''), - gender: get(session, 'result.vendorResult.entity.data.additionalInfo.gender', ''), - nationality: get( - session, - 'result.vendorResult.entity.data.additionalInfo.nationality', - '', - ), - reason: get(session, 'result.vendorResult.decision.reason', ''), + return Object.values(childWorkflowSession || {}).map( + (session: any): TIdentityVerificationsData['items'][number] => ({ + firstName: session.result?.childEntity?.firstName || '', + lastName: session.result?.childEntity?.lastName || '', + dateOfBirth: session.result?.entity?.data?.dateOfBirth || null, + status: + session.result?.vendorResult?.decision?.status || ('' as 'approved' | 'rejected'), + checkDate: session.result?.vendorResult?.aml?.createdAt || null, + id: session.result?.vendorResult?.metadata?.id || '', + gender: session.result?.vendorResult?.entity?.data?.additionalInfo?.gender || '', + nationality: + session.result?.vendorResult?.entity?.data?.additionalInfo?.nationality || '', + reason: session.result.vendorResult.decision.reason || '', }), ); }) @@ -57,9 +48,7 @@ export class IdentityVerificationsPagePDF extends IPDFRenderer { static PDF_NAME = 'individualSanctionsPage'; @@ -25,20 +23,18 @@ export class IndividualSantcionsPagePDF extends IPDFRenderer { - const rawAml = get(session, 'result.vendorResult.aml', {}); + const rawAml = session.result?.vendorResult?.aml || {}; const amlData = amlAdapter(rawAml); return { checkDate: amlData.dateOfCheck ?? undefined, - fullName: `${get(session, 'result.childEntity.firstName', '')} ${get( - session, - 'result.childEntity.lastName', - '', - ).trim()}`, + fullName: `${session.result?.childEntity?.firstName || ''} ${ + session.result?.childEntity?.lastName || '' + }`, matchesCount: amlData.totalMatches, names: amlData.matches.map(match => match.aka).flat(0), warnings: amlData.matches @@ -97,10 +93,10 @@ export class IndividualSantcionsPagePDF extends IPDFRenderer { - return values(childWorkflowSession); + return Object.values(childWorkflowSession || {}); }) .flat(1); diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx index 39864a588e..544c5d8ebb 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx @@ -5,7 +5,6 @@ import { } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage'; import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema'; import { TitlePageSchema } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; -import get from 'lodash/get'; export class RegistryPagePDF extends IPDFRenderer { static PDF_NAME = 'titlePage'; @@ -21,31 +20,27 @@ export class RegistryPagePDF extends IPDFRenderer { async getData() { const pdfData: TRegistryInformationData = { - companyName: get(this.workflow.context, 'entity.data.companyName', ''), + companyName: this.workflow?.context?.entity?.data?.companyName || '', creationDate: new Date(), logoUrl: await this.getLogoUrl(), - registrationNumber: get(this.workflow.context, 'entity.data.registrationNumber', ''), - incorporationDate: get( - this.workflow.context, - 'entity.data.additionalInfo.dateOfEstablishment', - null, - ), - companyType: get(this.workflow.context, 'entity.data.businessType', ''), + registrationNumber: this.workflow.context?.entity?.data?.registrationNumber || '', + incorporationDate: + this.workflow.context?.entity?.data?.additionalInfo?.dateOfEstablishment || null, + companyType: this.workflow.context?.entity?.data?.businessType || '', // companyStatus is missing in context - companyStatus: get(this.workflow.context, 'entity.data.status', ''), - + companyStatus: this.workflow.context?.entity?.data?.status || '', registrationAddress: [ - get(this.workflow.context, 'entity.data.headquarters.street', ''), - get(this.workflow.context, 'entity.data.headquarters.streetNumber', ''), - get(this.workflow.context, 'entity.data.headquarters.city', ''), - get(this.workflow.context, 'entity.data.headquarters.country', ''), - get(this.workflow.context, 'entity.data.headquarters.postalCode', ''), + this.workflow.context?.entity?.data?.headquarters?.street || '', + this.workflow.context?.entity?.data?.headquarters?.streetNumber || '', + this.workflow.context?.entity?.data?.headquarters?.city || '', + this.workflow.context?.entity?.data?.headquarters?.country || '', + this.workflow.context?.entity?.data?.headquarters?.postalCode || '', ] .filter(Boolean) .join(', '), - registryPage: get(this.workflow.context, 'entity.data.registryPage', ''), + registryPage: this.workflow.context?.entity?.data?.registryPage || '', lastUpdate: new Date(), - registeredAt: get(this.workflow.context, 'entity.data.registeredAt', ''), + registeredAt: this.workflow.context?.entity?.data?.registeredAt || '', }; return pdfData; diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx index 3be66304b0..8d7f71c7f6 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx @@ -4,7 +4,6 @@ import { TitlePage, TitlePageSchema, } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; -import get from 'lodash/get'; export class TitlePagePDF extends IPDFRenderer { static PDF_NAME = 'titlePage'; @@ -18,7 +17,7 @@ export class TitlePagePDF extends IPDFRenderer { async getData() { const pdfData: TTitlePageData = { - companyName: get(this.workflow.context, 'entity.data.companyName', ''), + companyName: this.workflow.context?.entity?.data?.companyName || '', creationDate: new Date(), logoUrl: await this.getLogoUrl(), }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a9acdea40c..87f39e2734 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -189,9 +189,6 @@ importers: libphonenumber-js: specifier: ^1.10.49 version: 1.10.49 - lodash: - specifier: ^4.17.21 - version: 4.17.21 lucide-react: specifier: ^0.239.0 version: 0.239.0(react@18.2.0) @@ -310,9 +307,6 @@ importers: '@types/leaflet': specifier: ^1.9.3 version: 1.9.8 - '@types/lodash': - specifier: ^4.14.191 - version: 4.14.201 '@types/node': specifier: ^18.11.13 version: 18.17.19 @@ -21083,7 +21077,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.3) + '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.5) debug: 3.2.7 eslint: 8.54.0 eslint-import-resolver-node: 0.3.9 @@ -21248,7 +21242,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.3) + '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.5) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 From d47969a48cc800d8fb30f9173253c5380f6cb514 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 28 May 2024 15:32:32 +0300 Subject: [PATCH 27/37] fix: fixed schema --- .../src/domains/workflows/fetchers.ts | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/apps/backoffice-v2/src/domains/workflows/fetchers.ts b/apps/backoffice-v2/src/domains/workflows/fetchers.ts index 40b6949c23..cc6ac92103 100644 --- a/apps/backoffice-v2/src/domains/workflows/fetchers.ts +++ b/apps/backoffice-v2/src/domains/workflows/fetchers.ts @@ -106,7 +106,21 @@ export const BaseWorkflowByIdSchema = z.object({ }).nullable(), }); -export type TWorkflowById = z.output; +export const WorkflowByIdSchema = BaseWorkflowByIdSchema.extend({ + childWorkflows: z + .array( + BaseWorkflowByIdSchema.omit({ + context: true, + }).extend({ + context: BaseWorkflowByIdSchema.shape.context.omit({ + flowConfig: true, + }), + }), + ) + .optional(), +}); + +export type TWorkflowById = z.output; export const fetchWorkflowById = async ({ workflowId, @@ -118,7 +132,7 @@ export const fetchWorkflowById = async ({ const [workflow, error] = await apiClient({ endpoint: `workflows/${workflowId}?filterId=${filterId}`, method: Method.GET, - schema: BaseWorkflowByIdSchema.transform(data => ({ + schema: WorkflowByIdSchema.transform(data => ({ ...data, context: { ...data.context, @@ -236,7 +250,7 @@ export const updateWorkflowDecision = async ({ }`, method: Method.PATCH, body, - schema: BaseWorkflowByIdSchema.pick({ + schema: WorkflowByIdSchema.pick({ context: true, }), }); From b52a058c73f4ea312fa1de49ae3258339f700468 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 28 May 2024 15:35:41 +0300 Subject: [PATCH 28/37] fix: renamed method --- .../components/Case/components/CaseOptions/CaseOptions.tsx | 4 ++-- .../hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx index 26aaed2abb..d013cad3d0 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx @@ -6,7 +6,7 @@ import { DropdownMenuTrigger } from '@/common/components/molecules/DropdownMenu/ import { useCaseOptionsLogic } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic'; export const CaseOptions = () => { - const { isGeneratingPDF, genereateAndDownloadPDFCertificate } = useCaseOptionsLogic(); + const { isGeneratingPDF, generateAndOpenPDFInNewTab } = useCaseOptionsLogic(); return ( @@ -16,7 +16,7 @@ export const CaseOptions = () => { Download PDF Certificate diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index 773780adee..72d7985054 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -26,7 +26,7 @@ export const useCaseOptionsLogic = () => { const { data: workflow } = useCurrentCaseQuery(); const { data: customer } = useCustomerQuery(); - const genereateAndDownloadPDFCertificate = useCallback(async () => { + const generateAndOpenPDFInNewTab = useCallback(async () => { try { setIsGeneratingPDF(true); @@ -54,6 +54,6 @@ export const useCaseOptionsLogic = () => { return { isGeneratingPDF, - genereateAndDownloadPDFCertificate, + generateAndOpenPDFInNewTab, }; }; From 32954a416991d45a58798f47185e0adc9244c100 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 28 May 2024 15:37:13 +0300 Subject: [PATCH 29/37] fix: schema --- apps/backoffice-v2/src/domains/workflows/fetchers.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/backoffice-v2/src/domains/workflows/fetchers.ts b/apps/backoffice-v2/src/domains/workflows/fetchers.ts index cc6ac92103..420a22c396 100644 --- a/apps/backoffice-v2/src/domains/workflows/fetchers.ts +++ b/apps/backoffice-v2/src/domains/workflows/fetchers.ts @@ -92,7 +92,6 @@ export const BaseWorkflowByIdSchema = z.object({ .or(z.undefined()), }) .optional(), - childWorkflows: z.any().optional(), }), entity: ObjectWithIdSchema.extend({ name: z.string(), From 5960c4cb6f7c8e6fdd478def93f65734cafe43a6 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 28 May 2024 16:02:36 +0300 Subject: [PATCH 30/37] feat: updated toast json --- apps/backoffice-v2/public/locales/en/toast.json | 3 +++ .../hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/backoffice-v2/public/locales/en/toast.json b/apps/backoffice-v2/public/locales/en/toast.json index 72d4f727f4..8bae46eea4 100644 --- a/apps/backoffice-v2/public/locales/en/toast.json +++ b/apps/backoffice-v2/public/locales/en/toast.json @@ -77,5 +77,8 @@ "revert_decision_alerts": { "success": "The alerts decision have been reverted successfully.", "error": "Error occurred while reverting the alerts decision." + }, + "pdf_certificate": { + "error": "Failed to download PDF certificate." } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index 72d7985054..a72f00bffa 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -9,6 +9,7 @@ import { RegistryPagePDF } from '@/pages/Entity/components/Case/components/CaseO import { TitlePagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf'; import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery'; import { Document, pdf } from '@react-pdf/renderer'; +import { t } from 'i18next'; import { useCallback, useState } from 'react'; import { toast } from 'sonner'; @@ -46,7 +47,7 @@ export const useCaseOptionsLogic = () => { openFile(PDFBlob); } catch (error) { console.error(`Failed to download PDF certificate: ${error}`); - toast.error('Failed to download PDF certificate.'); + toast.error(t('toast:pdf_certificate.error')); } finally { setIsGeneratingPDF(false); } From 6bd197503a59d3ad1a6059dea670d058f97610d6 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 28 May 2024 16:04:56 +0300 Subject: [PATCH 31/37] fix: cleaned leftovers --- .../pages/TitlePage/TitlePage.tsx | 2 +- .../assets/title-page-ballerine-logo.png | Bin 4530 -> 0 bytes 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx index e03b22b9d8..c57378bfb1 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx @@ -2,7 +2,7 @@ import { TTitlePageData } from '@/pages/Entity/pdfs/case-information/pages/Title import { List, ListItem, Typography, tw } from '@ballerine/react-pdf-toolkit'; import { Image, Page, View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; -import poweredByLogo from './assets/title-page-ballerine-logo.png'; +import poweredByLogo from '../../assets/title-page-ballerine-logo.png'; export interface ITitlePageProps { data: TTitlePageData; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/assets/title-page-ballerine-logo.png deleted file mode 100644 index c6388031d755b4165c45bb13fb6b4371617fdc57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4530 zcmV;j5l!xiP)@~0drDELIAGL9O(c600d`2O+f$vv5yPKq0}KWrKnNj(5JCtcm*Oj|i@Rre{Vd;fKVNshyX&R-^;w$k z=f`LH`C0be{|O<4+!*0mcF*$ZSw3fqULQdSA><}_#5ALEO6pFpfDl5+izA@z=s(XW zsy~7dLdc6i*D`*?Wi%s=ZGnvDbyLI}A!G@7dPT1SpNfDl5+)vy-h zK_fy4AyEgb=a{JhOn3#-q;`J|hx92q9!qB9=EEiq1rSag^l=gb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~khTCrJfD2qCLsi|HMEUp`^_#wZ#OLI}A6 z0?K#xG#-QyawBZ9UgNgpiB!e|m5;FN;TZ QkN^Mx07*qoM6N<$g1?yArT_o{ From a55c2fb6e82019d517ff426b1916a7c2e8f4cb87 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 28 May 2024 16:12:36 +0300 Subject: [PATCH 32/37] fix: refactor --- .../hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx index 544c5d8ebb..a4b7f57111 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx @@ -63,9 +63,7 @@ export class RegistryPagePDF extends IPDFRenderer { ]; return values.every(value => { - if (Array.isArray(value) && !value.length) return true; - - return !value; + return (Array.isArray(value) && !value.length) || !value; }); } } From c053a45f08fd4d31c548a16013369890c9305df7 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Tue, 28 May 2024 16:28:29 +0300 Subject: [PATCH 33/37] migration --- services/workflows-service/prisma/data-migrations | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/workflows-service/prisma/data-migrations b/services/workflows-service/prisma/data-migrations index 7b426c2f25..df1a5c7a87 160000 --- a/services/workflows-service/prisma/data-migrations +++ b/services/workflows-service/prisma/data-migrations @@ -1 +1 @@ -Subproject commit 7b426c2f25717011d66dfd91dd0419d162997656 +Subproject commit df1a5c7a87c92f0625d3e7f92872fc313e21664c From 742e2812352b04a97cd0d18cfcddaba118b83ffa Mon Sep 17 00:00:00 2001 From: Omri Levy Date: Tue, 11 Jun 2024 13:48:05 +0300 Subject: [PATCH 34/37] refactor(*): resolved pr comments --- .../public/locales/en/toast.json | 2 +- .../src/common/utils/svg-to-png/svg-to-png.ts | 4 ++ .../utils/value-or-none}/value-or-none.ts | 0 .../components/CaseOptions/CaseOptions.tsx | 12 ++-- .../useGeneratePDFMutation.tsx | 53 ++++++++++++++++ .../renderers/company-ownership-page.pdf.tsx | 4 +- .../renderers/company-sanctions-page.pdf.tsx | 4 +- .../identity-verifications-page.pdf.tsx | 4 +- .../individual-sanctions-page.pdf.tsx | 4 +- .../renderers/pdf-renderer.abstract.ts | 11 +++- .../renderers/registry-page.pdf.tsx | 8 +-- .../renderers/title-page.pdf.tsx | 18 +++--- .../useCaseOptionsLogic.tsx | 60 ++++--------------- .../CompanyOwnershipPage.tsx | 14 ++--- .../EmptyCompanyOwnershipPage.tsx | 15 ++--- .../empty-company-ownership-page.schema.ts | 6 -- .../CompanySanctionsPage.tsx | 14 ++--- .../EmptyCompanySanctionsPage.tsx | 15 ++--- .../empty-company-sanctions.schema.ts | 6 -- .../EmptyIdentityVerificationsPage.tsx | 17 ++---- .../IdentityVerificationsPage.tsx | 14 ++--- .../components/IdentityItem/IdentityItem.tsx | 21 ++++--- .../empty-identity-verfications.schema.ts | 7 --- .../EmptyIndividualSanctionsPage.tsx | 16 ++--- .../IndividualSanctionsPage.tsx | 12 +--- .../IndividualSanctionsItem.tsx | 19 +++--- .../IndividualSanctionsItem/ValueOrNone.tsx | 4 +- .../empty-individual-sanctions.schema.ts | 5 -- .../EmptyRegistryInformationPage.tsx | 17 ++---- .../RegistryInformationPage.tsx | 14 +---- .../empty-registry-information-page.schema.ts | 6 -- .../registry-information.schema.ts | 4 +- .../pages/TitlePage/TitlePage.tsx | 16 +++-- .../case-information/pages/TitlePage/index.ts | 1 - .../pages/TitlePage/title-page.schema.ts | 6 -- .../base-case-information-pdf.schema.ts | 2 + .../workflows-service/prisma/data-migrations | 1 - 37 files changed, 188 insertions(+), 248 deletions(-) rename apps/backoffice-v2/src/{pages/Entity/pdfs/case-information/utils => common/utils/value-or-none}/value-or-none.ts (100%) create mode 100644 apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/mutations/useGeneratePDFMutation/useGeneratePDFMutation.tsx delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts delete mode 100644 apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts delete mode 160000 services/workflows-service/prisma/data-migrations diff --git a/apps/backoffice-v2/public/locales/en/toast.json b/apps/backoffice-v2/public/locales/en/toast.json index 8bae46eea4..a908e7bfa3 100644 --- a/apps/backoffice-v2/public/locales/en/toast.json +++ b/apps/backoffice-v2/public/locales/en/toast.json @@ -79,6 +79,6 @@ "error": "Error occurred while reverting the alerts decision." }, "pdf_certificate": { - "error": "Failed to download PDF certificate." + "error": "Failed to open PDF certificate." } } diff --git a/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts b/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts index 20ea8989ff..e29ee1f944 100644 --- a/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts +++ b/apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts @@ -1,7 +1,9 @@ export const svgToPng = (imageUrl: string): Promise => { return new Promise((resolve, reject) => { const img = new Image(); + img.crossOrigin = 'Anonymous'; + img.onload = () => { const canvas = document.createElement('canvas'); const context = canvas.getContext('2d'); @@ -14,9 +16,11 @@ export const svgToPng = (imageUrl: string): Promise => { resolve(dataUrl); }; + img.onerror = error => { reject(error); }; + img.src = imageUrl; }); }; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/utils/value-or-none.ts b/apps/backoffice-v2/src/common/utils/value-or-none/value-or-none.ts similarity index 100% rename from apps/backoffice-v2/src/pages/Entity/pdfs/case-information/utils/value-or-none.ts rename to apps/backoffice-v2/src/common/utils/value-or-none/value-or-none.ts diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx index d013cad3d0..df57a93046 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx @@ -6,7 +6,7 @@ import { DropdownMenuTrigger } from '@/common/components/molecules/DropdownMenu/ import { useCaseOptionsLogic } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic'; export const CaseOptions = () => { - const { isGeneratingPDF, generateAndOpenPDFInNewTab } = useCaseOptionsLogic(); + const { isGeneratingPDF, generateAndOpenPDFInNewTab, pdfUrl } = useCaseOptionsLogic(); return ( @@ -14,12 +14,10 @@ export const CaseOptions = () => { - - Download PDF Certificate + + diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/mutations/useGeneratePDFMutation/useGeneratePDFMutation.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/mutations/useGeneratePDFMutation/useGeneratePDFMutation.tsx new file mode 100644 index 0000000000..eabc7a726c --- /dev/null +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/mutations/useGeneratePDFMutation/useGeneratePDFMutation.tsx @@ -0,0 +1,53 @@ +import { TWorkflowById } from '@/domains/workflows/fetchers'; +import { TCustomer } from '@/domains/customer/fetchers'; +import { useMutation } from '@tanstack/react-query'; +import { TitlePagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf'; +import { RegistryPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf'; +import { CompanyOwnershipPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf'; +import { CompanySanctionsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf'; +import { IdentityVerificationsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf'; +import { IndividualSantcionsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf'; +import { Document, pdf } from '@react-pdf/renderer'; +import { toast } from 'sonner'; +import { t } from 'i18next'; + +const openBlobInNewTab = (blob: Blob) => { + const url = URL.createObjectURL(blob); + + window.open(url, '_blank'); + + setTimeout(() => { + URL.revokeObjectURL(url); + }, 10_000); +}; + +export const useGeneratePDFMutation = ({ + workflow, + customer, +}: { + workflow: TWorkflowById; + customer: TCustomer; +}) => { + return useMutation({ + mutationFn: async () => { + const pdfs = [ + TitlePagePDF, + RegistryPagePDF, + CompanyOwnershipPagePDF, + CompanySanctionsPagePDF, + IdentityVerificationsPagePDF, + IndividualSantcionsPagePDF, + ]; + const renderers = pdfs.map(PDF => new PDF(workflow, customer)); + const pages = await Promise.all(renderers.map(renderer => renderer.render())); + + const pdfBlob = await pdf({pages}).toBlob(); + + openBlobInNewTab(pdfBlob); + }, + onError: error => { + console.error(`Failed to open PDF certificate: ${JSON.stringify(error)}`); + toast.error(t('toast:pdf_certificate.error')); + }, + }); +}; diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx index 68796866db..38f0092867 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx @@ -13,9 +13,9 @@ export class CompanyOwnershipPagePDF extends IPDFRenderer const pdfData = await this.getData(); this.isValid(pdfData); - if (this.isEmpty(pdfData)) return ; + if (this.isEmpty(pdfData)) return ; - return ; + return ; } async getData() { diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx index a3b17729d0..1fbbdc34a9 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx @@ -13,9 +13,9 @@ export class CompanySanctionsPagePDF extends IPDFRenderer const pdfData = await this.getData(); this.isValid(pdfData); - if (this.isEmpty(pdfData)) return ; + if (this.isEmpty(pdfData)) return ; - return ; + return ; } async getData() { diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx index 8300555caa..442ae9f91e 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx @@ -12,9 +12,9 @@ export class IdentityVerificationsPagePDF extends IPDFRenderer; + if (this.isEmpty(pdfData)) return ; - return ; + return ; } async getData() { diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx index 7c51200abd..8a67b4e95a 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx @@ -16,9 +16,9 @@ export class IndividualSantcionsPagePDF extends IPDFRenderer; + if (this.isEmpty(pdfData)) return ; - return ; + return ; } async getData() { diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts index 087928fb01..4d7d654da8 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts @@ -1,6 +1,7 @@ import { svgToPng } from '@/common/utils/svg-to-png/svg-to-png'; import { TCustomer } from '@/domains/customer/fetchers'; import { TWorkflowById } from '@/domains/workflows/fetchers'; +import poweredByLogo from '../../../../../../../pdfs/case-information/assets/title-page-ballerine-logo.png'; export abstract class IPDFRenderer { static PDF_NAME: string; @@ -13,7 +14,13 @@ export abstract class IPDFRenderer { abstract isValid(data: TPDFData): void; - getLogoUrl(): Promise { - return svgToPng(this.customer?.logoImageUri || ''); + async getLogoUrl() { + try { + return await svgToPng(this.customer?.logoImageUri || ''); + } catch (error) { + console.error(`Failed to convert logo to PNG: ${JSON.stringify(error)}`); + + return poweredByLogo; + } } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx index a4b7f57111..5872b5cfb2 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx @@ -4,7 +4,7 @@ import { RegistryInformationPage, } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage'; import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema'; -import { TitlePageSchema } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; +import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; export class RegistryPagePDF extends IPDFRenderer { static PDF_NAME = 'titlePage'; @@ -13,9 +13,9 @@ export class RegistryPagePDF extends IPDFRenderer { const pdfData = await this.getData(); this.isValid(pdfData); - if (this.isEmpty(pdfData)) return ; + if (this.isEmpty(pdfData)) return ; - return ; + return ; } async getData() { @@ -47,7 +47,7 @@ export class RegistryPagePDF extends IPDFRenderer { } isValid(data: TRegistryInformationData) { - TitlePageSchema.parse(data); + BaseCaseInformationPdfSchema.parse(data); } private isEmpty(data: TRegistryInformationData) { diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx index 8d7f71c7f6..661f653893 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx @@ -1,22 +1,22 @@ import { IPDFRenderer } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract'; +import { TitlePage } from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; import { - TTitlePageData, - TitlePage, - TitlePageSchema, -} from '@/pages/Entity/pdfs/case-information/pages/TitlePage'; + BaseCaseInformationPdfSchema, + TBaseCaseInformationPdf, +} from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -export class TitlePagePDF extends IPDFRenderer { +export class TitlePagePDF extends IPDFRenderer { static PDF_NAME = 'titlePage'; async render(): Promise { const pdfData = await this.getData(); this.isValid(pdfData); - return ; + return ; } async getData() { - const pdfData: TTitlePageData = { + const pdfData: TBaseCaseInformationPdf = { companyName: this.workflow.context?.entity?.data?.companyName || '', creationDate: new Date(), logoUrl: await this.getLogoUrl(), @@ -25,7 +25,7 @@ export class TitlePagePDF extends IPDFRenderer { return pdfData; } - isValid(data: TTitlePageData) { - TitlePageSchema.parse(data); + isValid(data: TBaseCaseInformationPdf) { + BaseCaseInformationPdfSchema.parse(data); } } diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index a72f00bffa..7f2b864fc3 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -1,60 +1,22 @@ -import { TCustomer } from '@/domains/customer/fetchers'; import { useCustomerQuery } from '@/domains/customer/hook/queries/useCustomerQuery/userCustomerQuery'; -import { TWorkflowById } from '@/domains/workflows/fetchers'; -import { CompanyOwnershipPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf'; -import { CompanySanctionsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf'; -import { IdentityVerificationsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf'; -import { IndividualSantcionsPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf'; -import { RegistryPagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf'; -import { TitlePagePDF } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf'; import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery'; -import { Document, pdf } from '@react-pdf/renderer'; -import { t } from 'i18next'; -import { useCallback, useState } from 'react'; -import { toast } from 'sonner'; - -const openFile = (blob: Blob) => { - const url = URL.createObjectURL(blob); - window.open(url, '_blank'); - - setTimeout(() => { - URL.revokeObjectURL(url); - }, 10_000); -}; +import { useGeneratePDFMutation } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/mutations/useGeneratePDFMutation/useGeneratePDFMutation'; export const useCaseOptionsLogic = () => { - const [isGeneratingPDF, setIsGeneratingPDF] = useState(false); const { data: workflow } = useCurrentCaseQuery(); const { data: customer } = useCustomerQuery(); - - const generateAndOpenPDFInNewTab = useCallback(async () => { - try { - setIsGeneratingPDF(true); - - const pdfs = [ - TitlePagePDF, - RegistryPagePDF, - CompanyOwnershipPagePDF, - CompanySanctionsPagePDF, - IdentityVerificationsPagePDF, - IndividualSantcionsPagePDF, - ]; - const renderers = pdfs.map(PDF => new PDF(workflow as TWorkflowById, customer as TCustomer)); - const pages = await Promise.all(renderers.map(renderer => renderer.render())); - - const PDFBlob = await pdf({pages}).toBlob(); - - openFile(PDFBlob); - } catch (error) { - console.error(`Failed to download PDF certificate: ${error}`); - toast.error(t('toast:pdf_certificate.error')); - } finally { - setIsGeneratingPDF(false); - } - }, [workflow, customer]); + const { + isLoading, + mutate: generateAndOpenPDFInNewTab, + data: pdfUrl, + } = useGeneratePDFMutation({ + workflow, + customer, + }); return { - isGeneratingPDF, + isGeneratingPDF: isLoading, generateAndOpenPDFInNewTab, + pdfUrl, }; }; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx index aae1a3cb1f..dee7e291e1 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx @@ -5,17 +5,15 @@ import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; import { TCompanyOwnershipData } from '@/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema'; import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; -export interface ICompanyOwnershipPageProps { - data: TCompanyOwnershipData; -} - -export const CompanyOwnershipPage: FunctionComponent = ({ data }) => { - const { items, companyName, logoUrl } = data; - +export const CompanyOwnershipPage: FunctionComponent = ({ + items, + companyName, + logoUrl, +}) => { return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx index 9e702cd587..5e8f0d4023 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx @@ -3,21 +3,16 @@ import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-informati import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; -import { TEmptyRegistryInformationPageData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; +import { TBaseCaseInformationPdf } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -interface IEmptyRegistryInformationPageProps { - data: TEmptyRegistryInformationPageData; -} - -export const EmptyCompanyOwnershipPage: FunctionComponent = ({ - data, +export const EmptyCompanyOwnershipPage: FunctionComponent = ({ + logoUrl, + companyName, }) => { - const { logoUrl, companyName } = data; - return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts deleted file mode 100644 index d49fb1e375..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -import { z } from 'zod'; - -export const EmptyCompanyOwnershipPageSchema = BaseCaseInformationPdfSchema; - -export type TEmptyCompanyOwnershipPageeData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx index 86102eaf68..89e81e451e 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx @@ -6,18 +6,16 @@ import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; import { TCompanySanctionsData } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/company-sanctions.schema'; import { CompanySanctionsMatchSection } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/components/CompanySanctionsMatchSection/CompanySanctionsMatchSection'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; -interface ICompanySanctionsPageProps { - data: TCompanySanctionsData; -} - -export const CompanySanctionsPage: FunctionComponent = ({ data }) => { - const { sanctions, companyName, logoUrl } = data; - +export const CompanySanctionsPage: FunctionComponent = ({ + sanctions, + companyName, + logoUrl, +}) => { return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx index 64fab65fa7..24b6412249 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx @@ -3,21 +3,16 @@ import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-informati import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; -import { TEmptyCompanySanctionsPageData } from '@/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; +import { TBaseCaseInformationPdf } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -interface IEmptyCompanySanctionsPageProps { - data: TEmptyCompanySanctionsPageData; -} - -export const EmptyCompanySanctionsPage: FunctionComponent = ({ - data, +export const EmptyCompanySanctionsPage: FunctionComponent = ({ + companyName, + logoUrl, }) => { - const { companyName, logoUrl } = data; - return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts deleted file mode 100644 index d2fefba6ad..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -import { z } from 'zod'; - -export const EmptyCompanySanctionsPageSchema = BaseCaseInformationPdfSchema; - -export type TEmptyCompanySanctionsPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx index 0035665f5c..89c4323d2b 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx @@ -3,20 +3,15 @@ import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-informati import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; -import { TEmptyIdentityVerificationsPageData } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; +import { TBaseCaseInformationPdf } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -interface IEmptyIdentityVerificationPageProps { - data: TEmptyIdentityVerificationsPageData; -} - -export const EmptyIdentityVerificationsPage: FunctionComponent< - IEmptyIdentityVerificationPageProps -> = ({ data }) => { - const { logoUrl, companyName } = data; - +export const EmptyIdentityVerificationsPage: FunctionComponent = ({ + logoUrl, + companyName, +}) => { return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx index 14e2271b7a..45852f7e32 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx @@ -9,15 +9,11 @@ import { tw } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; -interface IIDentityVerificationPageProps { - data: TIdentityVerificationsData; -} - -export const IdentityVerificationsPage: FunctionComponent = ({ - data, +export const IdentityVerificationsPage: FunctionComponent = ({ + logoUrl, + companyName, + items, }) => { - const { logoUrl, companyName, items } = data; - return ( @@ -30,7 +26,7 @@ export const IdentityVerificationsPage: FunctionComponent {items.map((item, index) => ( - + ))} {/* Individual Identity verifications section --- end */} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx index 4303195852..8b908d2a6b 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx @@ -1,17 +1,20 @@ import { TIdentityVerificationsItemData } from '@/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/identity-verifications.schema'; import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; -interface IIdentityItemProps { - item: TIdentityVerificationsItemData; -} - -export const IdentityItem: FunctionComponent = ({ item }) => { - const { checkDate, reason, status, firstName, lastName, dateOfBirth, id, gender, nationality } = - item; - +export const IdentityItem: FunctionComponent = ({ + checkDate, + reason, + status, + firstName, + lastName, + dateOfBirth, + id, + gender, + nationality, +}) => { return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts deleted file mode 100644 index 2a2d838bbd..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -import { z } from 'zod'; - -export const EmptyIdentityVerificationsPageSchema = BaseCaseInformationPdfSchema; -export type TEmptyIdentityVerificationsPageData = z.infer< - typeof EmptyIdentityVerificationsPageSchema ->; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx index 9f8efb873d..1080b36100 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx @@ -3,21 +3,15 @@ import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-informati import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; -import { TEmptyIndividualSanctionsPageData } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; import poweredByLogo from '../../assets/title-page-ballerine-logo.png'; +import { TBaseCaseInformationPdf } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -interface IEmptyIndividualSanctionsPageProps { - data: TEmptyIndividualSanctionsPageData; -} - -export const EmptyIndividualSanctionsPage: FunctionComponent< - IEmptyIndividualSanctionsPageProps -> = ({ data }) => { - const { companyName } = data; - +export const EmptyIndividualSanctionsPage: FunctionComponent = ({ + companyName, +}) => { return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx index fd2add7590..cc85be9911 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx @@ -10,15 +10,7 @@ import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; import poweredByLogo from '../../assets/title-page-ballerine-logo.png'; -interface IIndividualSanctionsPageProps { - data: TIndividualSanctionsData; -} - -export const IndividualSanctionsPage: FunctionComponent = ({ - data, -}) => { - const { items } = data; - +export const IndividualSanctionsPage: FunctionComponent = ({ items }) => { return ( @@ -34,7 +26,7 @@ export const IndividualSanctionsPage: FunctionComponent {items.map((item, index) => ( - + ))} {/* Company Sanctions section --- end */} diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx index 15b0644738..e75542553e 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx @@ -1,18 +1,19 @@ import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; import { TIndividualSanctionsItemData } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/individual-sanctions.schema'; -import { Link, Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { Link, tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; -interface IIndividualSanctionsItemProps { - item: TIndividualSanctionsItemData; -} - -export const IndividualSanctionsItem: FunctionComponent = ({ - item, +export const IndividualSanctionsItem: FunctionComponent = ({ + checkDate, + matchesCount, + names, + warnings, + sanctions, + PEP, + adverseMedia, + fullName, }) => { - const { checkDate, matchesCount, names, warnings, sanctions, PEP, adverseMedia, fullName } = item; - return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx index 50e05f1ac5..201032ecf2 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx @@ -1,6 +1,6 @@ import { valueOrFallback } from '@/common/utils/value-or-fallback/value-or-fallback'; -import { valueOrNone } from '@/pages/Entity/pdfs/case-information/utils/value-or-none'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { valueOrNone } from '@/common/utils/value-or-none/value-or-none'; +import { tw, Typography } from '@ballerine/react-pdf-toolkit'; import { AnyChildren } from '@ballerine/ui'; import { FunctionComponent } from 'react'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts deleted file mode 100644 index fe83980909..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -import { z } from 'zod'; - -export const EmptyIndividualSanctionsPageSchema = BaseCaseInformationPdfSchema; -export type TEmptyIndividualSanctionsPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx index 1c33e649d3..dfcc3dde66 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx @@ -3,21 +3,16 @@ import { CaseInformationPageContainer } from '@/pages/Entity/pdfs/case-informati import { CaseInformationPageHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader'; import { CaseInformationPageSection } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection'; import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-information/components/CaseInformationPageSectionHeader/CaseInformationPageSectionHeader'; -import { TEmptyRegistryInformationPageData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema'; -import { Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; +import { TBaseCaseInformationPdf } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -interface IEmptyRegistryInformationPageProps { - data: TEmptyRegistryInformationPageData; -} - -export const EmptyRegistryInformationPage: FunctionComponent< - IEmptyRegistryInformationPageProps -> = ({ data }) => { - const { logoUrl, companyName } = data; - +export const EmptyRegistryInformationPage: FunctionComponent = ({ + logoUrl, + companyName, +}) => { return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx index 94efbf624a..e21ff70443 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx @@ -6,26 +6,18 @@ import { CaseInformationPageSectionHeader } from '@/pages/Entity/pdfs/case-infor import { ValueOrNone } from '@/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone'; import { TRegistryInformationData } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema'; import { registryItemsAdapter } from '@/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items'; -import { Link, Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { Link, tw, Typography } from '@ballerine/react-pdf-toolkit'; import { View } from '@react-pdf/renderer'; import dayjs from 'dayjs'; import { FunctionComponent } from 'react'; -export interface IRegistryInformationPageProps { - data: TRegistryInformationData; -} - -export const RegistryInformationPage: FunctionComponent = ({ - data, -}) => { - const { companyName, logoUrl } = data; - +export const RegistryInformationPage: FunctionComponent = data => { const registryItems = registryItemsAdapter(data); return ( - + diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts deleted file mode 100644 index bc4146e163..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -import { z } from 'zod'; - -export const EmptyRegistryInformationPageSchema = BaseCaseInformationPdfSchema; - -export type TEmptyRegistryInformationPageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts index bbaa706459..133d27eaeb 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts @@ -1,7 +1,7 @@ import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; import { z } from 'zod'; -export const ReigstryInformationSchema = BaseCaseInformationPdfSchema.extend({ +export const RegistryInformationSchema = BaseCaseInformationPdfSchema.extend({ companyName: z.string(), registrationNumber: z.string(), incorporationDate: z.string(), @@ -13,4 +13,4 @@ export const ReigstryInformationSchema = BaseCaseInformationPdfSchema.extend({ registryPage: z.string(), }); -export type TRegistryInformationData = z.infer; +export type TRegistryInformationData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx index c57378bfb1..97c3dc14c2 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx @@ -1,16 +1,14 @@ -import { TTitlePageData } from '@/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema'; -import { List, ListItem, Typography, tw } from '@ballerine/react-pdf-toolkit'; +import { List, ListItem, tw, Typography } from '@ballerine/react-pdf-toolkit'; import { Image, Page, View } from '@react-pdf/renderer'; import { FunctionComponent } from 'react'; import poweredByLogo from '../../assets/title-page-ballerine-logo.png'; +import { TBaseCaseInformationPdf } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -export interface ITitlePageProps { - data: TTitlePageData; -} - -export const TitlePage: FunctionComponent = ({ data }) => { - const { companyName, creationDate, logoUrl } = data; - +export const TitlePage: FunctionComponent = ({ + companyName, + creationDate, + logoUrl, +}) => { return ( diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts index b44736ab63..4a5067236c 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts @@ -1,2 +1 @@ export * from './TitlePage'; -export * from './title-page.schema'; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts deleted file mode 100644 index 9de2280782..0000000000 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { BaseCaseInformationPdfSchema } from '@/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema'; -import { z } from 'zod'; - -export const TitlePageSchema = BaseCaseInformationPdfSchema; - -export type TTitlePageData = z.infer; diff --git a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts index a703c919ab..4b18df3138 100644 --- a/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts +++ b/apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts @@ -5,3 +5,5 @@ export const BaseCaseInformationPdfSchema = z.object({ creationDate: z.date(), logoUrl: z.string(), }); + +export type TBaseCaseInformationPdf = z.infer; diff --git a/services/workflows-service/prisma/data-migrations b/services/workflows-service/prisma/data-migrations deleted file mode 160000 index df1a5c7a87..0000000000 --- a/services/workflows-service/prisma/data-migrations +++ /dev/null @@ -1 +0,0 @@ -Subproject commit df1a5c7a87c92f0625d3e7f92872fc313e21664c From c4f941cf3739121521cb3da7b5e116e09e568b36 Mon Sep 17 00:00:00 2001 From: Omri Levy Date: Tue, 11 Jun 2024 14:00:12 +0300 Subject: [PATCH 35/37] fix(backoffice-v2): removed pdfUrl --- .../Case/components/CaseOptions/CaseOptions.tsx | 8 ++++++-- .../hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx | 7 +------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx index df57a93046..c98f2b4057 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx @@ -6,7 +6,7 @@ import { DropdownMenuTrigger } from '@/common/components/molecules/DropdownMenu/ import { useCaseOptionsLogic } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic'; export const CaseOptions = () => { - const { isGeneratingPDF, generateAndOpenPDFInNewTab, pdfUrl } = useCaseOptionsLogic(); + const { isGeneratingPDF, generateAndOpenPDFInNewTab } = useCaseOptionsLogic(); return ( @@ -15,7 +15,11 @@ export const CaseOptions = () => { - diff --git a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx index 7f2b864fc3..af0248c935 100644 --- a/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx +++ b/apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx @@ -5,11 +5,7 @@ import { useGeneratePDFMutation } from '@/pages/Entity/components/Case/component export const useCaseOptionsLogic = () => { const { data: workflow } = useCurrentCaseQuery(); const { data: customer } = useCustomerQuery(); - const { - isLoading, - mutate: generateAndOpenPDFInNewTab, - data: pdfUrl, - } = useGeneratePDFMutation({ + const { isLoading, mutate: generateAndOpenPDFInNewTab } = useGeneratePDFMutation({ workflow, customer, }); @@ -17,6 +13,5 @@ export const useCaseOptionsLogic = () => { return { isGeneratingPDF: isLoading, generateAndOpenPDFInNewTab, - pdfUrl, }; }; From 39d210e20e0c48379ecc380779e1e91550a959d0 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Wed, 19 Jun 2024 14:20:19 +0300 Subject: [PATCH 36/37] fix: fixed ballerine logo url --- services/workflows-service/scripts/seed.ts | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/services/workflows-service/scripts/seed.ts b/services/workflows-service/scripts/seed.ts index e8ccd368e0..67abd5e9d0 100644 --- a/services/workflows-service/scripts/seed.ts +++ b/services/workflows-service/scripts/seed.ts @@ -1,8 +1,20 @@ -import { hashKey } from '../src/customer/api-key/utils'; +import { CommonWorkflowStates, defaultContextSchema } from '@ballerine/common'; import { faker } from '@faker-js/faker'; import { Business, Customer, EndUser, Prisma, PrismaClient, Project } from '@prisma/client'; +import { Type } from '@sinclair/typebox'; import { hash } from 'bcrypt'; +import { hashKey } from '../src/customer/api-key/utils'; +import { env } from '../src/env'; +import type { InputJsonValue } from '../src/types'; +import { seedTransactionsAlerts } from './alerts/generate-alerts'; +import { generateTransactions } from './alerts/generate-transactions'; import { customSeed } from './custom-seed'; +import { + baseFilterAssigneeSelect, + baseFilterBusinessSelect, + baseFilterDefinitionSelect, + baseFilterEndUserSelect, +} from './filters'; import { businessIds, businessRiskIds, @@ -10,31 +22,19 @@ import { generateBusiness, generateEndUser, } from './generate-end-user'; -import { CommonWorkflowStates, defaultContextSchema } from '@ballerine/common'; import { generateUserNationalId } from './generate-user-national-id'; -import { generateDynamicDefinitionForE2eTest } from './workflows/e2e-dynamic-url-example'; -import { generateKycForE2eTest } from './workflows/kyc-dynamic-process-example'; import { generateKybDefintion } from './workflows'; -import { generateKycSessionDefinition } from './workflows/kyc-email-process-example'; -import { env } from '../src/env'; -import { generateKybKycWorkflowDefinition } from './workflows/kyb-kyc-workflow-definition'; -import { generateBaseTaskLevelStates } from './workflows/generate-base-task-level-states'; +import { generateDynamicDefinitionForE2eTest } from './workflows/e2e-dynamic-url-example'; import { generateBaseCaseLevelStatesAutoTransitionOnRevision } from './workflows/generate-base-case-level-states'; -import type { InputJsonValue } from '../src/types'; -import { generateWebsiteMonitoringExample } from './workflows/website-monitoring-workflow'; +import { generateBaseTaskLevelStates } from './workflows/generate-base-task-level-states'; import { generateCollectionKybWorkflow } from './workflows/generate-collection-kyb-workflow'; +import { generateKybKycWorkflowDefinition } from './workflows/kyb-kyc-workflow-definition'; +import { generateKycForE2eTest } from './workflows/kyc-dynamic-process-example'; +import { generateKycSessionDefinition } from './workflows/kyc-email-process-example'; +import { generateKycManualReviewRuntimeAndToken } from './workflows/runtime/geneate-kyc-manual-review-runtime-and-token'; import { generateInitialCollectionFlowExample } from './workflows/runtime/generate-initial-collection-flow-example'; import { uiKybParentWithAssociatedCompanies } from './workflows/ui-definition/kyb-with-associated-companies/ui-kyb-parent-dynamic-example'; -import { - baseFilterAssigneeSelect, - baseFilterBusinessSelect, - baseFilterDefinitionSelect, - baseFilterEndUserSelect, -} from './filters'; -import { generateTransactions } from './alerts/generate-transactions'; -import { generateKycManualReviewRuntimeAndToken } from './workflows/runtime/geneate-kyc-manual-review-runtime-and-token'; -import { Type } from '@sinclair/typebox'; -import { seedTransactionsAlerts } from './alerts/generate-alerts'; +import { generateWebsiteMonitoringExample } from './workflows/website-monitoring-workflow'; const BCRYPT_SALT: string | number = 10; @@ -126,7 +126,7 @@ async function seed() { client, '1', env.API_KEY, - 'https://blrn-cdn-prod.s3.eu-central-1.amazonaws.com/images/ballerine_logo.svg', + 'https://cdn.ballerine.io/images/ballerine_logo.svg', '', `webhook-shared-secret-${env.API_KEY}`, )) as Customer; @@ -135,7 +135,7 @@ async function seed() { client, '2', `${env.API_KEY}2`, - 'https://blrn-cdn-prod.s3.eu-central-1.amazonaws.com/images/ballerine_logo.svg', + 'https://cdn.ballerine.io/images/ballerine§_logo.svg', '', `webhook-shared-secret-${env.API_KEY}2`, )) as Customer; From 7a1563d6334cdfa1363a1ca6d83d17e81de7ea4f Mon Sep 17 00:00:00 2001 From: Omri Levy Date: Sun, 23 Jun 2024 18:58:22 +0300 Subject: [PATCH 37/37] fix(seed.ts): fixed bad symbol in cdn link --- services/workflows-service/prisma/data-migrations | 2 +- services/workflows-service/scripts/seed.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/workflows-service/prisma/data-migrations b/services/workflows-service/prisma/data-migrations index df1a5c7a87..6275d154b5 160000 --- a/services/workflows-service/prisma/data-migrations +++ b/services/workflows-service/prisma/data-migrations @@ -1 +1 @@ -Subproject commit df1a5c7a87c92f0625d3e7f92872fc313e21664c +Subproject commit 6275d154b55acf6c981aef59449c9d9788ff47f7 diff --git a/services/workflows-service/scripts/seed.ts b/services/workflows-service/scripts/seed.ts index 67abd5e9d0..f7ff956205 100644 --- a/services/workflows-service/scripts/seed.ts +++ b/services/workflows-service/scripts/seed.ts @@ -135,7 +135,7 @@ async function seed() { client, '2', `${env.API_KEY}2`, - 'https://cdn.ballerine.io/images/ballerine§_logo.svg', + 'https://cdn.ballerine.io/images/ballerine_logo.svg', '', `webhook-shared-secret-${env.API_KEY}2`, )) as Customer;