feat: add purchase and consignment list/get operations#4
Conversation
- Add PurchaseAPI with list_purchases, create_purchase and get_purchase - Add ConsignmentAPI with list_consignments, create_consignment and get_consignment - Register both API classes in the composed API client
|
Warning Review limit reached
More reviews will be available in 58 minutes and 10 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
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 |
- Add purchase.pyi with the Purchase model and PurchaseAPI signatures - Add consignment.pyi with the Consignment model and ConsignmentAPI signatures
- Add the purchase and consignment financial and relation fields to the Purchase and Consignment stub models, aligned with the ERP models - Register PurchaseAPI and ConsignmentAPI in the base API stub
- Add workflow_operation.pyi with the WorkflowOperation stub holding the workflow_state field, mirroring the ERP hierarchy - Extend Consignment from WorkflowOperation so workflow_state is inherited at the correct level instead of being declared on the leaf model - Mark the back-end auto-valued financial fields (financial discounts and discount VAT) as optional so they are not mandatory on create
There was a problem hiding this comment.
Pull request overview
Adds upstream client support for Omni ERP’s purchases module by introducing PurchaseAPI and ConsignmentAPI mixins (list/create/get) and wiring them into the composed API plus top-level omni exports.
Changes:
- Add
PurchaseAPIandConsignmentAPIimplementations (list/create/get) targeting/omni/purchases*.jsonand/omni/consignments*.json. - Add matching type stubs (
.pyi) for the new APIs and their models, including a newWorkflowOperationstub type. - Register the new mixins in
baseand re-export API classes fromomni, plus updateCHANGELOG.md.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/omni/workflow_operation.pyi | Introduces WorkflowOperation stub used by consignment typing. |
| src/omni/purchase.pyi | Adds Purchase model and PurchaseAPI method signatures. |
| src/omni/purchase.py | Implements purchase list/create/get endpoints. |
| src/omni/consignment.pyi | Adds Consignment model and ConsignmentAPI method signatures. |
| src/omni/consignment.py | Implements consignment list/create/get endpoints. |
| src/omni/base.pyi | Registers PurchaseAPI and ConsignmentAPI in the composed API stub. |
| src/omni/base.py | Registers purchase and consignment mixins in the runtime composed API. |
| src/omni/init.py | Imports modules and re-exports PurchaseAPI / ConsignmentAPI. |
| CHANGELOG.md | Adds Unreleased notes for the new API support (needs minor correction). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Support for the list and get purchase operations in `PurchaseAPI` | ||
| * Support for the list and get consignment operations in `ConsignmentAPI` |
Summary
Adds upstream client support for the Omni ERP purchases module, mirroring the existing read/write API mixins (e.g.
TransferAPI).PurchaseAPI—list_purchases,create_purchase,get_purchase(omni/purchases.json)ConsignmentAPI—list_consignments,create_consignment,get_consignment(omni/consignments.json)APIand re-exported fromomni.Testing
python setup.py testblack .