Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Product Revenue: Do no allow negative revenue #12160

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

Merged
merged 3 commits into from
Apr 3, 2025
Merged

Conversation

Maffooch
Copy link
Contributor

@Maffooch Maffooch commented Apr 2, 2025

It does not make sense for revenue to be a negative number. Because the revenue field is a decimal field, we must add a validator to disallow values less than 0

[sc-10753]

@github-actions github-actions bot added the New Migration Adding a new migration file. Take care when merging. label Apr 2, 2025
Copy link

dryrunsecurity bot commented Apr 2, 2025

DryRun Security Summary

Database migration for the Product model includes adding input validation to prevent negative revenue values and improving decimal precision to enhance data integrity and reduce numeric precision vulnerabilities.

Expand for full summary

Summary: Database migration and model update for the Product model, focusing on revenue field modifications with input validation and decimal precision improvements.

Security Findings:
• Input Validation

  • MinValueValidator added to prevent negative revenue values
  • Helps prevent potential data integrity issues
    • Decimal Precision
  • Use of Decimal type reduces potential numeric precision vulnerabilities

No critical security vulnerabilities were identified in the provided summaries.

View PR in the DryRun Dashboard.

Copy link
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@Maffooch Maffooch added this to the 2.45.0 milestone Apr 3, 2025
@Maffooch Maffooch merged commit 34da17d into dev Apr 3, 2025
79 checks passed
@Maffooch Maffooch deleted the negative-revenue branch April 3, 2025 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Migration Adding a new migration file. Take care when merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants