Skip to content

feat(orders): add Order read-only API#5358

Closed
toommz wants to merge 7 commits into
feat/order-forms/read-order-formfrom
feat/order-forms/read-order
Closed

feat(orders): add Order read-only API#5358
toommz wants to merge 7 commits into
feat/order-forms/read-order-formfrom
feat/order-forms/read-order

Conversation

@toommz
Copy link
Copy Markdown
Contributor

@toommz toommz commented Apr 17, 2026

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::OrderSerializer for REST API serialization
  • GraphQL types: Order object, StatusEnum, OrderTypeEnum, ExecutionModeEnum, BackdatedBillingEnum
  • GraphQL resolvers: single order (order) + filtered list (orders)
  • REST controller with index and show actions
  • OrdersQuery with status/customer/number/quote_number/owner/date-range filters, plus OrdersQueryFiltersContract
  • Order factory
  • Model additions: ransackable_attributes on Order
  • ApiKey::RESOURCES updated with order
  • Full specs for serializer, resolvers, query, controller, and model

Depends on #5356 (feat/order-forms/read-order-form).

toommz added 7 commits April 17, 2026 14:19
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.
@toommz toommz self-assigned this Apr 17, 2026
@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