8000 Fix Account Holding validation and synchronization by Shpigford · Pull Request #1818 · maybe-finance/maybe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix Account Holding validation and synchronization #1818

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
Feb 7, 2025

Conversation

Shpigford
Copy link
Member

Fixes #1781

  • Add comprehensive validations for Account::Holding
  • Implement validation to ensure amount matches qty * price
  • Update Account::Syncer to include qty and price during synchronization
  • Add database constraints for holding attributes and calculations

Fixes #1781

- Add comprehensive validations for Account::Holding
- Implement validation to ensure amount matches qty * price
- Update Account::Syncer to include qty and price during synchronization
- Add database constraints for holding attributes and calculations
@Shpigford
Copy link
Member Author

@zachgoll Is this what you had in mind for addressing #1781 and #1767?

@Shpigford Shpigford requested a review from zachgoll February 6, 2025 20:49
Copy link
Collaborator
@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

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

Yep, that's pretty much what I was thinking!

Align with project convention of keeping complex validations in ActiveRecord
- Remove database-level check constraints for quantity, price, and amount
- Maintain database-level null and unique constraints
- Prepare for more flexible validation in the model layer
@Shpigford Shpigford merged commit cf23673 into main Feb 7, 2025
5 checks passed
@Shpigford Shpigford deleted the holding-model-constraints branch February 7, 2025 16:42
pranav7 pushed a commit to pranav7/maybe that referenced this pull request Mar 2, 2025
* Fix Account Holding validation and synchronization

Fixes maybe-finance#1781

- Add comprehensive validations for Account::Holding
- Implement validation to ensure amount matches qty * price
- Update Account::Syncer to include qty and price during synchronization
- Add database constraints for holding attributes and calculations

* Remove database check constraints for Account Holdings

Align with project convention of keeping complex validations in ActiveRecord
- Remove database-level check constraints for quantity, price, and amount
- Maintain database-level null and unique constraints
- Prepare for more flexible validation in the model layer
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.

Bug: Holding model should have ActiveRecord and DB null constraints
2 participants
0