Skip to content
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

Another fix for ongoing monitoring table #2779

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

tomer-shvadron
Copy link
Collaborator

@tomer-shvadron tomer-shvadron commented Oct 14, 2024

Summary by CodeRabbit

  • New Features

    • Improved filtering logic for ongoing merchant reports in the business reports section, enhancing the accuracy of search results.
  • Bug Fixes

    • Enhanced type safety in the business reports query method to prevent potential errors.
  • Style

    • Minor formatting adjustments made for improved readability of the code.

Copy link

changeset-bot bot commented Oct 14, 2024

⚠️ No Changeset found

Latest commit: c0fc552

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

Walkthrough

The pull request includes updates to the workflows-service subproject's commit reference and significant changes to the listBusinessReports method in the business-report.controller.internal.ts file. The query logic has been restructured to use an AND condition that combines two OR conditions for filtering ongoing merchant reports. Additionally, the method signature has been updated to incorporate TypeScript's satisfies operator for improved type safety, along with minor formatting adjustments for better readability.

Changes

File Path Change Summary
services/workflows-service/prisma/data-migrations Updated subproject commit reference from 57ead6acabc270de2fb18d7d72446a5479248502 to f58454460550a4e983dcc4fe6e3f06d99978d718. No alterations to exported or public entities.
services/workflows-service/src/business-report/business-report.controller.internal.ts Restructured listBusinessReports method's query logic from OR to AND with combined OR conditions. Updated args object to use TypeScript's satisfies operator. Minor formatting adjustments made. Method signature updated.

Possibly related PRs

  • blokh/feat/business report alerts #2311: This PR modifies the BusinessReport model and introduces new methods in the BusinessReportService, which are relevant to the changes made in the listBusinessReports method of the main PR.
  • feat: business Report in Backoffice updates #2450: This PR updates the business-report.module.ts and includes imports for BusinessReportService, which is related to the changes in the main PR that involve the listBusinessReports method.
  • Fixed reports #2454: This PR adds a reportId field to the BusinessReportControllerInternal, which is directly related to the changes in the main PR that also involve modifications to the BusinessReportControllerInternal.
  • Fixed reports #2455: Similar to Fixed reports #2454, this PR also involves changes to the hook-callback-handler.service.ts, which may interact with the listBusinessReports method in the main PR.
  • Fixed wrong prisma count type #2568: This PR modifies the count method in the BusinessReportRepository, which could impact how reports are counted or filtered in the listBusinessReports method.
  • Not showing unfinished ongoing reports #2773: This PR refines the filtering logic in the listBusinessReports method, which is directly related to the changes made in the main PR.
  • Small fix for the Ongoing OR condition #2777: This PR also refines the listBusinessReports method's filtering logic, enhancing the relevance of the changes made in the main PR.

Suggested labels

enhancement, Review effort [1-5]: 3

Suggested reviewers

  • MatanYadaev

Poem

🐇 In the meadow where reports do play,
A query's dance has found its way.
From OR to AND, the logic flows,
With type safety, the method grows.
Hoppy changes, bright and clear,
Business reports, we hold so dear! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 09f5cb8 and c0fc552.

📒 Files selected for processing (1)
  • services/workflows-service/src/business-report/business-report.controller.internal.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • services/workflows-service/src/business-report/business-report.controller.internal.ts

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@tomer-shvadron tomer-shvadron changed the title feat: another fix Another fix for ongoing monitoring table Oct 14, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 91ce2f9 and 09f5cb8.

📒 Files selected for processing (2)
  • services/workflows-service/prisma/data-migrations (1 hunks)
  • services/workflows-service/src/business-report/business-report.controller.internal.ts (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • services/workflows-service/prisma/data-migrations
🧰 Additional context used
🔇 Additional comments (1)
services/workflows-service/src/business-report/business-report.controller.internal.ts (1)

251-251: ⚠️ Potential issue

Unused variable 'ongoingOrCondition'

The variable ongoingOrCondition declared at line 251 is not used in the code, which may lead to confusion and unnecessary code clutter.

Apply this diff to remove the unused variable:

-        const ongoingOrCondition = [
-          {
-            type: {
-              not: {
-                equals: BusinessReportType.ONGOING_MERCHANT_REPORT_T1,
-              },
-            },
-          },
-          {
-            type: BusinessReportType.ONGOING_MERCHANT_REPORT_T1,
-            status: BusinessReportStatus.completed,
-          },
-        ];

Alternatively, if this variable was intended to be used in the query conditions, consider refactoring the code to utilize it, enhancing code reuse and maintainability.

Likely invalid or redundant comment.

@tomer-shvadron tomer-shvadron merged commit cdc1731 into dev Oct 14, 2024
10 checks passed
@tomer-shvadron tomer-shvadron deleted the chore/tomer/ongoing-or-condition-fix-2 branch October 14, 2024 12:58
tomer-shvadron added a commit that referenced this pull request Oct 14, 2024
* feat: another fix

* feat: small fix
tomer-shvadron added a commit that referenced this pull request Oct 14, 2024
* feat: another fix

* feat: small fix
@Omri-Levy Omri-Levy mentioned this pull request Nov 4, 2024
@coderabbitai coderabbitai bot mentioned this pull request Nov 14, 2024
@coderabbitai coderabbitai bot mentioned this pull request Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants