-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bal 1641 #2331
base: dev
Are you sure you want to change the base?
Bal 1641 #2331
Conversation
|
WalkthroughThe recent updates to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
PR Description updated to latest commit (da3d438) |
1 similar comment
PR Description updated to latest commit (da3d438) |
PR Review(Review updated until commit 8f21348)
Code feedback:
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
Persistent review updated to latest commit 8f21348 |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 10
Out of diff range and nitpick comments (6)
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts (1)
4-4
: Consider adding a comment explaining the purpose of extendingBaseCaseInformationPdfSchema
with an empty object, especially if future properties are expected to be added.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts (1)
4-4
: Consider adding a comment explaining the purpose of extendingBaseCaseInformationPdfSchema
with an empty object, especially if future properties are expected to be added.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts (1)
4-4
: Consider adding a comment explaining the purpose of extendingBaseCaseInformationPdfSchema
with an empty object, especially if future properties are expected to be added.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts (1)
4-4
: Consider adding a comment explaining the purpose of extendingBaseCaseInformationPdfSchema
with an empty object, especially if future properties are expected to be added.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx (1)
27-27
: Ensure type safety by explicitly handling the type conversion ofvalueOrNone(value)
.Consider using TypeScript's type assertion or a type guard to ensure the type of
valueOrNone(value)
matchesAnyChildren
.apps/backoffice-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.tsx (1)
5-5
: Consider adding JSDoc comments to theuseUbosRegistryProvidedBlock
hook to improve code documentation and developer understanding.Add JSDoc comments explaining the parameters and the return type of the
useUbosRegistryProvidedBlock
hook.
...information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx
Show resolved
Hide resolved
...information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx
Show resolved
Hide resolved
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx
Outdated
Show resolved
Hide resolved
...se/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx
Outdated
Show resolved
Hide resolved
...se/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx
Outdated
Show resolved
Hide resolved
...s/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx
Outdated
Show resolved
Hide resolved
...mponents/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx
Outdated
Show resolved
Hide resolved
...office-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
Outside diff range and nitpick comments (1)
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1)
33-64
: Consider using React Query for state management in asynchronous operations.Given the complexity of state management in asynchronous operations, consider using React Query. It provides built-in mechanisms for loading states, caching, and error handling, which could simplify the implementation of
useCaseOptionsLogic
.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- apps/backoffice-v2/src/main.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx (1 hunks)
Additional comments not posted (2)
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx (1)
5-9
: The implementation ofCaseInformationPageContainer
looks clean and well-integrated with the PDF toolkit.apps/backoffice-v2/src/main.tsx (1)
10-11
: The integration ofregisterFont
for PDF rendering looks correct. Ensure that the font registration is tested across different environments.Also applies to: 17-17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/assets/title-page-ballerine-logo.png
is excluded by!**/*.png
Files selected for processing (21)
- apps/backoffice-v2/src/main.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts (1 hunks)
Files skipped from review due to trivial changes (6)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts
Additional comments not posted (11)
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx (1)
5-6
: LGTM! The component is well-structured and follows best practices for React components.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx (1)
5-8
: LGTM! The component is well-structured and follows best practices for React components.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts (1)
16-16
: The type export is correctly implemented and follows TypeScript best practices.apps/backoffice-v2/src/main.tsx (1)
17-17
: The font registration for PDF rendering is correctly implemented.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1)
11-45
: The implementation of the PDF rendering class is robust and follows best practices for asynchronous data handling and rendering in React.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1)
11-50
: The implementation of the PDF rendering class is robust and follows best practices for asynchronous data handling and rendering in React.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts (1)
4-71
: The implementation ofregistryItemsAdapter
effectively handles potential undefined values and maps the data correctly.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx (1)
16-43
: TheEmptyIndividualSanctionsPage
component is well-structured and follows React best practices for component composition and styling.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx (1)
12-67
: TheIdentityVerificationsPagePDF
class is well-implemented with proper data handling and transformation logic.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1)
24-59
: TheuseCaseOptionsLogic
hook is correctly implemented with proper use of React hooks and handles asynchronous operations effectively.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1)
10-76
: TheRegistryPagePDF
class is well-implemented with robust data handling and conditional rendering logic.
.../pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx
Outdated
Show resolved
Hide resolved
...pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx
Outdated
Show resolved
Hide resolved
...components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx
Outdated
Show resolved
Hide resolved
...es/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts
Outdated
Show resolved
Hide resolved
...pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!pnpm-lock.yaml
Files selected for processing (12)
- apps/backoffice-v2/package.json (2 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- apps/backoffice-v2/package.json
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx
Additional comments not posted (9)
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx (3)
11-15
: Therender
method implementation is clean and follows good async practices.
18-25
: ThegetData
method is well-implemented, handling potential null values effectively.
28-30
: Good use of schema validation to ensure data integrity inisValid
.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx (1)
16-46
: The implementation ofEmptyCompanyOwnershipPage
is clear and uses consistent styling and structure.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx (1)
16-46
: TheEmptyRegistryInformationPage
component is well-structured and follows the established pattern of other similar components.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx (1)
18-76
: TheCompanySanctionsPage
component is implemented effectively, with clear separation of concerns and dynamic data handling.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx (3)
15-21
: Therender
method inIndividualSanctionsPagePDF
is well-structured, handling different rendering scenarios based on the data state.
106-108
: Proper use of schema validation inisValid
ensures the integrity of the data being rendered.
110-112
: TheisEmpty
method is effectively implemented to determine the rendering path based on the presence of data.
...onents/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx (1)
Line range hint
44-54
: The integration ofCaseOptions
within theActions
component is well done. However, consider simplifying the use of template literals where dynamic expressions are not used.- <div className={`mb-8 flex flex-row justify-between space-x-3.5`}> + <div className="mb-8 flex flex-row justify-between space-x-3.5">
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!pnpm-lock.yaml
Files selected for processing (4)
- apps/backoffice-v2/package.json (2 hunks)
- apps/backoffice-v2/src/domains/workflows/fetchers.ts (5 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx (3 hunks)
- services/workflows-service/prisma/data-migrations (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- apps/backoffice-v2/package.json
- services/workflows-service/prisma/data-migrations
Additional Context Used
Biome (11)
apps/backoffice-v2/src/domains/workflows/fetchers.ts (1)
12-13: All these imports are only used as types.
apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx (10)
43-43: Do not use template literals if interpolation and special-character handling are not needed.
44-44: Do not use template literals if interpolation and special-character handling are not needed.
56-56: Do not use template literals if interpolation and special-character handling are not needed.
57-57: Do not use template literals if interpolation and special-character handling are not needed.
59-59: Do not use template literals if interpolation and special-character handling are not needed.
67-67: Do not use template literals if interpolation and special-character handling are not needed.
68-68: Do not use template literals if interpolation and special-character handling are not needed.
71-71: Do not use template literals if interpolation and special-character handling are not needed.
2-3: All these imports are only used as types.
10-11: All these imports are only used as types.
Additional comments not posted (3)
apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx (1)
6-6
: The import ofCaseOptions
is correctly placed and follows the project's aliasing conventions.apps/backoffice-v2/src/domains/workflows/fetchers.ts (2)
95-95
: The addition ofchildWorkflows
toBaseWorkflowByIdSchema
is noted. Ensure that the schema forchildWorkflows
aligns with existing schemas if applicable, as suggested by a previous comment.Verification successful
The search results indicate multiple references to
childWorkflows
across various files, but none of them define a specific schema forchildWorkflows
. Instead, they seem to use it in different contexts, often as part of other objects or arrays.Given this, it appears that there is no existing schema specifically for
childWorkflows
that could be used in place ofz.any().optional()
. Therefore, the current implementation usingz.any().optional()
is consistent with the rest of the codebase.
- : The addition of
childWorkflows: z.any().optional()
to theBaseWorkflowByIdSchema
is consistent with the current usage and definitions in the codebase. No specific schema forchildWorkflows
exists that should be used instead.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if `childWorkflows` uses an existing schema. ast-grep --lang typescript --pattern $'z.object({ $$$ childWorkflows: $_, $$$ })'Length of output: 2824
Script:
#!/bin/bash # Description: Search for any existing schema definitions related to `childWorkflows`. rg 'childWorkflows' --type tsLength of output: 7438
Line range hint
109-121
: The definition ofTWorkflowById
and the update tofetchWorkflowById
are consistent with the schema changes. Ensure that the transformation logic infetchWorkflowById
is thoroughly tested, especially the handling ofpluginsOutput
.Verification successful
The definition of
TWorkflowById
and the update tofetchWorkflowById
are consistent with the schema changes. The transformation logic infetchWorkflowById
appears to handlepluginsOutput
correctly by usingdeepCamelKeys
onwebsite_monitoring.data
.
fetchWorkflowById
is defined inapps/backoffice-v2/src/domains/workflows/fetchers.ts
.- The function is used in
apps/backoffice-v2/src/domains/workflows/query-keys.ts
.Ensure that the transformation logic, especially the handling of
pluginsOutput
, is thoroughly tested.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the transformation logic in `fetchWorkflowById`. rg --type typescript $'fetchWorkflowById'Length of output: 75
Script:
#!/bin/bash # Description: Verify the transformation logic in `fetchWorkflowById`. rg --type ts 'fetchWorkflowById'Length of output: 365
Script:
#!/bin/bash # Description: Extract the implementation of `fetchWorkflowById` from `fetchers.ts`. rg --type ts --context 20 'fetchWorkflowById' apps/backoffice-v2/src/domains/workflows/fetchers.tsLength of output: 1472
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- apps/backoffice-v2/public/locales/en/toast.json (1 hunks)
- apps/backoffice-v2/src/domains/workflows/fetchers.ts (2 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx (1 hunks)
- services/workflows-service/prisma/data-migrations (1 hunks)
Files skipped from review due to trivial changes (1)
- apps/backoffice-v2/public/locales/en/toast.json
Files skipped from review as they are similar to previous changes (1)
- services/workflows-service/prisma/data-migrations
Additional Context Used
Biome (6)
apps/backoffice-v2/src/domains/workflows/fetchers.ts (1)
12-13: All these imports are only used as types.
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1)
5-6: All these imports are only used as types.
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (2)
1-1: All these imports are only used as types.
2-3: All these imports are only used as types.
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx (2)
1-1: All these imports are only used as types.
3-4: All these imports are only used as types.
Additional comments not posted (5)
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx (1)
8-27
: The implementation of theCaseOptions
component looks solid and well-integrated with the dropdown functionality for PDF generation.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1)
9-69
: TheRegistryPagePDF
class is well-implemented with clear separation of concerns and robust data handling.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1)
25-60
: TheuseCaseOptionsLogic
hook is efficiently implemented with proper error handling and state management for PDF generation.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx (1)
11-89
: TheTitlePage
component is well-designed with a clear layout and appropriate use of styling and data handling.apps/backoffice-v2/src/domains/workflows/fetchers.ts (1)
Line range hint
1-122
: The updates tofetchers.ts
are well-implemented with robust data fetching and error handling mechanisms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 14
Outside diff range and nitpick comments (1)
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1)
10-10
: Consider renamingPDF_NAME
toREGISTRY_PAGE_PDF
for clarity.This would make the purpose of the PDF more explicit in the codebase.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (30)
- apps/backoffice-v2/public/locales/en/toast.json (1 hunks)
- apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts (1 hunks)
- apps/backoffice-v2/src/common/utils/value-or-none/value-or-none.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/mutations/useGeneratePDFMutation/useGeneratePDFMutation.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts (1 hunks)
Files skipped from review due to trivial changes (2)
- apps/backoffice-v2/public/locales/en/toast.json
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/index.ts
Additional context used
Biome
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx
[error] 29-29: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx
[error] 29-29: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx
[error] 27-45: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx
[error] 45-50: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. (lint/style/useSelfClosingElements)
Unsafe fix: Use a SelfClosingElement instead
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx
[error] 40-50: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
[error] 52-62: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
[error] 64-74: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
[error] 76-86: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
[error] 97-101: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/IndividualSanctionsItem.tsx
[error] 76-76: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
[error] 97-97: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
[error] 118-118: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
[error] 139-139: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
Additional comments not posted (25)
apps/backoffice-v2/src/common/utils/value-or-none/value-or-none.ts (1)
1-3
: LGTM! Ensure thatvalueOrFallback
is robustly tested since it's critical to the functionality ofvalueOrNone
.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts (1)
1-9
: LGTM! Verify the consistent usage ofcompanyName
,creationDate
, andlogoUrl
across the application to ensure data integrity.Verification successful
The fields
companyName
,creationDate
, andlogoUrl
are used consistently across the application, as evidenced by the extensive search results.
- services/workflows-service/src/workflow/workflow.service.ts
- services/workflows-service/src/workflow/hook-callback-handler.service.ts
- services/workflows-service/src/workflow/utils/toPrismaOrderBy.ts
- services/workflows-service/src/workflow/cron/ongoing-monitoring.cron.ts
- services/workflows-service/src/workflow/types/index.ts
- services/workflows-service/src/workflow/dtos/find-workflows-list.dto.ts
- services/workflows-service/src/webhooks/webhooks.service.ts
- packages/workflow-core/src/lib/plugins/external-plugin/api-plugin.test.ts
- services/workflows-service/src/business/schemas.ts
- services/workflows-service/src/case-management/controllers/case-management.controller.ts
- services/workflows-service/src/business/dtos/business-select.ts
- services/workflows-service/src/business/dtos/business.update.ts
- services/workflows-service/src/business/dtos/business-create.ts
- services/workflows-service/src/swagger/swagger.ts
- services/workflows-service/src/transaction/transaction.mapper.ts
- services/workflows-service/src/transaction/transaction.controller.external.ts
- services/workflows-service/src/transaction/transaction.controller.external.intg.test.ts
- services/workflows-service/src/transaction/test-utils/transaction-factory.ts
- services/workflows-service/src/business/business.repository.intg.test.ts
- services/workflows-service/src/business/business.model.ts
- services/workflows-service/src/business/business.controller.ts
- services/workflows-service/src/business/business.controller.external.ts
- services/workflows-service/src/end-user/end-user.controller.external.ts
- services/workflows-service/src/end-user/end-user.service.ts
- services/workflows-service/src/filter/dtos/temp-zod-schemas.ts
- services/workflows-service/src/end-user/dtos/end-user-create-with-business.ts
- services/workflows-service/src/collection-flow/workflow-adapters/kyb_parent_kyc_session_example/kyb_parent_kyc_session_example.workflow-adapter.ts
- services/workflows-service/src/collection-flow/dto/update-flow-input.dto.ts
- services/workflows-service/src/alert/types.ts
- services/workflows-service/src/alert/alert.service.intg.test.ts
- services/workflows-service/src/alert/alert.controller.external.ts
- services/workflows-service/scripts/seed.ts
- services/workflows-service/scripts/filters/index.ts
- services/workflows-service/scripts/generate-end-user.ts
- services/workflows-service/scripts/workflows/e2e-dynamic-url-example.ts
- services/workflows-service/scripts/workflows/dynamic-ui-workflow.ts
- services/workflows-service/scripts/workflows/workflow-runtime.ts
- services/workflows-service/scripts/workflows/parent-kyb-kyc-session-workflow.ts
- services/workflows-service/scripts/workflows/ui-definition/kyb-parent-dynamic-example/pages/2-company-info-page.ts
- services/workflows-service/scripts/workflows/ui-definition/kyb-with-associated-companies/definition/compose-kyb-with-associated-companies-definition.ts
- services/workflows-service/scripts/workflows/ui-definition/kyb-with-associated-companies/ui-definition/associated-company-ui-def/associated-ui-definition.ts
- services/workflows-service/scripts/workflows/ui-definition/kyb-with-associated-companies/ui-definition/kyb-with-associated-company-ui-def/6-company-ownership-with-associated.ts
- services/workflows-service/scripts/workflows/kyb-kyc-workflow-definition.ts
- services/workflows-service/scripts/workflows/kyc-email-process-example.ts
- services/workflows-service/scripts/workflows/index.ts
- packages/react-pdf-toolkit/src/components/layouts/Footer/types.ts
- packages/react-pdf-toolkit/src/components/layouts/Footer/Footer.tsx
- examples/report-generation-example/src/example-data.ts
- examples/headless-example/src/services/ballerine-backoffice.service.ts
- apps/kyb-app/src/components/organisms/UIRenderer/elements/JSONForm/components/RelationshipDropdown/RelationshipDropdown.tsx
- apps/kyb-app/src/components/organisms/UIRenderer/elements/JSONForm/JSONForm.tsx
- apps/kyb-app/src/pages/CollectionFlow/components/pages/Success/Success.tsx
- apps/kyb-app/src/domains/collection-flow/types/index.ts
- apps/kyb-app/src/components/layouts/AppShell/Navigation.tsx
- apps/kyb-app/src/pages/CollectionFlow/components/pages/Approved/Approved.tsx
- apps/kyb-app/src/pages/CollectionFlow/components/pages/Rejected/Rejected.tsx
- apps/kyb-app/src/pages/CollectionFlow/CollectionFlow.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageHeader/CaseInformationPageHeader.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/schemas/base-case-information-pdf.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx
- apps/backoffice-v2/src/pages/Entity/hooks/useEntityLogic/mock-workflow-with-children.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/company-ownership.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entities/components/Cases/hooks/useCases/useCases.tsx
- apps/backoffice-v2/src/lib/blocks/variants/KybExampleBlocks/hooks/useKybExampleBlocksLogic/useKybExampleBlocksLogic.tsx
- apps/backoffice-v2/src/lib/blocks/hooks/useAssosciatedCompaniesBlock/useAssociatedCompaniesBlock.tsx
- apps/backoffice-v2/src/lib/blocks/hooks/useAssosciatedCompaniesBlock/useAssociatedCompaniesBlock.stories.tsx
- apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx
- apps/backoffice-v2/src/lib/blocks/hooks/useAssosciatedCompaniesBlock/associated-company-adapter.ts
- apps/backoffice-v2/src/lib/blocks/components/KycBlock/hooks/useKycBlock/child-contexts.ts
- apps/backoffice-v2/src/common/hooks/useSearchParamsByEntity/validation-schemas.ts
- apps/backoffice-v2/src/domains/transactions/fetchers.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent usage of schema fields across the application. # Test: Search for the fields usage. Expect: Consistent usage across different modules. rg --type ts $'companyName|creationDate|logoUrl'Length of output: 30498
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts (1)
1-16
: LGTM! Verify the usage and validation of fields likeregistrationNumber
andcompanyStatus
in the application to ensure they meet business requirements.apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts (1)
1-26
: LGTM! Consider adding a cleanup mechanism for the canvas element to prevent memory leaks.
[REFACTOR_SUGGESTion]+ canvas.remove();
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1)
5-22
: The hookuseCaseOptionsLogic
is well-structured and follows best practices for asynchronous operations using React Query.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts (2)
6-26
: The abstract classIPDFRenderer
is well-designed, encapsulating the common functionalities needed for PDF rendering. The error handling ingetLogoUrl
is robust.
1-4
: Check the import paths and ensure that thepoweredByLogo
path is correct relative to this file.Verification successful
The import paths and the image path in
pdf-renderer.abstract.ts
are correct.
svg-to-png/svg-to-png
exists.fetchers
files exist.title-page-ballerine-logo.png
exists.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the import paths and the image path. # Test: Search for the import paths and the image path. Expect: Paths should exist. fd 'svg-to-png/svg-to-png' && fd 'fetchers' && fd 'title-page-ballerine-logo.png'Length of output: 823
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx (1)
1-3
: Ensure the imported utility functions are correctly implemented and used.Verification successful
The utility functions
valueOrFallback
andvalueOrNone
are correctly implemented and imported in theValueOrNone.tsx
file.
valueOrFallback
is defined inapps/backoffice-v2/src/common/utils/value-or-fallback/value-or-fallback.ts
.valueOrNone
is defined inapps/backoffice-v2/src/common/utils/value-or-none/value-or-none.ts
and utilizesvalueOrFallback
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the utility functions. # Test: Search for the utility function implementations. Expect: Functions should be implemented correctly. ast-grep --lang javascript --pattern $'export const valueOrFallback($_, $_)' ast-grep --lang javascript --pattern $'export const valueOrNone($_)'Length of output: 1057
Script:
#!/bin/bash # Description: Verify the utility functions. # Test: Search for the utility function implementations. Expect: Functions should be implemented correctly. ast-grep --lang javascript --pattern 'export const valueOrFallback = $_' ast-grep --lang javascript --pattern 'export const valueOrNone = $_'Length of output: 145
Script:
#!/bin/bash # Description: Verify the utility functions. # Test: Search for the utility function implementations. Expect: Functions should be implemented correctly. rg 'export const valueOrFallback' rg 'export const valueOrNone'Length of output: 314
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx (2)
8-31
: TheTitlePagePDF
class is well-implemented, adhering to the structure defined byIPDFRenderer
. The data fetching and validation logic are clear and concise.
1-6
: Verify the import paths to ensure they are correct and the files exist.Verification successful
The import paths in
title-page.pdf.tsx
are correct and the files exist in the expected locations.
pdf-renderer.abstract.ts
exists.TitlePage.tsx
exists.base-case-information-pdf.schema.ts
exists.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the import paths. # Test: Search for the import paths. Expect: Paths should exist. fd 'pdf-renderer.abstract' && fd 'TitlePage' && fd 'base-case-information-pdf.schema'Length of output: 480
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx (3)
6-6
: EnsureuseCaseOptionsLogic
is properly imported with the correct path.Verification successful
The import path for
useCaseOptionsLogic
inCaseOptions.tsx
is correct and matches the file structure in the project.
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx
: The import statement is correctly pointing touseCaseOptionsLogic
in thehooks
directory.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct import path for `useCaseOptionsLogic`. # Test: Search for the import statement in the project. Expect: Only one correct path. rg --type typescript "useCaseOptionsLogic"Length of output: 77
Script:
#!/bin/bash # Description: Verify the correct import path for `useCaseOptionsLogic`. # Test: Search for the import statement in the project. Expect: Only one correct path. rg --type ts "useCaseOptionsLogic"Length of output: 4520
18-18
: Ensure theonClick
handlergenerateAndOpenPDFInNewTab
is implemented with error handling.
9-9
: Check the destructuring ofuseCaseOptionsLogic
for consistency with its definition.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1)
42-42
: Ensure theisEmpty
method correctly handles edge cases for data validation.Verification successful
The
isEmpty
methods in the relevant files handle edge cases by checking if theitems
array or other relevant fields are empty or undefined. Here are the specific implementations:
company-ownership-page.pdf.tsx:
private isEmpty(data: TCompanyOwnershipData) { return !data.items?.length; }registry-page.pdf.tsx:
private isEmpty(data: TRegistryInformationData) { const values = [ data.registrationNumber, data.incorporationDate, data.companyType, data.companyStatus, data.registrationAddress, data.registryPage, data.lastUpdate, data.registeredAt, ]; return values.every(value => { return (Array.isArray(value) && !value.length) || !value; }); }individual-sanctions-page.pdf.tsx:
private isEmpty(data: TIndividualSanctionsData) { return !data.items?.length; }identity-verifications-page.pdf.tsx:
private isEmpty(data: TIdentityVerificationsData) { return !data.items?.length; }company-sanctions-page.pdf.tsx:
private isEmpty(data: TCompanySanctionsData) { return !data.sanctions?.length; }These implementations ensure that the
isEmpty
method correctly handles edge cases by checking for the presence and length of arrays or other relevant fields.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the `isEmpty` method handles all necessary edge cases. # Test: Search for the method implementation and check for comprehensive condition checks. ast-grep --lang typescript --pattern $'private isEmpty($_) { return !$_?.items?.length; }'Length of output: 568
Script:
#!/bin/bash # Description: Verify the `isEmpty` method handles all necessary edge cases. # Test: Search for the method implementation and check for comprehensive condition checks. ast-grep --lang typescript --pattern $'private isEmpty($_) { return !$_?.items?.length; }'Length of output: 568
Script:
#!/bin/bash # Description: Verify the `isEmpty` method handles all necessary edge cases. # Test: Search for the method implementation and check for comprehensive condition checks. ast-grep --lang typescript --pattern $'private isEmpty($_) { return !$_.items?.length; }'Length of output: 566
Script:
#!/bin/bash # Description: Verify the `isEmpty` method handles all necessary edge cases. # Test: Search for the method implementation and check for comprehensive condition checks. ast-grep --lang typescript --pattern $'private isEmpty($_) { return !$_?.items.length; }'Length of output: 566
Script:
#!/bin/bash # Description: Verify the `isEmpty` method handles all necessary edge cases. # Test: Search for the method implementation and check for comprehensive condition checks. ast-grep --lang typescript --pattern $'private isEmpty($_) { return !$_?.items?.length; }'Length of output: 568
Script:
#!/bin/bash # Description: Verify the `isEmpty` method handles all necessary edge cases. # Test: Search for the method name and inspect the implementation manually. rg 'isEmpty' --type tsLength of output: 4327
Script:
#!/bin/bash # Description: Extract the `isEmpty` method implementations from the relevant files. # Extract the `isEmpty` method implementation from company-ownership-page.pdf.tsx ast-grep --lang typescript --pattern 'private isEmpty($_) { $$$ }' apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx # Extract the `isEmpty` method implementation from registry-page.pdf.tsx ast-grep --lang typescript --pattern 'private isEmpty($_) { $$$ }' apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx # Extract the `isEmpty` method implementation from individual-sanctions-page.pdf.tsx ast-grep --lang typescript --pattern 'private isEmpty($_) { $$$ }' apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx # Extract the `isEmpty` method implementation from identity-verifications-page.pdf.tsx ast-grep --lang typescript --pattern 'private isEmpty($_) { $$$ }' apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx # Extract the `isEmpty` method implementation from company-sanctions-page.pdf.tsx ast-grep --lang typescript --pattern 'private isEmpty($_) { $$$ }' apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsxLength of output: 3303
Script:
#!/bin/bash # Description: Display the contents of the relevant files for manual inspection of the `isEmpty` method implementations. # Display the contents of company-ownership-page.pdf.tsx cat apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx # Display the contents of registry-page.pdf.tsx cat apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx # Display the contents of individual-sanctions-page.pdf.tsx cat apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx # Display the contents of identity-verifications-page.pdf.tsx cat apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx # Display the contents of company-sanctions-page.pdf.tsx cat apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsxLength of output: 12570
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1)
46-46
: Validate theisEmpty
method to ensure it accurately determines when there are no sanctions.Verification successful
The
rg
search results indicate multipleisEmpty
method implementations in the codebase. Specifically, the relevant implementation for thecompany-sanctions-page.pdf.tsx
file is found in the same file:apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx: private isEmpty(data: TCompanySanctionsData) {To verify the accuracy of this method, we need to inspect its implementation directly. Let's extract the implementation of the
isEmpty
method from thecompany-sanctions-page.pdf.tsx
file.
The
ast-grep
command failed again due to a pattern syntax error. To ensure we accurately verify theisEmpty
method, we should use a simpler approach by directly extracting the relevant lines from the file usingsed
.
The extracted implementation of the
isEmpty
method is as follows:private isEmpty(data: TCompanySanctionsData) { return !data.sanctions?.length; }This method checks if the
sanctions
array in thedata
object is either undefined or has a length of zero, which seems to be a valid way to determine if there are no sanctions.
- The method uses optional chaining (
?.
) to safely access thesanctions
property.- It returns
true
ifsanctions
is eitherundefined
or an empty array.Based on this implementation, the
isEmpty
method accurately determines when there are no sanctions.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the `isEmpty` method accurately checks for empty sanctions. # Test: Search for the method implementation and check for comprehensive condition checks. ast-grep --lang typescript --pattern $'private isEmpty($_) { return !$_?.sanctions?.length; }'Length of output: 576
Script:
#!/bin/bash # Description: Verify the `isEmpty` method accurately checks for empty sanctions. # Test: Search for the method implementation and check for comprehensive condition checks. ast-grep --lang typescript --pattern $'private isEmpty($_) { return !$_?.sanctions?.length; }'Length of output: 576
Script:
#!/bin/bash # Description: Verify the `isEmpty` method accurately checks for empty sanctions. # Test: Search for the method implementation and check for comprehensive condition checks. ast-grep --lang typescript --pattern $'function isEmpty($_) { return !$_?.sanctions?.length; }'Length of output: 98
Script:
#!/bin/bash # Description: Verify the `isEmpty` method accurately checks for empty sanctions. # Test: Search for the method name in the codebase to locate its implementation. rg 'isEmpty'Length of output: 4317
Script:
#!/bin/bash # Description: Extract the implementation of the `isEmpty` method from the company-sanctions-page.pdf.tsx file. # Extract the method implementation ast-grep --lang typescript --pattern $'private isEmpty(data: TCompanySanctionsData) { $$$ }' apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsxLength of output: 714
Script:
#!/bin/bash # Description: Extract the implementation of the `isEmpty` method from the company-sanctions-page.pdf.tsx file. # Extract the method implementation using sed sed -n '/private isEmpty(data: TCompanySanctionsData)/,/^}/p' apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsxLength of output: 296
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/EmptyIdentityVerificationsPage.tsx (1)
11-36
: Ensure the layout and styling ofEmptyIdentityVerificationsPage
are consistent with the application's design system.Verification successful
The
EmptyIdentityVerificationsPage
component is used within theIdentityVerificationsPagePDF
class'srender
method. The component is conditionally rendered whenpdfData
is empty. The imports and therender
method indicate that the component is integrated correctly.
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of layout and styling with the application's design system. # Test: Search for the component usage and check for consistent styling. rg --type typescript "EmptyIdentityVerificationsPage"Length of output: 88
Script:
#!/bin/bash # Description: Verify the consistency of layout and styling with the application's design system. # Test: Search for the component usage and check for consistent styling. rg --type ts "EmptyIdentityVerificationsPage"Length of output: 827
Script:
#!/bin/bash # Description: Extract the relevant code from `identity-verifications-page.pdf.tsx` to verify the layout and styling consistency. # Extract the lines where `EmptyIdentityVerificationsPage` is used. rg --type ts --context 10 "EmptyIdentityVerificationsPage" apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsxLength of output: 1206
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx (1)
12-37
: The structure and imports inEmptyIndividualSanctionsPage
are correctly implemented.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx (1)
12-40
: The dynamic generation of the subtitle usingdayjs
inEmptyCompanyOwnershipPage
is a good practice for displaying real-time data.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx (1)
12-40
: The consistent use of components and styles inEmptyRegistryInformationPage
ensures a uniform look across different PDF pages.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/mutations/useGeneratePDFMutation/useGeneratePDFMutation.tsx (1)
49-50
: Ensure proper error handling and user feedback for PDF generation failures.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx (1)
12-56
: Ensure consistent use of React hooks for data manipulation and rendering logic.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1)
49-51
: Good use of schema validation inisValid
.This ensures that the data conforms to the expected structure before proceeding with rendering.
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx (1)
7-86
: The implementation of theTitlePage
component is well-structured and adheres to the requirements specified for displaying various sections of the title page in a PDF document. The use oftw
for styling and the structured layout usingView
andTypography
components from@react-pdf/renderer
and@ballerine/react-pdf-toolkit
respectively, ensures a consistent and clean design. The dynamic rendering of thecreationDate
andcompanyName
using JavaScript'sDate
methods and the handling of thelogoUrl
are correctly implemented.One minor suggestion is to consider externalizing the inline styles for better maintainability and potential reuse across other components. This is not a blocker but could enhance the maintainability of the codebase.
Overall, the component meets the functional requirements and follows good React component practices.
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/CompanyOwnershipPage.tsx (1)
12-85
: TheCompanyOwnershipPage
component is well implemented with clear separation of concerns and modular code structure. The use of various sub-components likeCaseInformationPageHeader
,CaseInformationPageSection
, andCaseInformationDisclaimer
enhances the readability and reusability of the code.The dynamic rendering of the company ownership data with the
map
function and theValueOrNone
component to handle potentially undefined values are correctly used. The layout and styling usingtw
utility function from@ballerine/react-pdf-toolkit
are consistent and appropriate for the PDF rendering context.Consider addressing the previous comment about creating a reusable table component. This could further improve the modularity and reusability of your code, especially if similar table layouts are used across different PDF pages.
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/components/IdentityItem/IdentityItem.tsx (1)
7-136
: TheIdentityItem
component is implemented with a clear structure and proper use of theValueOrNone
component to handle optional data fields effectively. The layout is consistent, and the use oftw
for styling within the@react-pdf/renderer
context is appropriate.However, consider passing props directly as suggested in the previous review comments to reduce redundancy and improve the clarity of the component's API. This could make the component easier to maintain and integrate in different contexts where the identity verification data structure might vary.
import { useCustomerQuery } from '@/domains/customer/hook/queries/useCustomerQuery/userCustomerQuery'; | ||
import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery'; | ||
import { useGeneratePDFMutation } from '@/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/mutations/useGeneratePDFMutation/useGeneratePDFMutation'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Ensure the imported paths are correct and consistent.
- The file
useCustomerQuery.ts
is located atapps/kyb-app/src/hooks/useCustomerQuery/useCustomerQuery.ts
, which does not match the import path in the code. - The files
useCurrentCaseQuery.tsx
anduseGeneratePDFMutation.tsx
are correctly located as per their import paths.
Analysis chain
Ensure the imported paths are correct and consistent.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the import paths are correct.
# Test: Search for the import paths. Expect: Paths should exist.
fd 'useCustomerQuery/userCustomerQuery' && fd 'useCurrentCaseQuery/useCurrentCaseQuery' && fd 'useGeneratePDFMutation/useGeneratePDFMutation'
Length of output: 135
Script:
#!/bin/bash
# Description: Verify the existence of the base filenames for the imports.
# Test: Search for the base filenames. Expect: Filenames should exist.
fd 'useCustomerQuery.ts' && fd 'useCurrentCaseQuery.ts' && fd 'useGeneratePDFMutation.ts'
Length of output: 390
const NONE_TEXT_HEX_COLOR = '#999999'; | ||
const valueOrNoneTextColor = valueOrFallback(NONE_TEXT_HEX_COLOR, { checkFalsy: true }); | ||
|
||
export const ValueOrNone: FunctionComponent<IValueOrNoneProps> = ({ value }) => { | ||
return ( | ||
<Typography | ||
styles={[ | ||
tw( | ||
`text-[8px] leading-[1.45rem] ${ | ||
valueOrNoneTextColor(value) === NONE_TEXT_HEX_COLOR | ||
? `text-[${valueOrNoneTextColor(value)}]` | ||
: '' | ||
}`, | ||
), | ||
]} | ||
> | ||
{valueOrNone(value) as AnyChildren} | ||
</Typography> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ValueOrNone
component is correctly using the valueOrFallback
utility to handle potentially undefined values. Consider using React.memo
for optimization if this component is frequently re-rendered with the same props.
- export const ValueOrNone: FunctionComponent<IValueOrNoneProps> = ({ value }) => {
+ export const ValueOrNone: FunctionComponent<IValueOrNoneProps> = React.memo(({ value }) => {
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const NONE_TEXT_HEX_COLOR = '#999999'; | |
const valueOrNoneTextColor = valueOrFallback(NONE_TEXT_HEX_COLOR, { checkFalsy: true }); | |
export const ValueOrNone: FunctionComponent<IValueOrNoneProps> = ({ value }) => { | |
return ( | |
<Typography | |
styles={[ | |
tw( | |
`text-[8px] leading-[1.45rem] ${ | |
valueOrNoneTextColor(value) === NONE_TEXT_HEX_COLOR | |
? `text-[${valueOrNoneTextColor(value)}]` | |
: '' | |
}`, | |
), | |
]} | |
> | |
{valueOrNone(value) as AnyChildren} | |
</Typography> | |
); | |
}; | |
export const ValueOrNone: FunctionComponent<IValueOrNoneProps> = React.memo(({ value }) => { | |
return ( | |
<Typography | |
styles={[ | |
tw( | |
`text-[8px] leading-[1.45rem] ${ | |
valueOrNoneTextColor(value) === NONE_TEXT_HEX_COLOR | |
? `text-[${valueOrNoneTextColor(value)}]` | |
: '' | |
}`, | |
), | |
]} | |
> | |
{valueOrNone(value) as AnyChildren} | |
</Typography> | |
); | |
}); |
{items.map((item, index) => ( | ||
<IdentityItem key={index} {...item} /> | ||
))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using array indices as keys in React components to prevent issues with rendering performance and component state.
- {items.map((item, index) => (
- <IdentityItem key={index} {...item} />
- ))}
+ {items.map((item) => (
+ <IdentityItem key={item.id} {...item} />
+ ))}
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
{items.map((item, index) => ( | |
<IdentityItem key={index} {...item} /> | |
))} | |
{items.map((item) => ( | |
<IdentityItem key={item.id} {...item} /> | |
))} |
Tools
Biome
[error] 29-29: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
</View> | ||
</View> | ||
<View style={tw('flex flex-row')}> | ||
<View style={tw('w-[80px]')}> | ||
<Typography styles={[tw('text-[8px] leading-[1.45rem]')]} weight="bold"> | ||
Names | ||
</Typography> | ||
</View> | ||
<View style={tw('w-[400px]')}> | ||
<ValueOrNone value={names?.join(', ')} /> | ||
</View> | ||
</View> | ||
<View style={tw('flex flex-row')}> | ||
<View style={tw('w-[80px]')}> | ||
<Typography styles={[tw('text-[8px] leading-[1.45rem]')]} weight="bold"> | ||
Warnings | ||
</Typography> | ||
</View> | ||
<View style={tw('w-[400px] flex flex-row flex-wrap gap-2')}> | ||
{warnings.length ? ( | ||
warnings.map((warning, index) => ( | ||
<Link | ||
key={index} | ||
href={warning.sourceUrl} | ||
url={warning.name} | ||
styles={[tw('text-[#007AFF] no-underline')]} | ||
/> | ||
)) | ||
) : ( | ||
<ValueOrNone value={undefined} /> | ||
)} | ||
</View> | ||
</View> | ||
<View style={tw('flex flex-row')}> | ||
<View style={tw('w-[80px]')}> | ||
<Typography styles={[tw('text-[8px] leading-[1.45rem]')]} weight="bold"> | ||
Sanctions | ||
</Typography> | ||
</View> | ||
<View style={tw('w-[400px] flex flex-row gap-2 flex-wrap')}> | ||
{sanctions.length ? ( | ||
sanctions.map((sanction, index) => ( | ||
<Link | ||
key={index} | ||
href={sanction.sourceUrl} | ||
url={sanction.name} | ||
styles={[tw('text-[#007AFF] no-underline')]} | ||
/> | ||
)) | ||
) : ( | ||
<ValueOrNone value={undefined} /> | ||
)} | ||
</View> | ||
</View> | ||
<View style={tw('flex flex-row')}> | ||
<View style={tw('w-[80px]')}> | ||
<Typography styles={[tw('text-[8px] leading-[1.45rem]')]} weight="bold"> | ||
PEP | ||
</Typography> | ||
</View> | ||
<View style={tw('w-[400px] flex flex-row gap-2 flex-wrap')}> | ||
{PEP.length ? ( | ||
PEP.map((PEP, index) => ( | ||
<Link | ||
key={index} | ||
href={PEP.sourceUrl} | ||
url={PEP.name} | ||
styles={[tw('text-[#007AFF] no-underline')]} | ||
/> | ||
)) | ||
) : ( | ||
<ValueOrNone value={undefined} /> | ||
)} | ||
</View> | ||
</View> | ||
<View style={tw('flex flex-row')}> | ||
<View style={tw('w-[80px]')}> | ||
<Typography styles={[tw('text-[8px] leading-[1.45rem]')]} weight="bold"> | ||
Adverse Media | ||
</Typography> | ||
</View> | ||
<View style={tw('w-[400px] flex flex-row gap-2 flex-wrap')}> | ||
{adverseMedia.length ? ( | ||
adverseMedia.map((adverseMedia, index) => ( | ||
<Link | ||
key={index} | ||
href={adverseMedia.sourceUrl} | ||
url={adverseMedia.name} | ||
styles={[tw('text-[#007AFF] no-underline')]} | ||
/> | ||
)) | ||
) : ( | ||
<ValueOrNone value={undefined} /> | ||
)} | ||
</View> | ||
</View> | ||
</View> | ||
</View> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IndividualSanctionsItem
component is robust in handling various data fields and dynamically rendering content based on the data's presence. The use of conditional rendering and the ValueOrNone
component for handling optional or absent data is well implemented.
However, the static analysis tool has flagged the use of array indices as keys in the map
function calls. This is a valid concern as using indices as keys can lead to performance issues and bugs in React components when the order of items changes.
Here's a suggested fix:
- <Link key={index} href={warning.sourceUrl} url={warning.name} styles={[tw('text-[#007AFF] no-underline')]} />
+ <Link key={warning.sourceUrl} href={warning.sourceUrl} url={warning.name} styles={[tw('text-[#007AFF] no-underline')]} />
Apply this change to all instances where key={index}
is used. This will ensure that the keys are unique and tied to the content, not the array position.
Committable suggestion was skipped due to low confidence.
Tools
Biome
[error] 76-76: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
[error] 97-97: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
[error] 118-118: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
[error] 139-139: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
<CaseInformationPageSectionHeader title="Individual PEP/Sanctions" /> | ||
<View style={tw('flex flex-col gap-6')}> | ||
{items.map((item, index) => ( | ||
<IndividualSanctionsItem key={index} {...item} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace array index with unique identifier as key in list rendering.
- <IndividualSanctionsItem key={index} {...item} />
+ <IndividualSanctionsItem key={item.id} {...item} />
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<IndividualSanctionsItem key={index} {...item} /> | |
<IndividualSanctionsItem key={item.id} {...item} /> |
Tools
Biome
[error] 29-29: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
export const CompanySanctionsPage: FunctionComponent<TCompanySanctionsData> = ({ | ||
sanctions, | ||
companyName, | ||
logoUrl, | ||
}) => { | ||
return ( | ||
<CaseInformationPageContainer> | ||
<View style={tw('mb-3')}> | ||
<CaseInformationPageHeader companyLogo={logoUrl} companyName={companyName} /> | ||
</View> | ||
<View style={tw('flex flex-col gap-5')}> | ||
<CaseInformationPageSection> | ||
<View style={tw('flex flex-col gap-4 py-3')}> | ||
{/* Company Sanctions section --- start */} | ||
<CaseInformationPageSectionHeader | ||
title="Company Sanctions" | ||
subtitle={`Check conducted at: ${dayjs().format('D MMM YYYY HH:mm')}`} | ||
/> | ||
<View style={tw('flex flex-col gap-2')}> | ||
<View style={tw('flex flex-row')}> | ||
<View style={tw('w-[72px]')}> | ||
<Typography styles={[tw('text-[8px]')]} weight="bold"> | ||
Scan Status | ||
</Typography> | ||
</View> | ||
<Typography>Completed</Typography> | ||
</View> | ||
<View style={tw('flex flex-row')}> | ||
<View style={tw('w-[72px]')}> | ||
<Typography styles={[tw('text-[8px]')]} weight="bold"> | ||
Total Matches | ||
</Typography> | ||
</View> | ||
<Typography styles={[tw('text-[#EA4335]')]} weight="bold"> | ||
{sanctions.length} | ||
{' matches'} | ||
</Typography> | ||
</View> | ||
</View> | ||
<View style={tw('flex flex-col gap-4')}> | ||
{sanctions.map((item, index) => ( | ||
<CompanySanctionsMatchSection | ||
key={item.name} | ||
primaryName={item.name} | ||
labels={item.labels} | ||
matchNumber={index + 1} | ||
lastReviewedDate={item.reviewDate ? new Date(item.reviewDate) : undefined} | ||
matchReasons={item.matchReasons} | ||
sources={item.sources.filter(source => isValidUrl(source))} | ||
addresses={item.addresses} | ||
/> | ||
))} | ||
</View> | ||
{/* Company Sanctions section --- end */} | ||
</View> | ||
</CaseInformationPageSection> | ||
<CaseInformationDisclaimer /> | ||
</View> | ||
</CaseInformationPageContainer> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure consistent date formatting in CompanySanctionsPage
.
The subtitle in the CaseInformationPageSectionHeader
uses dayjs().format('D MMM YYYY HH:mm')
directly. It's recommended to define this date format in a constant or utility function for reuse and consistency across the application.
items: childWorkflowSessions | ||
.map(childWorkflowSession => { | ||
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 || '', | ||
}), | ||
); | ||
}) | ||
.flat(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify data transformation using .flatMap()
instead of .map().flat()
.
- .map().flat()
+ .flatMap()
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
items: childWorkflowSessions | |
.map(childWorkflowSession => { | |
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 || '', | |
}), | |
); | |
}) | |
.flat(), | |
items: childWorkflowSessions | |
.flatMap(childWorkflowSession => { | |
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 || '', | |
}), | |
); | |
}), |
Tools
Biome
[error] 27-45: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
async getData() { | ||
const pdfData: TIndividualSanctionsData = { | ||
companyName: this.workflow.context?.entity?.data?.companyName || '', | ||
creationDate: new Date(), | ||
logoUrl: await this.getLogoUrl(), | ||
items: this.extractAmlSessions().map(session => { | ||
const rawAml = session.result?.vendorResult?.aml || {}; | ||
const amlData = amlAdapter(rawAml); | ||
|
||
return { | ||
checkDate: amlData.dateOfCheck ?? undefined, | ||
fullName: `${session.result?.childEntity?.firstName || ''} ${ | ||
session.result?.childEntity?.lastName || '' | ||
}`, | ||
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor getData
to use .flatMap()
for better performance.
Replace the .map().flat()
chains with .flatMap()
to simplify and optimize the data transformation logic.
- .map().flat()
+ .flatMap()
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
async getData() { | |
const pdfData: TIndividualSanctionsData = { | |
companyName: this.workflow.context?.entity?.data?.companyName || '', | |
creationDate: new Date(), | |
logoUrl: await this.getLogoUrl(), | |
items: this.extractAmlSessions().map(session => { | |
const rawAml = session.result?.vendorResult?.aml || {}; | |
const amlData = amlAdapter(rawAml); | |
return { | |
checkDate: amlData.dateOfCheck ?? undefined, | |
fullName: `${session.result?.childEntity?.firstName || ''} ${ | |
session.result?.childEntity?.lastName || '' | |
}`, | |
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; | |
async getData() { | |
const pdfData: TIndividualSanctionsData = { | |
companyName: this.workflow.context?.entity?.data?.companyName || '', | |
creationDate: new Date(), | |
logoUrl: await this.getLogoUrl(), | |
items: this.extractAmlSessions().map(session => { | |
const rawAml = session.result?.vendorResult?.aml || {}; | |
const amlData = amlAdapter(rawAml); | |
return { | |
checkDate: amlData.dateOfCheck ?? undefined, | |
fullName: `${session.result?.childEntity?.firstName || ''} ${ | |
session.result?.childEntity?.lastName || '' | |
}`, | |
matchesCount: amlData.totalMatches, | |
names: amlData.matches.flatMap(match => match.aka), | |
warnings: amlData.matches | |
.flatMap(match => | |
match.warnings.map( | |
warning => | |
({ | |
sourceUrl: warning.source, | |
name: warning.warning, | |
} as { sourceUrl: string; name: string }), | |
), | |
) | |
.filter(warning => warning.name && warning.sourceUrl), | |
sanctions: amlData.matches | |
.flatMap(match => | |
match.sanctions.map( | |
sanction => | |
({ | |
sourceUrl: sanction.source, | |
name: sanction.sanction, | |
} as { sourceUrl: string; name: string }), | |
), | |
) | |
.filter(sanction => sanction.name && sanction.sourceUrl), | |
PEP: amlData.matches | |
.flatMap(match => | |
match.pep.map( | |
pep => | |
({ sourceUrl: pep.source, name: pep.person } as { | |
sourceUrl: string; | |
name: string; | |
}), | |
), | |
) | |
.filter(pep => pep.name && pep.sourceUrl), | |
adverseMedia: amlData.matches | |
.flatMap(match => | |
match.adverseMedia.map( | |
adverseMedia => | |
({ | |
sourceUrl: adverseMedia.source, | |
name: adverseMedia.entry, | |
} as { sourceUrl: string; name: string }), | |
), | |
) | |
.filter(adverseMedia => adverseMedia.name && adverseMedia.sourceUrl), | |
}; | |
}), | |
}; | |
return pdfData; |
Tools
Biome
[error] 40-50: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
[error] 52-62: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
[error] 64-74: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
[error] 76-86: The call chain .map().flat() can be replaced with a single .flatMap() call. (lint/complexity/useFlatMap)
Safe fix: Replace the chain with .flatMap().
items: (this.workflow?.context?.pluginsOutput?.ubo?.data?.uboGraph || []).map((ubo: any) => ({ | ||
companyName: ubo?.name, | ||
companyType: ubo?.type, | ||
ownershipPercentage: ubo?.shareHolders?.[0]?.sharePercentage, | ||
level: ubo?.level, | ||
})), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimize the mapping logic to ensure type safety and reduce complexity.
- items: (this.workflow?.context?.pluginsOutput?.ubo?.data?.uboGraph || []).map((ubo: any) => ({
+ items: (this.workflow?.context?.pluginsOutput?.ubo?.data?.uboGraph || []).map((ubo: TCompanyOwnershipData) => ({
companyName: ubo?.name,
companyType: ubo?.type,
ownershipPercentage: ubo?.shareHolders?.[0]?.sharePercentage,
level: ubo?.level,
})),
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
items: (this.workflow?.context?.pluginsOutput?.ubo?.data?.uboGraph || []).map((ubo: any) => ({ | |
companyName: ubo?.name, | |
companyType: ubo?.type, | |
ownershipPercentage: ubo?.shareHolders?.[0]?.sharePercentage, | |
level: ubo?.level, | |
})), | |
items: (this.workflow?.context?.pluginsOutput?.ubo?.data?.uboGraph || []).map((ubo: TCompanyOwnershipData) => ({ | |
companyName: ubo?.name, | |
companyType: ubo?.type, | |
ownershipPercentage: ubo?.shareHolders?.[0]?.sharePercentage, | |
level: ubo?.level, | |
})), |
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, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor the mapping logic to improve readability and performance.
- sanctions: (this.workflow?.context?.pluginsOutput?.companySanctions?.data || []).map(
+ sanctions: (this.workflow?.context?.pluginsOutput?.companySanctions?.data || []).map((sanction: TCompanySanctionsData) => ({
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,
})),
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
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, | |
}), | |
sanctions: (this.workflow?.context?.pluginsOutput?.companySanctions?.data || []).map((sanction: TCompanySanctionsData) => ({ | |
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, | |
})), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx
User description
Description
Sample PDF
certificate).pdf
empty states .pdf
Type
enhancement
Description
CaseOptions
with functionality to download PDF certificates.IPDFRenderer
to standardize PDF rendering operations.Changes walkthrough
14 files
svg-to-png.ts
Add SVG to PNG Conversion Utility
apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts
svgToPng
to convert SVG images to PNGformat.
fetchers.ts
Refactor Customer Data Schema Definition
apps/backoffice-v2/src/domains/customer/fetchers.ts
constant
CustomerSchema
.fetchCustomer
function to use the newCustomerSchema
.fetchers.ts
Enhance Workflow Fetchers with New Schemas and Fields
apps/backoffice-v2/src/domains/workflows/fetchers.ts
WorkflowDefinitionByIdSchema
andAmlSchema
.childWorkflows
toBaseWorkflowByIdSchema
.useUbosRegistryProvidedBlock.tsx
Export Ubo Type from useUbosRegistryProvidedBlock Hook
apps/backoffice-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.tsx
Ubo
from local to exported.Case.Actions.tsx
Integrate CaseOptions Component into Case Actions
apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx
CaseOptions
.CaseOptions
component into the UI.CaseOptions.tsx
Implement CaseOptions Component with PDF Download
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx
CaseOptions
component with dropdown menu for downloadingPDF certificates.
company-ownership-page.pdf.tsx
Add Company Ownership PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx
company-sanctions-page.pdf.tsx
Add Company Sanctions PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx
identity-verifications-page.pdf.tsx
Add Identity Verifications PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx
individual-sanctions-page.pdf.tsx
Add Individual Sanctions PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx
pdf-renderer.abstract.ts
Introduce Abstract PDF Renderer Class
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts
IPDFRenderer
for PDF renderingoperations.
registry-page.pdf.tsx
Add Registry Page PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx
title-page.pdf.tsx
Add Title Page PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx
useCaseOptionsLogic.tsx
Implement PDF Certificate Generation and Download Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx
Summary by CodeRabbit
New Features
Bug Fixes
Enhancements
Dependencies