-
Notifications
You must be signed in to change notification settings - Fork 204
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
Added merchant screening #2649
Added merchant screening #2649
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe recent changes involve updates across multiple projects and packages within the Changes
Sequence Diagram(s)sequenceDiagram
participant A as User
participant B as Web UI
participant C as API
participant D as Merchant Screening Plugin
A->>B: Request Merchant Screening
B->>C: Forward Request
C->>D: Invoke Merchant Screening Logic
D-->>C: Return Screening Results
C-->>B: Forward Results
B-->>A: Display Merchant Screening Results
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 4
Outside diff range, codebase verification and nitpick comments (1)
packages/common/src/schemas/documents/merchant-screening-plugin-schema.ts (1)
3-3
: Incorrect removal ofMatchResponseCodes
.The
MatchResponseCodes
is still being used in themerchant-screening-plugin-schema.ts
file. Removing it from the imports will lead to errors. Please ensure that it is re-imported to maintain functionality.
- File:
packages/common/src/schemas/documents/merchant-screening-plugin-schema.ts
- Line of usage:
matches: Type.Record(Type.String(), TypeStringEnum(MatchResponseCodes))
Analysis chain
Verify removal of MatchResponseCodes.
Ensure that
MatchResponseCodes
is not used elsewhere in this file or other related files.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `MatchResponseCodes` is not used elsewhere in the codebase. # Test: Search for the usage of `MatchResponseCodes`. Expect: No occurrences outside of this file. rg --type typescript -A 5 $'MatchResponseCodes'Length of output: 81
Script:
#!/bin/bash # Description: Verify that `MatchResponseCodes` is not used elsewhere in the codebase. # Test: Search for the usage of `MatchResponseCodes`. Expect: No occurrences outside of this file. rg --type ts -A 5 $'MatchResponseCodes'Length of output: 1659
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 (43)
- apps/backoffice-v2/CHANGELOG.md (1 hunks)
- apps/backoffice-v2/package.json (2 hunks)
- apps/backoffice-v2/src/common/components/molecules/ScrollArea/Scrollbar.tsx (1 hunks)
- apps/backoffice-v2/src/lib/blocks/components/ImageCell/ImageCell.tsx (1 hunks)
- apps/backoffice-v2/src/lib/blocks/components/TableCell/TableCell.tsx (1 hunks)
- apps/backoffice-v2/src/lib/blocks/create-blocks-typed/create-blocks-typed.ts (2 hunks)
- apps/backoffice-v2/src/lib/blocks/create-blocks-typed/types.ts (3 hunks)
- apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/columns.tsx (1 hunks)
- apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/format-value.ts (1 hunks)
- apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/interfaces.ts (1 hunks)
- apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/useMerchantScreeningBlock.tsx (1 hunks)
- apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useCaseBlocksLogic/utils/get-tabs-block-map.tsx (2 hunks)
- apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx (4 hunks)
- apps/kyb-app/CHANGELOG.md (1 hunks)
- apps/kyb-app/package.json (2 hunks)
- examples/headless-example/CHANGELOG.md (1 hunks)
- examples/headless-example/package.json (2 hunks)
- packages/common/CHANGELOG.md (1 hunks)
- packages/common/package.json (1 hunks)
- packages/common/src/consts/index.ts (1 hunks)
- packages/common/src/schemas/documents/merchant-screening-plugin-schema.ts (6 hunks)
- packages/react-pdf-toolkit/CHANGELOG.md (1 hunks)
- packages/react-pdf-toolkit/package.json (2 hunks)
- packages/ui/CHANGELOG.md (1 hunks)
- packages/ui/package.json (2 hunks)
- packages/ui/src/components/atoms/Image/Image.tsx (2 hunks)
- packages/ui/src/components/organisms/DataTable/DataTable.tsx (1 hunks)
- packages/workflow-core/CHANGELOG.md (1 hunks)
- packages/workflow-core/package.json (2 hunks)
- packages/workflow-core/src/lib/constants.ts (1 hunks)
- packages/workflow-core/src/lib/plugins/external-plugin/master-card-merchant-screening-plugin.ts (1 hunks)
- packages/workflow-core/src/lib/plugins/external-plugin/webhook-plugin.ts (2 hunks)
- packages/workflow-core/src/lib/types.ts (3 hunks)
- packages/workflow-core/src/lib/workflow-runner.ts (5 hunks)
- sdks/web-ui-sdk/CHANGELOG.md (1 hunks)
- sdks/web-ui-sdk/package.json (2 hunks)
- sdks/workflow-browser-sdk/CHANGELOG.md (1 hunks)
- sdks/workflow-browser-sdk/package.json (2 hunks)
- sdks/workflow-node-sdk/CHANGELOG.md (1 hunks)
- sdks/workflow-node-sdk/package.json (2 hunks)
- services/workflows-service/CHANGELOG.md (1 hunks)
- services/workflows-service/package.json (2 hunks)
- websites/docs/package.json (1 hunks)
Files skipped from review due to trivial changes (24)
- apps/backoffice-v2/CHANGELOG.md
- apps/backoffice-v2/package.json
- apps/backoffice-v2/src/common/components/molecules/ScrollArea/Scrollbar.tsx
- apps/kyb-app/CHANGELOG.md
- apps/kyb-app/package.json
- examples/headless-example/CHANGELOG.md
- examples/headless-example/package.json
- packages/common/CHANGELOG.md
- packages/common/package.json
- packages/react-pdf-toolkit/CHANGELOG.md
- packages/react-pdf-toolkit/package.json
- packages/ui/CHANGELOG.md
- packages/ui/package.json
- packages/ui/src/components/organisms/DataTable/DataTable.tsx
- packages/workflow-core/CHANGELOG.md
- sdks/web-ui-sdk/CHANGELOG.md
- sdks/web-ui-sdk/package.json
- sdks/workflow-browser-sdk/CHANGELOG.md
- sdks/workflow-browser-sdk/package.json
- sdks/workflow-node-sdk/CHANGELOG.md
- sdks/workflow-node-sdk/package.json
- services/workflows-service/CHANGELOG.md
- services/workflows-service/package.json
- websites/docs/package.json
Additional context used
Biome
packages/workflow-core/src/lib/plugins/external-plugin/master-card-merchant-screening-plugin.ts
[error] 11-13: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
Additional comments not posted (28)
apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/format-value.ts (1)
3-9
: Well-implemented address formatting logic.The function handles the conditional formatting based on the key and ensures that only non-null address components are included in the formatted string. Consider adding a comment explaining the logic for future maintainability.
apps/backoffice-v2/src/lib/blocks/components/ImageCell/ImageCell.tsx (1)
6-12
: Well-structured ImageCell component.The use of
forwardRef
and proper prop handling ensures that the component is reusable and maintainable. Consider adding propTypes or TypeScript types for props validation to enhance type safety and developer experience.apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/interfaces.ts (1)
1-22
: Comprehensive interface for merchant screening.The interface is well-defined and covers necessary fields for merchant screening. Consider using more specific types instead of
unknown
where possible to enhance type safety and predictability of the data structure.packages/workflow-core/src/lib/constants.ts (3)
1-6
: Good use of structured imports for plugin definitions.The imports are well-organized, which enhances readability and maintainability.
9-17
: Well-defined plugin kinds with immutability.Using
as const
ensures that thePluginKind
object is immutable, which is a best practice in this context to prevent accidental modifications.
19-27
: Plugin registry correctly maps kinds to implementations.The registry setup using
as const
andsatisfies
keyword ensures type safety and immutability, aligning with best practices for TypeScript development.packages/ui/src/components/atoms/Image/Image.tsx (2)
6-6
: Introduction of utility function for class name merging.The addition of the
ctw
function from common utilities is a good practice to manage class names dynamically.
15-20
: Enhanced flexibility in prop handling withinErrorBoundary
.Spreading
props
and merging styles and class names using thectw
function improves the component's adaptability and maintainability.Also applies to: 31-31
packages/workflow-core/src/lib/plugins/external-plugin/webhook-plugin.ts (2)
22-34
: Improved API request handling with dynamic URL replacement and detailed logging.The introduction of
replaceValuePlaceholders
for dynamic URL construction and expanded logging details enhances the transparency and flexibility of API interactions.
36-72
: Robust response handling and error management inWebhookPlugin
.The detailed logging of responses, implementation of response validation, and structured error handling significantly improve the plugin's capability to manage different API interaction scenarios.
apps/backoffice-v2/src/lib/blocks/create-blocks-typed/create-blocks-typed.ts (2)
24-24
: Approved: Import ofImageCell
.The import statement for
ImageCell
is correctly placed and follows the existing pattern of imports.
58-58
: Approved: Addition ofimage
key tocells
map.The addition of
image: ImageCell
to thecells
map is correctly implemented.Run the following script to verify the integration and testing of
ImageCell
:packages/workflow-core/package.json (2)
4-4
: Approved: Version update for@ballerine/workflow-core
.The version update from
0.6.34
to0.6.35
is correctly implemented.
34-34
: Approved: Dependency version update for@ballerine/common
.The update from
0.9.23
to0.9.24
is correctly implemented.Run the following script to check for potential breaking changes introduced by the dependency update:
Verification successful
Approved: Dependency version update for
@ballerine/common
.The update from
0.9.23
to0.9.24
is correctly implemented, and no breaking changes were found in the changelog or commit history. The update involves minor changes related to merchant screening.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for potential breaking changes due to dependency update. # Test: Search for major changes in `@ballerine/common`. Expect: No breaking changes. rg --type json -A 5 $'@ballerine/common'Length of output: 8572
Script:
#!/bin/bash # Search for changelog or release notes for @ballerine/common version 0.9.24 fd -I -g '*CHANGELOG*' -g '*RELEASE*' | xargs rg -A 5 '0.9.24'Length of output: 11521
Script:
#!/bin/bash # If no changelog is found, check the commit history for @ballerine/common between versions 0.9.23 and 0.9.24 git log --oneline --decorate --graph --all --grep='@ballerine/common' --grep='0.9.24' --grep='0.9.23'Length of output: 683
apps/backoffice-v2/src/lib/blocks/components/TableCell/TableCell.tsx (1)
56-56
: Approved: Modification to class name handling inTableCell
.The change in the order of class names is correctly implemented.
Run the following script to check for potential visual regressions:
apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useCaseBlocksLogic/utils/get-tabs-block-map.tsx (2)
56-56
: Integration ofmerchantScreeningBlock
in destructuring.The addition of
merchantScreeningBlock
to the destructuredblocks
array is correctly implemented. Ensure that theBlocks
type definition is updated to include this new block type.
66-66
: Addition ofmerchantScreeningBlock
todefaultTabsMap
.The
merchantScreeningBlock
is correctly added under theTab.SUMMARY
key indefaultTabsMap
. This change aligns with the PR's objective to enhance merchant screening capabilities.packages/workflow-core/src/lib/types.ts (2)
71-73
: New interfaceChildCallbackable
addition.The new interface
ChildCallbackable
with the optional methodinvokeChildWorkflowAction
is well-defined and matches the PR's description. This addition seems to streamline the callback mechanism in workflows.
84-84
: Reference update inWorkflowOptions
.The update to reference
ChildCallbackable['invokeChildWorkflowAction']
inWorkflowOptions
is correctly implemented, ensuring consistency with the new interface.packages/common/src/consts/index.ts (1)
139-169
: Constants for merchant screening added correctly.The new constants
MatchResponseCode
,MatchResponseCodes
, andMatchReasonCode
are well-defined and follow the existing patterns in the file. The use ofas const
andReadonlyArray
ensures immutability and type safety.apps/backoffice-v2/src/lib/blocks/create-blocks-typed/types.ts (1)
Line range hint
239-268
: New type definitions for image cells are correctly implemented.The
TImageCell
type is well-defined, leveraging TypeScript's utility types to ensure that the props match the actual component properties. The inclusion ofTImageCell
in theTCell
union type is correctly done, enhancing the modularity and reusability of cell types.apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/columns.tsx (1)
20-213
: Column definitions for merchant screening are well-implemented.The columns for displaying merchant screening data are correctly defined using the column helper from
@tanstack/react-table
. The use of UI components likeButton
,ChevronDown
, andTextWithNAFallback
within the columns is appropriate and consistent with the overall design of the application.packages/common/src/schemas/documents/merchant-screening-plugin-schema.ts (4)
331-338
: New schema declarations for TerminatedMerchant and InquiredMerchant.The new schemas are well-defined and encapsulate the merchant data effectively.
362-362
: Integration of new schemas in MerchantScreeningRawSchema.The integration of
TerminatedMerchantSchema
andInquiredMerchantSchema
intoMerchantScreeningRawSchema
enhances the structure and maintainability.Also applies to: 374-374
417-432
: Enhanced flexibility with composite types in MerchantScreeningProcessedSchema.The addition of composite types for
terminatedMatchedMerchant
andinquiredMatchedMerchant
allows for more flexible data handling.However, verify the integration with other systems to ensure compatibility.
440-440
: OptionalinvokedAt
in MerchantScreeningPluginSchema.Changing
invokedAt
from required to optional may reflect a shift in data collection needs. Ensure this change is compatible with related functionalities.apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx (1)
54-54
: Integration ofuseMerchantScreeningBlock
appears correct, verify data handling.The hook
useMerchantScreeningBlock
is properly integrated withinuseDefaultBlocksLogic
. However, ensure that the data flow fromworkflow.context.pluginsOutput.merchantScreening
is consistent and error-free.Run the following script to verify the data handling:
Also applies to: 434-507
Verification successful
Integration and data handling of
merchantScreening
are verified and correct.The
merchantScreening
data is consistently used within theuseDefaultBlocksLogic
function and other parts of the codebase. The integration appears to be correctly implemented, with no apparent issues in the data flow. The usage aligns with the expected design.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the data handling for merchant screening. # Test: Search for the usage of `merchantScreening` in the workflow context. Expect: Consistent and error-free data handling. rg --type typescript -A 5 $'workflow.context.pluginsOutput.merchantScreening'Length of output: 111
Script:
#!/bin/bash # Description: Verify the data handling for merchant screening. # Test: Search for the usage of `merchantScreening` in the workflow context. Expect: Consistent and error-free data handling. rg --glob '*.ts' --glob '*.tsx' -A 5 $'workflow.context.pluginsOutput.merchantScreening'Length of output: 87
Script:
#!/bin/bash # Description: Search for any mention of `merchantScreening` in the codebase to understand its usage. # Test: Search for `merchantScreening` in the codebase. rg --glob '*.ts' --glob '*.tsx' 'merchantScreening'Length of output: 2018
packages/workflow-core/src/lib/workflow-runner.ts (1)
381-395
: Refactoring ofpickApiPluginClass
enhances maintainability, consider further optimizations.The refactoring reduces complexity and improves code readability by utilizing
pluginsRegistry
andBALLERINE_API_PLUGINS_KINDS
. Ensure that all plugin kinds are correctly handled and consider further optimizations to streamline the plugin selection process.
packages/workflow-core/src/lib/plugins/external-plugin/master-card-merchant-screening-plugin.ts
Outdated
Show resolved
Hide resolved
apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/useMerchantScreeningBlock.tsx
Show resolved
Hide resolved
apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/useMerchantScreeningBlock.tsx
Show resolved
Hide resolved
apps/backoffice-v2/src/lib/blocks/hooks/useMerchantScreeningBlock/useMerchantScreeningBlock.tsx
Show resolved
Hide resolved
packages/workflow-core/src/lib/plugins/external-plugin/master-card-merchant-screening-plugin.ts
Outdated
Show resolved
Hide resolved
packages/workflow-core/src/lib/plugins/external-plugin/master-card-merchant-screening-plugin.ts
Outdated
Show resolved
Hide resolved
packages/workflow-core/src/lib/plugins/external-plugin/webhook-plugin.ts
Outdated
Show resolved
Hide resolved
* fix: custom rule (#2626) * WIP - Move report components to common packages (#2625) * feat(*): checkpoint * feat(*): checkpoint * fix(*): fixed mistakes in pr * fix(*): fixed sentry version * feat(*): updated common and ui * Update packages version (#2628) * feat(*): checkpoint * feat(*): checkpoint * fix(*): fixed mistakes in pr * fix(*): fixed sentry version * feat(*): updated common and ui * chore(*): update changeset version * chore(*): updated all packages * chore: reverting the condition to run release action before publish work-flow service (#2629) Co-authored-by: Chirag Sharma IAMOPS <chirag.sharma@billrun.com> * fix(ui): fixed filtering of boolean fields (#2630) * Fix boolean fields (#2631) * fix(ui): fixed filtering of boolean fields * revert(*): reverted adapter change * revert(*): reverted adapter change * Fix boolean fields (#2632) * fix(ui): fixed filtering of boolean fields * revert(*): reverted adapter change * revert(*): reverted adapter change * fix(*): boolean fields * feat(*): update backoffice * revert(backoffice-v2): reverted mock * fix: adds missing env in docker compose files (#2633) Co-authored-by: Rituraj <rituraj@Riturajs-MBP.lan> * fix(docs): dead links * fix(docs): webhook section * fix(docs): webhook section * refactor(backoffice-v2): improved readability on condition (#2638) * fix(*): added a wait step for workflows service db (#2639) * Replaced pagination component (#2642) * feat(backoffice-v2): replaced pagination component and added last page button * revert(backoffice-v2): removed unused isEmptyArray util * fix(backoffice-v2): removed sleep added by mistake * fix(docs): fixed path to md file and in-progress page content (#2640) * feat(*): added merchant screening plugin to swagger (#2647) * feat(docs): added webhook auth * feat(docs): added webhook auth * chore(docs): adding programming languages tabs, more examples to hmac signature verification (#2648) * Illiar/feat/tag input and fixes (#2646) * feat: added default values to array input & fixed render * feat: added tags input * fix: bugfixes * feat: reworked tag input * feat: implemented value apply plugin & cleanup * fix: added ballerine entity id assignment * fixed child workflows handling (#2651) * fix(*): fixed child workflow handling * refactor(workflow-runner): updated log text * fix: migration --------- Co-authored-by: Illia Rudniev <cheskmr@gmail.com> * fix: fixed type * feat: refactor * fix: added raio input to fix styles & ui bump * fix: refactor * fix: refactor * fix: lock fix * feat: tags input add on blur update * fix(kyb-app): tags input now displays placeholder (#2654) --------- Co-authored-by: Omri Levy <61207713+Omri-Levy@users.noreply.github.com> * Added merchant screening (#2649) * feat(backoffice-v2): replaced pagination component and added last page button * revert(backoffice-v2): removed unused isEmptyArray util * fix(backoffice-v2): removed sleep added by mistake * feat(*): moved merchant screening processing to the unified api * feat(*): updated packages * refactor(*): removed empty file * refactor(workflow-core): updated merchant screening plugin * chore(*): addressed pr comments * bal 2663 fix transaction monitoring alert (#2653) * fix(ui): changed tsconfig (#2655) * Dev 318/workflow on demand migration (#2637) * Added merchant screening to proccess tracker (#2657) * feat(backoffice-v2): replaced pagination component and added last page button * revert(backoffice-v2): removed unused isEmptyArray util * fix(backoffice-v2): removed sleep added by mistake * feat(*): moved merchant screening processing to the unified api * feat(*): updated packages * refactor(*): removed empty file * refactor(workflow-core): updated merchant screening plugin * chore(*): addressed pr comments * feat(backoffice-v2): added merchant screening to proccess tracker * Feature/create multi merchant csv import (#2652) * feat: created the endpoint and functionality to create business reports as batch in a csv * feat: added batch processing logic functionaltiy * feat: fixed controller swagger * updated the parse csv logic - upload file do not work * feat: finalized functionality of batch processing * feat: test * feat: tests fix * feat: added withQualityControl to Batch reports Unified-API call --------- Co-authored-by: Tomer Shvadron <tomers@ballerine.com> * feat(*): update report ui (#2660) * fix(wf-def): disallow template editing (#2661) * Added local only secrets (#2663) * feat(*): added local only secrets * refactor(workflows-service): renamed secrets variable * Batch report upload (#2662) * feat: batch report upload * feat: pr comments fixes * feat: pr comments fixes * feat: pr comment fix * feat: conflict fix * fix(*): schema, optionals, and super on method (#2665) * fix(*): in memories (#2666) * fix(*): plugin headers (#2667) * Illiar/fix/mastercard plugin data structure (#2668) * fix: updated schema & changed address source * fix: fixed data structure and method bug --------- Co-authored-by: Illia Rudniev <cheskmr@gmail.com> * fix(mm): change ongoing montoring sttings to optional * version bump * version bump * version bump * version bump --------- Co-authored-by: liorzam <6435752+liorzam@users.noreply.github.com> Co-authored-by: Chirag <134513193+codechirag123@users.noreply.github.com> Co-authored-by: Chirag Sharma IAMOPS <chirag.sharma@billrun.com> Co-authored-by: riturajgc <65999719+riturajgc@users.noreply.github.com> Co-authored-by: Rituraj <rituraj@Riturajs-MBP.lan> Co-authored-by: Alon Peretz <8467965+alonp99@users.noreply.github.com> Co-authored-by: Illia Rudniev <cheskmr@gmail.com> Co-authored-by: Daniel Blokh <35891501+Blokh@users.noreply.github.com> Co-authored-by: Tomer Shvadron <tomers@ballerine.com>
Summary by CodeRabbit
Bug Fixes
Documentation
Chores