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

Merchant report optional company name #2492

Merged
merged 6 commits into from
Jul 1, 2024
Merged

Merchant report optional company name #2492

merged 6 commits into from
Jul 1, 2024

Conversation

Omri-Levy
Copy link
Contributor

@Omri-Levy Omri-Levy commented Jul 1, 2024

Summary by CodeRabbit

  • New Features

    • Streamlined the process of creating business reports with simplified and more intuitive validation for companyName and businessCorrelationId.
    • Added default value assignment for merchantName in business report creation to ensure smoother operation.
  • Bug Fixes

    • Improved error handling by removing unnecessary condition checks for merchantName and businessCorrelationId.
  • Chores

    • Updated internal dependencies for better performance and stability.

Copy link

changeset-bot bot commented Jul 1, 2024

⚠️ No Changeset found

Latest commit: 6f21f33

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

vercel bot commented Jul 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ballerine-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 9:57am

Copy link
Contributor

coderabbitai bot commented Jul 1, 2024

Walkthrough

The changes focus on refining the business report management system. The CreateBusinessReportSchema was simplified for ease of use. Controller logic was enhanced to handle default values for merchantName, and data migration scripts updated with new commit references to ensure seamless database operations. No complex new features were introduced, ensuring stability and incremental improvement.

Changes

Files Change Summary
apps/backoffice-v2/src/pages/MerchantMonitoringCreateCheck/create-business-report-schema.ts Simplified companyName, operatingCountry, and businessCorrelationId definitions; streamlined validations.
services/workflows-service/prisma/data-migrations Updated subproject commit hash to reflect the latest migration scripts for database consistency.
services/workflows-service/src/business-report/business-report.controller.internal.ts Adjusted merchantName logic: removed conditional exception and added default value assignment if merchantName is not provided.

Poem

A schema now so clean and bright,
Validations trimmed just right,
Merchant names that fill the air,
With default love, no checks to spare.
Database migrations glide,
On updated hashes, side by side.
Code refined, no bugs to spite,
In this quiet code delight.


Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues.
  • OSS projects are currently opted into early access features by default.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@Omri-Levy Omri-Levy enabled auto-merge (squash) July 1, 2024 07:45
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: 0

Outside diff range and nitpick comments (1)
services/workflows-service/src/business-report/business-report.controller.internal.ts (1)

Line range hint 47-47: Fix decorators usage.

Decorators are not valid on parameters according to the static analysis tool. Consider enabling unsafeParameterDecoratorsEnabled in the configuration file or refactoring the code.

-    @Body() { websiteUrl, countryCode, merchantName, businessCorrelationId, reportType }: CreateBusinessReportDto,
-    @CurrentProject() currentProjectId: TProjectId,
+    createBusinessReport(
+      @Body() createBusinessReportDto: CreateBusinessReportDto,
+      @CurrentProject() currentProjectId: TProjectId,
+    ) {
+      const { websiteUrl, countryCode, merchantName, businessCorrelationId, reportType } = createBusinessReportDto;

Also applies to: 55-55, 136-137, 192-193, 229-230, 266-267

Tools
Biome

[error] 55-55: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6aa6ce6 and ac00dec.

Files selected for processing (3)
  • apps/backoffice-v2/src/pages/MerchantMonitoringCreateCheck/create-business-report-schema.ts (1 hunks)
  • services/workflows-service/prisma/data-migrations (1 hunks)
  • services/workflows-service/src/business-report/business-report.controller.internal.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • services/workflows-service/prisma/data-migrations
Additional context used
Biome
services/workflows-service/src/business-report/business-report.controller.internal.ts

[error] 47-47: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)


[error] 55-55: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)


[error] 136-136: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)


[error] 137-137: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)


[error] 192-192: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)


[error] 193-193: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)


[error] 229-229: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)


[error] 230-230: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)


[error] 266-266: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)


[error] 267-267: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)

Additional comments not posted (6)
apps/backoffice-v2/src/pages/MerchantMonitoringCreateCheck/create-business-report-schema.ts (4)

7-10: Ensure the URL regex is comprehensive.

The regex pattern for validating websiteUrl appears to cover a wide range of URLs. However, ensure it meets all your use cases, including edge cases like international domain names and uncommon protocols.


11-16: LGTM!

The companyName field definition and validation logic are correct.


17-30: Verify the necessity of @ts-expect-error.

The @ts-expect-error directive suppresses type errors. Ensure it's necessary and consider resolving the underlying type issue if possible.


31-36: LGTM!

The businessCorrelationId field definition and validation logic are correct.

services/workflows-service/src/business-report/business-report.controller.internal.ts (2)

58-58: LGTM!

The default value assignment for merchantName is correct and improves code robustness.


Line range hint 60-74: Verify the impact of removing the merchantName check.

Ensure that removing the condition checking for merchantName does not introduce any issues in the business logic.

Tools
Biome

[error] 55-55: Decorators are not valid here.

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

(parse)

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ac00dec and 0483622.

Files selected for processing (1)
  • services/workflows-service/prisma/data-migrations (1 hunks)
Files skipped from review due to trivial changes (1)
  • services/workflows-service/prisma/data-migrations

@Omri-Levy Omri-Levy merged commit 21c7be8 into dev Jul 1, 2024
11 checks passed
@Omri-Levy Omri-Levy deleted the bal-2321 branch July 1, 2024 10:22
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.

None yet

5 participants