Optical Orders
Optical orders (encargos): workshop work orders for prescription eyewear and contact lenses. Each order holds patient data, frame geometry, per-eye prescription and bookkeeping links to invoices, customer orders, supplier orders and production orders.
📄️ Get optical order by ID
Returns a single optical order with the full nested shape (per-eye prescription, treatments, colorations, supplements).
📄️ Update optical order
Full replacement of an existing optical order. Send the `If-Match` header with the current ETag for optimistic concurrency control.
📄️ Delete optical order
Deletes an optical order. Send the `If-Match` header with the current ETag for optimistic concurrency control.
📄️ Merge-patch optical order
RFC 7396 merge-patch over `application/merge-patch+json`. Send only the fields you want to change; include a field with value `null` to remove it. Use the `If-Match` header for optimistic concurrency control.
📄️ List optical orders
Returns a paginated list of optical orders with envelope `{data, totalCount, skip, limit, hasMore}`. Supports optional RSQL `filter`, `sort` (default `lastModifiedAt:desc`), `skip`/`limit` pagination and `modifiedAfter`/`modifiedBefore` bookends. Limit is capped at 200; skip is clamped to >= 0. The list payload does NOT include the nested per-eye prescription or lens add-ons; fetch the order by id for the full shape.
📄️ Create optical order
Creates a new optical order with header fields and the optional per-eye prescription. Business logic (stock reservations, production routing) runs in the legacy WAR via the internal commands gateway.
📄️ Prototype optical order for a creation form
Returns a non-persisted optical order prototype pre-filled with the authenticated user's default branch and the current date. The response carries no `id`, `version` or audit fields.