Uh oh!
There was an error while loading. Please reload this page.
Add Payment model with Decimal amounts and PaymentStatus. - #44
Add Payment model with Decimal amounts and PaymentStatus.#44sainath5001 wants to merge 2 commits into
Conversation
Introduce ShadeObject base for from_dict/to_dict, add Payment and PaymentStatus (str, Enum for Python 3.10), validate amount > 0, declare pydantic in pyproject.toml, and cover the model with unit tests.
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a Pydantic ChangesPayment models
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
GM @sainath5001 |
Description
Introduce
ShadeObjectbase forfrom_dict/to_dict, addPaymentandPaymentStatus(str, Enumfor Python 3.10), validateamount > 0, declarepydanticinpyproject.toml, and cover the model with unit tests.This adds the typed Payment API response model so monetary amounts use
Decimal(not float) and status values are validated via enum.Dependency:
pydantic >= 2.0(added topyproject.toml;poetry.lockcontent-hash updated).Fixes#37
Type of change
How Has This Been Tested?
pytest— full suite (146 passed)tests/models/test_payment.py—from_dict, Decimal amount, PaymentStatus enum, invalid status errors, amount > 0Checklist:
Summary by CodeRabbit