Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances data integrity by implementing non-negative validation for critical percentage and discount fields across the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly adds non_negative validation to several percentage and discount fields, which improves data integrity by preventing negative values. The changes in affiliate_referral_fee_rule.json and coupon_batch.json are a good step. I've added a couple of suggestions for coupon_batch.json to further enhance the validation logic for percentage-based discounts.
There was a problem hiding this comment.
Pull request overview
Updates Frappe DocType field metadata to prevent entering negative referral rates and coupon discount values, improving data integrity for affiliate fee rules and coupon batch configuration.
Changes:
- Add
non_negative: 1tofirst_referral_rateandsubsequent_referral_rate(Percent) in Affiliate Referral Fee Rule. - Add
non_negative: 1todiscountandrecurring_discount(Float) in Coupon Batch.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frappe_affiliate/frappe_affiliate/doctype/coupon_batch/coupon_batch.json | Enforces non-negative coupon discount fields via DocType metadata. |
| frappe_affiliate/frappe_affiliate/doctype/affiliate_referral_fee_rule/affiliate_referral_fee_rule.json | Enforces non-negative referral rate percentages via DocType metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This pull request updates the validation rules for several fields in the
Affiliate Referral Fee RuleandCoupon Batchdoctypes to ensure that percentage and discount values cannot be negative. This helps prevent invalid data entry and enforces more robust data integrity.Validation improvements for non-negative values:
non_negativeconstraint to thefirst_referral_rateandsubsequent_referral_ratepercent fields inaffiliate_referral_fee_rule.jsonto prevent negative referral rates.non_negativeconstraint to thediscountandrecurring_discountfloat fields incoupon_batch.jsonto ensure discounts cannot be negative. [1] [2]Relevant Technical Choices
Testing Instructions
Additional Information:
Screenshot/Screencast
Checklist
Fixes #