Skip to content

feat: add purchase and consignment list/get operations#4

Merged
joamag merged 6 commits into
masterfrom
feat/purchases-consignments-api
Jun 26, 2026
Merged

feat: add purchase and consignment list/get operations#4
joamag merged 6 commits into
masterfrom
feat/purchases-consignments-api

Conversation

@joamag

@joamag joamag commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds upstream client support for the Omni ERP purchases module, mirroring the existing read/write API mixins (e.g. TransferAPI).

  • PurchaseAPIlist_purchases, create_purchase, get_purchase (omni/purchases.json)
  • ConsignmentAPIlist_consignments, create_consignment, get_consignment (omni/consignments.json)
  • Both classes registered in the composed API and re-exported from omni.

Testing

  • python setup.py test
  • black .

- 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
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@joamag, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a348021-12df-4116-9c1e-f9d6d8162bb5

📥 Commits

Reviewing files that changed from the base of the PR and between c27b5ed and b01d66c.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • src/omni/__init__.py
  • src/omni/base.py
  • src/omni/base.pyi
  • src/omni/consignment.py
  • src/omni/consignment.pyi
  • src/omni/purchase.py
  • src/omni/purchase.pyi
  • src/omni/workflow_operation.pyi

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

joamag added 4 commits June 26, 2026 14:58
- 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
@joamag joamag self-assigned this Jun 26, 2026
@joamag joamag marked this pull request as ready for review June 26, 2026 16:20
Copilot AI review requested due to automatic review settings June 26, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 PurchaseAPI and ConsignmentAPI implementations (list/create/get) targeting /omni/purchases*.json and /omni/consignments*.json.
  • Add matching type stubs (.pyi) for the new APIs and their models, including a new WorkflowOperation stub type.
  • Register the new mixins in base and re-export API classes from omni, plus update CHANGELOG.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.

Comment thread CHANGELOG.md
Comment on lines +12 to +13
* Support for the list and get purchase operations in `PurchaseAPI`
* Support for the list and get consignment operations in `ConsignmentAPI`
@joamag joamag merged commit 68155de into master Jun 26, 2026
16 checks passed
@joamag joamag deleted the feat/purchases-consignments-api branch June 26, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants