-
Notifications
You must be signed in to change notification settings - Fork 198
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
Improved database querying for individuals profiles #2360
Improved database querying for individuals profiles #2360
Conversation
…ead of using repository
|
WalkthroughThis update primarily enhances how workflow runtime data is managed in the case management system. It includes adding a new field to store Changes
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 (02501a1) |
PR Review 🔍
Code feedback:
|
PR Code Suggestions ✨
|
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
Out of diff range and nitpick comments (1)
services/workflows-service/src/workflow/workflow.service.ts (1)
Line range hint
1-1
: Ensure all necessary imports are maintained and unused imports are removed to keep the code clean.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- services/workflows-service/src/case-management/controllers/case-management.controller.ts (3 hunks)
- services/workflows-service/src/workflow/workflow-runtime-data.repository.ts (1 hunks)
- services/workflows-service/src/workflow/workflow.service.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- services/workflows-service/src/workflow/workflow-runtime-data.repository.ts
Additional comments not posted (26)
services/workflows-service/src/case-management/controllers/case-management.controller.ts (1)
95-99
: LGTM! Ensure the integration ofworkflowRuntimeData
withtags
does not affect other functionalities.Verification successful
The search results indicate extensive usage of
workflowRuntimeData
across various files in theworkflows-service
directory. This includes multiple interactions with theWorkflowRuntimeDataRepository
for operations likefindById
,findMany
,updateById
, and others. The integration of theworkflowRuntimeData
withtags
in theCaseManagementController
seems consistent with the usage patterns observed in other parts of the system, particularly in how data is handled and queried.Given the widespread and consistent handling of
workflowRuntimeData
across the service, it appears that the integration of thetags
field in theCaseManagementController
is aligned with existing practices and should not adversely affect other functionalities. This suggests that the original review comment's concern about verifying the integration has been addressed by the evidence provided in the script outputs.Conclusion:
The integration ofworkflowRuntimeData
withtags
in theCaseManagementController
is consistent with the handling of similar data across the system. There are no indications of potential issues from the current integration based on the script outputs.
- File:
services/workflows-service/src/case-management/controllers/case-management.controller.ts
- Lines: 95-99
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of `workflowRuntimeData` with `tags` in other parts of the system. # Test: Search for usage of `workflowRuntimeData`. Expect: Proper handling in all occurrences. rg --type typescript $'workflowRuntimeData'Length of output: 77
Script:
#!/bin/bash # Description: Verify the integration of `workflowRuntimeData` with `tags` in other parts of the system. # Test: Search for usage of `workflowRuntimeData`. Expect: Proper handling in all occurrences. rg --type ts 'workflowRuntimeData'Length of output: 24650
services/workflows-service/src/workflow/workflow.service.ts (25)
Line range hint
95-104
: FunctioncreateWorkflowDefinition
is implemented correctly and follows good practices.
Line range hint
106-123
: FunctioncloneWorkflowDefinition
is implemented correctly and follows good practices.
Line range hint
125-128
: FunctiongetWorkflowRuntimeDataById
is implemented correctly and follows good practices.
Line range hint
130-135
: FunctiongetWorkflowRuntimeDataByIdAndLockUnscoped
is implemented correctly and follows good practices.
Line range hint
137-160
: FunctiongetWorkflowByIdWithRelations
is implemented correctly and handles complex queries efficiently.
Line range hint
162-245
: FunctionformatWorkflow
is well-implemented, handling complex formatting and transformations efficiently.
Line range hint
247-297
: FunctionpersistChildEvent
is well-implemented, handling complex event persistence and context management efficiently.
Line range hint
299-302
: FunctiongetWorkflowDefinitionById
is implemented correctly and follows good practices.
Line range hint
304-309
: FunctiongetWorkflowsByState
is implemented correctly and handles state-based filtering efficiently.
Line range hint
311-321
: FunctionlistActiveWorkflowsRuntimeStates
is implemented correctly and efficiently lists active workflows with their states.
Line range hint
323-394
: FunctionlistWorkflowRuntimeDataWithRelations
is well-implemented, handling complex queries and pagination efficiently.
Line range hint
396-423
: FunctionformatWorkflowsRuntimeData
is implemented correctly and efficiently formats workflow data based on type.
Line range hint
425-429
: FunctionlistWorkflowRuntimeDataByUserId
is implemented correctly and follows good practices.
Line range hint
431-439
: FunctionlistFullWorkflowDataByUserId
is implemented correctly and efficiently fetches full workflow data with necessary details.
Line range hint
441-474
: FunctionlistRuntimeData
is well-implemented, handling complex queries, pagination, and sorting efficiently.
Line range hint
476-497
: Function_resolveOrderByParams
is implemented correctly and efficiently constructs order by clauses based on parameters.
Line range hint
499-515
: FunctionworkflowsRuntimeListItemsFactory
is implemented correctly and efficiently transforms query results into models.
Line range hint
517-522
: FunctionlistWorkflowDefinitions
is implemented correctly and follows good practices.
Line range hint
524-582
: FunctionupdateDecisionAndSendEvent
is well-implemented, handling complex decision updating and event sending efficiently.
Line range hint
584-670
: FunctionupdateDocumentDecisionById
is well-implemented, handling complex document decision updating efficiently.
Line range hint
672-774
: FunctionupdateDocumentById
is well-implemented, handling complex document updating efficiently.
Line range hint
776-798
: FunctionupdateDocumentInContext
is implemented correctly and efficiently updates documents in the context based on the method.
Line range hint
800-812
: FunctiongetDocuments
is implemented correctly and efficiently retrieves documents from the context based on the method.
Line range hint
814-827
: FunctionupdateDirectorDocument
is implemented correctly and efficiently updates director documents in the context.
Line range hint
829-837
: FunctiongetDirectorsDocuments
is implemented correctly and efficiently retrieves director documents from the context.
services/workflows-service/src/case-management/controllers/case-management.controller.ts
Outdated
Show resolved
Hide resolved
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
* feat: setting isCaseOverviewEnabled default to false (#2505) * Improved database querying for individuals profiles (#2360) * refactor(workflows-service): now fetching workflows via endusers instead of using repository * refactor(workflows-service): improved performance on profiles query * refactor(workflow-service): renamed iterable name --------- Co-authored-by: Omri Levy <61207713+Omri-Levy@users.noreply.github.com>
* fix(backoffice): increase profile timeout to 30s * Dev --> SB (#2506) * feat: setting isCaseOverviewEnabled default to false (#2505) * Improved database querying for individuals profiles (#2360) * refactor(workflows-service): now fetching workflows via endusers instead of using repository * refactor(workflows-service): improved performance on profiles query * refactor(workflow-service): renamed iterable name --------- Co-authored-by: Omri Levy <61207713+Omri-Levy@users.noreply.github.com> --------- Co-authored-by: Alon Peretz <Alonp99@gmail.com> Co-authored-by: Tomer Shvadron <tomers@ballerine.com>
User description
Description
Elaborate on the subject, motivation, and context.
Related issues
Breaking changes
How these changes were tested
Examples and references
Checklist
PR Type
enhancement
Description
CaseManagementController
by directly includingworkflowRuntimeData
in the initial query.findFirstByEntityId
andgetByEntityId
fromWorkflowRuntimeDataRepository
andWorkflowService
respectively, simplifying the codebase and potentially improving performance.Changes walkthrough 📝
case-management.controller.ts
Optimize end user data fetching by including workflowRuntimeData
services/workflows-service/src/case-management/controllers/case-management.controller.ts
workflowRuntimeData
to the selection set in the query forfetching end users.
workflowRuntimeData
via a separate service call withdirect access from the end user object.
workflow-runtime-data.repository.ts
Remove unused method from WorkflowRuntimeDataRepository
services/workflows-service/src/workflow/workflow-runtime-data.repository.ts
findFirstByEntityId
method which was previously used to fetchworkflow runtime data for a specific entity.
workflow.service.ts
Remove deprecated workflow data fetching method
services/workflows-service/src/workflow/workflow.service.ts
getByEntityId
method which was used to fetch workflow runtimedata.
Summary by CodeRabbit
New Features
tags
property to workflow runtime data for enhanced case management.Refactor