Fix Account Holding validation and synchronization #1818

Merged
Shpigford merged 3 commits from holding-model-constraints into main 2025-02-08 00:42:01 +08:00

3 Commits

Author SHA1 Message Date
Josh Pigford
f6b719a327 Merge branch 'main' into holding-model-constraints 2025-02-07 10:36:22 -06:00
Josh Pigford
f92295a408 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
2025-02-07 10:36:06 -06:00
Josh Pigford
75d0278322 Fix Account Holding validation and synchronization
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
2025-02-06 14:48:24 -06:00