✨(backend) add list of seats of batch order API client (v2 sales tunnel)#1289
Merged
jonathanreveille merged 3 commits intomainfrom Apr 1, 2026
Merged
Conversation
c4a3275 to
912fb93
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds client-facing support for exposing batch order “seat” information: aggregated seat counters on batch orders, plus a nested endpoint to list/retrieve the individual seats (orders) and their learner/voucher info.
Changes:
- Added
seats_owned/seats_to_ownindicators onBatchOrderand exposed them via client serializers (batch orders, quotes, agreements). - Introduced a nested
/batch-orders/{batch_order_id}/seats/API (serializer + filter + routing) to list/retrieve batch-order seats. - Updated OpenAPI snapshot and expanded test coverage (including perf baselines) for the new fields and endpoint.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/backend/joanie/tests/swagger/swagger.json | Adds schema/paths for nested batch-order seats + new seat counters in batch-order schemas. |
| src/backend/joanie/tests/core/models/test_batch_order.py | Adds unit tests for BatchOrder.seats_owned and BatchOrder.seats_to_own. |
| src/backend/joanie/tests/core/api/quotes/test_api_quotes.py | Updates expected quote payload to include seat counters under batch_order. |
| src/backend/joanie/tests/core/api/organizations/test_api_organizations_quotes.py | Updates organization quote API expectations to include seat counters. |
| src/backend/joanie/tests/core/api/organizations/test_api_organizations_agreements.py | Updates agreement API expectations to include seat counters. |
| src/backend/joanie/tests/core/api/organizations/test_api_organizations_agreements.perf.yml | Updates perf baseline to account for extra queries from new counters. |
| src/backend/joanie/tests/core/api/batch_order/test_retrieve.py | Updates batch order retrieve expectations to include seat counters. |
| src/backend/joanie/tests/core/api/batch_order/test_retrieve.perf.yml | Updates perf baseline for batch order retrieve. |
| src/backend/joanie/tests/core/api/batch_order/test_nested_batch_order_seats.py | New test suite covering nested seats list/retrieve, permissions, pagination, and filtering. |
| src/backend/joanie/tests/core/api/batch_order/test_list.py | Updates batch order list expectations to include seat counters. |
| src/backend/joanie/tests/core/api/batch_order/test_list.perf.yml | Updates perf baseline for batch order list. |
| src/backend/joanie/core/serializers/client.py | Exposes seat counters and adds NestedBatchOrderSeatsSerializer. |
| src/backend/joanie/core/models/products.py | Adds seats_owned / seats_to_own properties to BatchOrder. |
| src/backend/joanie/core/filters/client/init.py | Adds a filterset for nested batch-order seats (query filter). |
| src/backend/joanie/core/api/client/init.py | Introduces GenericBatchOrderViewSet and adds NestedBatchOrderSeatsViewSet. |
| src/backend/joanie/client_urls.py | Registers nested batch-order seats routes under /batch-orders/{batch_order_id}/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
912fb93 to
859ada6
Compare
kernicPanel
approved these changes
Mar 9, 2026
1542d34 to
cac5481
Compare
3 tasks
cac5481 to
38bdf3b
Compare
We want to show the list of the learners that will take part in the batch order. We need to list their fullnames and the voucher code that are available in the batch order.
We want authenticated user who owns a batch order or users with the right permissions of an organization (role : owner or admin) to be able to query filter by username, firstname, lastname, or email the learners of the batch order.
We want our API consumer to track the amount of seats claimed and the seats available. We added two new properties `seats_to_own` and `seats_owned`. We added this information to the different serializers for our API consumers can have this information from the learner's dashbaord and from the organization's dashboard.
38bdf3b to
d125c21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
We want to show the list of the learners that will take part in the batch order. We need to list their fullnames and the voucher code that are available in the batch order.
Proposal
seats_owned&seats_to_own)