feat(order-forms): add OrderForm read-only API#5356
Closed
toommz wants to merge 8 commits into
Closed
Conversation
## Context This is the first branch in the order form lifecycle split. It provides the shared infrastructure and read-only API needed by all subsequent lifecycle branches. ## Description Add REST and GraphQL read-only endpoints for order forms, along with shared infrastructure: serializer, factory, GraphQL types, query object, contract, and model specs.
## Context The OrderFormIndex concern was only used by a single controller, unlike all other Index concerns which are shared across two controllers (root-level + customer-scoped). ## Description Remove the single-use OrderFormIndex concern and inline the index action directly in the controller. Replace external_customer_id with customer_id filter. Add all order form list filters: number, quote_number, owner_id, created_at range, and expires_at range. Add corresponding GraphQL arguments and contract validations. Fix quotes factory to let the Sequenced module handle sequential_id.
## 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 quote association was added speculatively but is not used by ransack search. ## Description Remove quote from OrderForm 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.
## Context Follow-up to the read-only OrderForm API/GraphQL changes. Review surfaced a handful of correctness issues and missing tests. ## Description - Propagate query validation failures from OrderFormsResolver so clients see the real error instead of a null collection. - Eager-load customer in OrderFormsQuery to avoid N+1 when serializing the GraphQL customer field. - Drop the redundant ransack matcher (single predicate did not need OR grouping). - Remove the out-of-scope order resource from ApiKey::RESOURCES. - Rename signed_by_user_id to lago_signed_by_user_id in the V1 serializer for consistency with other lago_* id keys. - Add query specs for invalid filters and multi-tenant scoping.
Contributor
Author
|
Superseded by a stacked split into 4 PRs — REST separated from GraphQL so the REST API can be QA'd and merged independently of frontend availability:
Each PR's diff is against its parent in the stack. On merge of each parent, GitHub will auto-retarget the children to |
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 is the first branch in the order form lifecycle split. It provides the shared infrastructure and read-only API needed by all subsequent lifecycle branches (sign, void, expire).
Description
Add REST and GraphQL read-only endpoints for order forms, along with shared infrastructure:
V1::OrderFormSerializerfor REST API serializationOrderFormobject,StatusEnum,VoidReasonEnumindexandshowactionsOrderFormsQuerywith status/customer/search filtering +OrderFormsQueryFiltersContractOrderFormfactory with traits (signed, expired, voided, expiring_tomorrow, expired_yesterday)ransackable_attributesandransackable_associationsApiKeyRESOURCES updated withorderandorder_form