-
Notifications
You must be signed in to change notification settings - Fork 264
Bal 4296 ubo checks tracker #3442
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
base: dev
Are you sure you want to change the base?
Conversation
…l-4296-ubo-checks-tracker
|
|
Warning Rate limit exceeded@chesterkmr has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 16 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThis update introduces strict typing and icon mapping for end user individual verification check statuses, modifies UBO flow tracking to use end user data and their verification statuses, and extends workflow and plugin infrastructure to support a Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant UBOFlowsTracker
participant useUBOFlowsTrackerItems
participant getEndUserFlowStatus
UI->>UBOFlowsTracker: Render
UBOFlowsTracker->>useUBOFlowsTrackerItems: Call with endUsers
useUBOFlowsTrackerItems->>getEndUserFlowStatus: For each endUser, get status icon
getEndUserFlowStatus-->>useUBOFlowsTrackerItems: Return icon
useUBOFlowsTrackerItems-->>UBOFlowsTracker: Return tracker items with icons
UBOFlowsTracker-->>UI: Render tracker with updated items
sequenceDiagram
participant WorkflowService
participant createWorkflow
participant WorkflowRunner
participant ApiPlugin
WorkflowService->>createWorkflow: Call with projectId
createWorkflow->>WorkflowRunner: Instantiate with projectId
WorkflowRunner->>ApiPlugin: Instantiate with projectId
ApiPlugin->>ApiPlugin: Include projectId in API request payload
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 2
🧹 Nitpick comments (1)
packages/workflow-core/src/lib/plugins/external-plugin/api-plugin/api-plugin.ts (1)
100-103: Consider conditional inclusion of projectId in request payload.The current implementation spreads
projectIdunconditionally, which could add undefined values to the API request payload. Consider including it only when defined:- { - ...requestPayload, - projectId: this.projectId, - }, + { + ...requestPayload, + ...(this.projectId && { projectId: this.projectId }), + },This ensures clean API requests without undefined fields.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (17)
apps/backoffice-v2/src/common/components/molecules/ProcessTracker/constants.tsx(2 hunks)apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/ubo-flows/UBOFlowsTracker.tsx(1 hunks)apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/ubo-flows/hooks/useUBOFlowsTrackerItems/helpers/get-end-user-flow-status.ts(1 hunks)apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/ubo-flows/hooks/useUBOFlowsTrackerItems/helpers/get-ubo-flow-status-by-tags.ts(0 hunks)apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/ubo-flows/hooks/useUBOFlowsTrackerItems/useUBOFlowsTrackerItems.ts(1 hunks)apps/backoffice-v2/src/domains/individuals/fetchers.ts(2 hunks)apps/backoffice-v2/src/lib/blocks/hooks/useDocumentBlocks/hooks/useDocuments/useDocuments.ts(1 hunks)packages/ui/src/components/atoms/inputs/Checkbox/Checkbox.tsx(1 hunks)packages/workflow-core/src/lib/create-workflow.ts(2 hunks)packages/workflow-core/src/lib/plugins/external-plugin/api-plugin/api-plugin.ts(3 hunks)packages/workflow-core/src/lib/plugins/external-plugin/types.ts(1 hunks)packages/workflow-core/src/lib/plugins/external-plugin/vendor-consts.ts(1 hunks)packages/workflow-core/src/lib/types.ts(2 hunks)packages/workflow-core/src/lib/workflow-runner.ts(4 hunks)services/workflows-service/prisma/data-migrations(1 hunks)services/workflows-service/src/document/document.service.ts(1 hunks)services/workflows-service/src/workflow/workflow.service.ts(2 hunks)
💤 Files with no reviewable changes (1)
- apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/ubo-flows/hooks/useUBOFlowsTrackerItems/helpers/get-ubo-flow-status-by-tags.ts
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: Analyze (javascript)
- GitHub Check: test_linux
- GitHub Check: format
- GitHub Check: spell_check
- GitHub Check: build (ubuntu-latest)
- GitHub Check: lint
🔇 Additional comments (23)
packages/ui/src/components/atoms/inputs/Checkbox/Checkbox.tsx (1)
13-13: Cosmetic class order change
Reordering the CSS classes here is purely cosmetic and has no effect on styling or functionality.services/workflows-service/src/document/document.service.ts (1)
45-48: Group imports from the same module
ConsolidatingdefaultPrismaTransactionOptionsandbeginTransactionIfNotExistCurryinto a single import reduces repetition and improves readability.services/workflows-service/prisma/data-migrations (1)
1-1: Bump data-migrations submodule commit
The subproject pointer is updated to493a22283db566fbcd5381e71c6709223950370b. Please verify that all new Prisma migrations in this commit have been reviewed, tested, and are applied in your CI/deployment pipelines.packages/workflow-core/src/lib/plugins/external-plugin/types.ts (1)
32-32: LGTM! Clean interface extension for project context.The optional
projectIdproperty addition enables API plugins to be project-aware while maintaining backward compatibility.packages/workflow-core/src/lib/create-workflow.ts (1)
16-16: LGTM! Proper parameter threading for project context.The
projectIdparameter is cleanly extracted and passed through to theWorkflowRunnerconstructor, maintaining the function's structure while enabling project-scoped workflows.Also applies to: 30-30
packages/workflow-core/src/lib/types.ts (1)
90-90: LGTM! Consistent interface extensions for project support.Both
WorkflowOptionsandWorkflowRunnerArgsinterfaces are extended with optionalprojectIdproperties, ensuring type consistency across the workflow creation pipeline.Also applies to: 106-106
services/workflows-service/src/workflow/workflow.service.ts (2)
382-382: LGTM! Proper project context propagation in workflow formatting.The
projectIdis correctly passed from the workflow object when creating the workflow service instance, ensuring project scope is maintained.
2201-2201: LGTM! Consistent project context in event handling.The
currentProjectIdis properly passed when creating the workflow service instance during event processing, maintaining project scope throughout the workflow lifecycle.packages/workflow-core/src/lib/plugins/external-plugin/vendor-consts.ts (1)
911-911: LGTM - Field mapping addition looks correct.The addition of
workflowRuntimeDataIdto the request mapping is consistent with the existing pattern. Note that the field name differs from the source value (workflowRuntimeId) - ensure this naming is intentional for API compatibility.packages/workflow-core/src/lib/plugins/external-plugin/api-plugin/api-plugin.ts (1)
42-42: LGTM - Property addition follows correct pattern.The optional
projectIdproperty is properly typed and initialized.packages/workflow-core/src/lib/workflow-runner.ts (4)
93-93: LGTM - Private field follows naming convention.The private field declaration is consistent with the existing class structure.
117-117: LGTM - Constructor parameter properly typed.The optional
projectIdparameter is correctly added to the constructor signature.
142-144: LGTM - Clear initialization with helpful comment.The initialization is straightforward and the comment provides good context about the projectId's purpose.
223-223: LGTM - ProjectId properly threaded to API plugins.The
projectIdis correctly passed to API plugin constructors, completing the integration with the plugin system.apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/ubo-flows/UBOFlowsTracker.tsx (1)
7-7: ```shell
#!/bin/bashLocate the definition and usages of useUBOFlowsTrackerItems for verification
rg --no-heading --with-filename --line-number "useUBOFlowsTrackerItems" -A5 -B2
</details> <details> <summary>apps/backoffice-v2/src/common/components/molecules/ProcessTracker/constants.tsx (2)</summary> `12-12`: **LGTM - Proper import of domain constants.** Good practice importing the status constants from the domain layer to maintain consistency and type safety. --- `115-120`: **LGTM - Well-structured icon mapping.** The `endUserFlowStatusToIcon` mapping follows established patterns and provides: - Logical icon choices for each status - Proper fallback with DEFAULT - Consistency with existing Icon constants </details> <details> <summary>apps/backoffice-v2/src/domains/individuals/fetchers.ts (2)</summary> `19-23`: **LGTM - Excellent type safety improvement.** The `EndUserIndividualVerificationChecksStatus` constant provides strict typing for verification check statuses, following good domain modeling practices. --- `39-45`: **LGTM - Proper schema validation with strict literals.** The updated status field provides excellent type safety by: - Using `z.literal()` for exact string matching - Restricting values to only the defined constants - Making the field optional as appropriate - Preventing invalid status values at runtime </details> <details> <summary>apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/ubo-flows/hooks/useUBOFlowsTrackerItems/useUBOFlowsTrackerItems.ts (4)</summary> `9-12`: **LGTM! Clean implementation of the new mapping logic.** The mapping logic correctly: - Maps over the new `endUsers` parameter - Uses `valueOrNA` to safely handle null/undefined names - Leverages the new `getEndUserFlowStatus` helper for icon determination The implementation is clean and follows React best practices. --- `15-15`: **LGTM! Dependency array correctly updated.** The dependency array properly reflects the new `endUsers` parameter, ensuring the memoized value recomputes when the end users data changes. --- `6-6`: **Verify all callers use the new function signature.** The function signature change from `childWorkflows` to `endUsers` looks correct and aligns with the architectural shift to track end user verification statuses. ```shell #!/bin/bash # Description: Verify all callers have been updated to use the new signature # Expected: All usages should pass endUsers instead of childWorkflows # Search for all usages of useUBOFlowsTrackerItems rg "useUBOFlowsTrackerItems" -A 2 -B 2
4-4: Verify the helper function exists and is properly implemented.The new
getEndUserFlowStatushelper function is being imported. Please ensure it exists and handles all expected end user verification statuses correctly.#!/bin/bash # Description: Verify the getEndUserFlowStatus helper function exists and examine its implementation # Expected: Function should exist and properly map end user statuses to icons # Check if the helper function file exists and examine its contents fd -t f "get-end-user-flow-status" --exec cat {} # Also search for any references to the old function to ensure complete migration rg "getUBOFlowStatusByTags" -A 3
apps/backoffice-v2/src/lib/blocks/hooks/useDocumentBlocks/hooks/useDocuments/useDocuments.ts
Outdated
Show resolved
Hide resolved
...Tracker/trackers/ubo-flows/hooks/useUBOFlowsTrackerItems/helpers/get-end-user-flow-status.ts
Outdated
Show resolved
Hide resolved
...Tracker/trackers/ubo-flows/hooks/useUBOFlowsTrackerItems/helpers/get-end-user-flow-status.ts
Outdated
Show resolved
Hide resolved
| .object({ | ||
| status: z.string(), | ||
| status: z | ||
| .union([ |
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.
| .union([ | |
| .enum( |
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Style
Chores