Skip to content

feat(order-forms): add OrderForm read-only API#5356

Closed
toommz wants to merge 8 commits into
feat/epic/order-formsfrom
feat/order-forms/read-order-form
Closed

feat(order-forms): add OrderForm read-only API#5356
toommz wants to merge 8 commits into
feat/epic/order-formsfrom
feat/order-forms/read-order-form

Conversation

@toommz
Copy link
Copy Markdown
Contributor

@toommz toommz commented Apr 16, 2026

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::OrderFormSerializer for REST API serialization
  • GraphQL types: OrderForm object, StatusEnum, VoidReasonEnum
  • GraphQL resolvers: single order form + list with filtering
  • REST controller with index and show actions
  • OrderFormsQuery with status/customer/search filtering + OrderFormsQueryFiltersContract
  • OrderForm factory with traits (signed, expired, voided, expiring_tomorrow, expired_yesterday)
  • Model additions: ransackable_attributes and ransackable_associations
  • ApiKey RESOURCES updated with order and order_form
  • Full specs for serializer, resolvers, query, controller, and model

toommz added 4 commits April 16, 2026 17:09
## 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.
@toommz toommz self-assigned this Apr 17, 2026
toommz added 4 commits April 17, 2026 10:16
## 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.
@toommz
Copy link
Copy Markdown
Contributor Author

toommz commented Apr 17, 2026

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 feat/epic/order-forms.

@toommz toommz closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant