-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat: add a report note when monitoring status is toggled (BAL-3398) #2979
Conversation
|
WalkthroughThe pull request introduces changes across multiple files in the backoffice and workflows service, focusing on simplifying the ongoing monitoring state management. The modifications primarily involve removing optional Changes
Sequence DiagramsequenceDiagram
participant User
participant UI
participant Mutation
participant NotesService
participant WorkflowService
User->>UI: Toggle Monitoring
UI->>Mutation: Turn On/Off Monitoring
Mutation->>WorkflowService: Update Monitoring State
WorkflowService-->>Mutation: State Updated
Mutation->>NotesService: Create Monitoring Note
NotesService-->>Mutation: Note Created
Mutation->>UI: Mutation Complete
Suggested Reviewers
Poem
✨ Finishing Touches
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: 2
🧹 Nitpick comments (1)
apps/backoffice-v2/src/pages/MerchantMonitoringBusinessReport/hooks/useMerchantMonitoringBusinessReportLogic/useMerchantMonitoringBusinessReportLogic.tsx (1)
126-141
: Consider handling empty strings in content array.The content array filtering could be improved to handle empty strings more explicitly.
Apply this diff to improve content array handling:
const content = [ 'Monitoring turned off', - reason ? `with reason: ${capitalize(reason)}` : null, - userReason ? `(${userReason})` : '', + reason && `with reason: ${capitalize(reason)}`, + userReason && `(${userReason})` ] - .filter(Boolean) + .filter((part): part is string => Boolean(part)) .join(' ');
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
apps/backoffice-v2/src/domains/notes/hooks/mutations/useCreateNoteMutation/useCreateNoteMutation.tsx
(2 hunks)apps/backoffice-v2/src/pages/MerchantMonitoringBusinessReport/MerchantMonitoringBusinessReport.page.tsx
(2 hunks)apps/backoffice-v2/src/pages/MerchantMonitoringBusinessReport/fetchers.ts
(0 hunks)apps/backoffice-v2/src/pages/MerchantMonitoringBusinessReport/hooks/useMerchantMonitoringBusinessReportLogic/useMerchantMonitoringBusinessReportLogic.tsx
(5 hunks)apps/backoffice-v2/src/pages/MerchantMonitoringBusinessReport/hooks/useToggleMonitoringMutation/useToggleMonitoringMutation.tsx
(2 hunks)services/workflows-service/src/business/business.controller.external.ts
(0 hunks)services/workflows-service/src/business/dtos/business-monitoring.patch.dto.ts
(1 hunks)
💤 Files with no reviewable changes (2)
- apps/backoffice-v2/src/pages/MerchantMonitoringBusinessReport/fetchers.ts
- services/workflows-service/src/business/business.controller.external.ts
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: Analyze (javascript)
- GitHub Check: test_windows
- GitHub Check: test_linux
- GitHub Check: lint
- GitHub Check: build (windows-latest)
- GitHub Check: build (ubuntu-latest)
🔇 Additional comments (6)
apps/backoffice-v2/src/pages/MerchantMonitoringBusinessReport/hooks/useToggleMonitoringMutation/useToggleMonitoringMutation.tsx (1)
19-20
: LGTM! Clean mutation function signature.The simplified parameter interface improves usability while maintaining type safety.
apps/backoffice-v2/src/pages/MerchantMonitoringBusinessReport/hooks/useMerchantMonitoringBusinessReportLogic/useMerchantMonitoringBusinessReportLogic.tsx (2)
61-65
: LGTM! Clear and comprehensive deboarding reasons.The simplified string array maintains readability while covering essential deboarding scenarios.
104-111
: LGTM! Clear monitoring status note creation.The note content is concise and informative when monitoring is turned on.
apps/backoffice-v2/src/pages/MerchantMonitoringBusinessReport/MerchantMonitoringBusinessReport.page.tsx (1)
226-231
: LGTM! Clean success callback implementation.The success callback properly handles modal state management.
services/workflows-service/src/business/dtos/business-monitoring.patch.dto.ts (2)
1-9
: LGTM! Changes align with PR objectives.The removal of
reason
anduserReason
properties aligns with the PR objective of storing monitoring status changes as report notes instead of metadata. The remainingstate
property maintains proper validation, type safety, and API documentation.
1-9
: Verify the removal of reason properties across the codebase.Let's ensure all related components have been updated to handle the removal of these properties.
...koffice-v2/src/domains/notes/hooks/mutations/useCreateNoteMutation/useCreateNoteMutation.tsx
Show resolved
Hide resolved
...fice-v2/src/pages/MerchantMonitoringBusinessReport/MerchantMonitoringBusinessReport.page.tsx
Show resolved
Hide resolved
* feat: updated styles for link elements (#2959) * feat: added csv document rendering (#2958) * fix(monitoring): changes the block ordering in website credibility view (#2963) * feat(monitoring): adds loading state for a single merchant record (BAL-3359) (#2960) * feat(monitoring): adjusts merchant risk summary text (BAL-3373) (#2961) * refactor(websiteCredibility): fix CardContent height for no data (#2966) * refactor(websiteCredibility): fix CardContent height for no data - Remove unused Tooltip import from recharts - Update CardContent class to ensure full height (your code is like a tidy room: looks clean but still has hidden messes) * empty * fix: UI fixes for statistics and merchant monitoring report pages (#2965) * feat(monitoring): adds exhaustive check for action before deboarding a merchant (BAL-3343) (#2964) * feat(monitoring): preserves scroll position on a data table (BAL-3248) (#2962) * fix: chart graph cut off (BAL-3395) (#2969) * fix: corrected home page merchants metrics source of truth (BAL-3396, BAL-3397) (#2968) * chore(*): updated packages (#2971) * fix(backoffice-v2): reverted default logic for from and to (#2973) * refactor(entities): streamline form data context creation (#2974) - Remove unnecessary context object creation - Simplify the return statement by directly returning the new context (your code is like a magic trick that turns objects into empty space) * fix: remove monitoring params logic from navbar (#2975) Co-authored-by: Omri Levy <[email protected]> * fix: fixed popup flickering in date picker & bump (#2977) * feat: add a report note when monitoring status is toggled (BAL-3398) (#2979) * feat: add a report note when monitoring status is toggled * chore: remove storing reason in metadata * fix: dmt and dsta rules (#2970) Co-authored-by: Lior Zamir <[email protected]> Co-authored-by: Alon Peretz <[email protected]> --------- Co-authored-by: Illia Rudniev <[email protected]> Co-authored-by: Sasha <[email protected]> Co-authored-by: Shane <[email protected]> Co-authored-by: Tomer Shvadron <[email protected]> Co-authored-by: liorzam <[email protected]> Co-authored-by: Lior Zamir <[email protected]> Co-authored-by: Alon Peretz <[email protected]>
* feat: updated styles for link elements (#2959) * feat: added csv document rendering (#2958) * fix(monitoring): changes the block ordering in website credibility view (#2963) * feat(monitoring): adds loading state for a single merchant record (BAL-3359) (#2960) * feat(monitoring): adjusts merchant risk summary text (BAL-3373) (#2961) * refactor(websiteCredibility): fix CardContent height for no data (#2966) * refactor(websiteCredibility): fix CardContent height for no data - Remove unused Tooltip import from recharts - Update CardContent class to ensure full height (your code is like a tidy room: looks clean but still has hidden messes) * empty * fix: UI fixes for statistics and merchant monitoring report pages (#2965) * feat(monitoring): adds exhaustive check for action before deboarding a merchant (BAL-3343) (#2964) * feat(monitoring): preserves scroll position on a data table (BAL-3248) (#2962) * fix: chart graph cut off (BAL-3395) (#2969) * fix: corrected home page merchants metrics source of truth (BAL-3396, BAL-3397) (#2968) * chore(*): updated packages (#2971) * fix(backoffice-v2): reverted default logic for from and to (#2973) * refactor(entities): streamline form data context creation (#2974) - Remove unnecessary context object creation - Simplify the return statement by directly returning the new context (your code is like a magic trick that turns objects into empty space) * fix: remove monitoring params logic from navbar (#2975) * fix: fixed popup flickering in date picker & bump (#2977) * feat: add a report note when monitoring status is toggled (BAL-3398) (#2979) * feat: add a report note when monitoring status is toggled * chore: remove storing reason in metadata * fix: dmt and dsta rules (#2970) --------- Co-authored-by: Illia Rudniev <[email protected]> Co-authored-by: Sasha <[email protected]> Co-authored-by: Shane <[email protected]> Co-authored-by: Tomer Shvadron <[email protected]> Co-authored-by: liorzam <[email protected]> Co-authored-by: Lior Zamir <[email protected]> Co-authored-by: Alon Peretz <[email protected]>
Stop storing reason & userReason inside metadata, instead create a note on a report.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor