feat(orders): add Order read-only API#5358
Closed
toommz wants to merge 7 commits into
Closed
Conversation
This branch provides the read-only API for orders (the resource created when an order form is signed). It depends on the read-order-form branch for shared infrastructure. Add REST and GraphQL read-only endpoints for orders, including serializer, factory, GraphQL types/enums, query object, contract, resolvers, and controller specs.
## Context The OrderIndex concern was only used by a single controller, matching the same issue as OrderFormIndex. ## Description Remove the single-use OrderIndex concern and inline the index action directly in the controller. Replace external_customer_id with customer_id filter. Add all order list filters: execution_mode, number, order_form_number, quote_number, owner_id, and executed_at range. Add corresponding GraphQL arguments and contract validations. Rebase branch onto read-order-form to resolve type dependency.
## Context All other filter methods use singular naming matching their filter param name. ## Description Rename with_owner_ids to with_owner_id for consistency with with_status, with_number, with_customer_id, etc.
## Context The order_form association was added speculatively but is not used by ransack search. ## Description Remove order_form from Order ransackable_associations since no search predicate references it.
## Context Only number_cont is used in ransack search. The id attribute and customer association were never referenced. ## Description Remove id from ransackable_attributes and remove the unused ransackable_associations method entirely.
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.
Roadmap Task
👉 Order Forms lifecycle
Context
This branch provides the read-only API for orders — the resource created when an order form is signed. It depends on the read-order-form branch for shared infrastructure (serializer/resolver patterns, factory, ransack setup) and extends the same patterns to
Order.Description
Add REST and GraphQL read-only endpoints for orders, mirroring the OrderForm API:
V1::OrderSerializerfor REST API serializationOrderobject,StatusEnum,OrderTypeEnum,ExecutionModeEnum,BackdatedBillingEnumorder) + filtered list (orders)indexandshowactionsOrdersQuerywith status/customer/number/quote_number/owner/date-range filters, plusOrdersQueryFiltersContractOrderfactoryransackable_attributesonOrderApiKey::RESOURCESupdated withorderDepends on #5356 (feat/order-forms/read-order-form).