feat: per-line render overrides — override any output type setting at order time

Instead of duplicating output types for every variation (WebP vs PNG,
different resolution), keep one canonical output type and override
specific fields per order line via render_overrides JSONB.

Backend:
- render_overrides JSONB column on OrderLine (DB migration)
- Render task merges overrides with output type settings (format, width,
  height, samples, engine, denoiser, transparent_bg, cycles_device)
- POST /orders/{id}/batch-render-overrides endpoint for bulk override
- PatchLineBody accepts render_overrides for per-line patching

Frontend:
- Batch render overrides section on OrderDetail: output format dropdown
  (PNG/JPG/WebP) + resolution dropdown (512-4096)
- Clear button to remove overrides

MCP:
- create_order tool: accepts product_ids, output_type, render_overrides,
  material_override — enables "render all products as WebP" via Claude
- set_render_overrides tool: batch override on existing orders

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 12:26:38 +01:00
parent 5a148554c0
commit b892f72f7e
9 changed files with 281 additions and 2 deletions
+11 -1
View File
@@ -56,6 +56,7 @@ export interface OrderLine {
render_started_at: string | null
render_completed_at: string | null
material_override: string | null
render_overrides: Record<string, unknown> | null
notes: string | null
created_at: string
updated_at: string
@@ -68,6 +69,7 @@ export interface OrderLineCreate {
global_render_position_id?: string | null
gewuenschte_bildnummer?: string | null
material_override?: string | null
render_overrides?: Record<string, unknown> | null
notes?: string | null
}
@@ -252,7 +254,7 @@ export async function batchMaterialOverride(orderId: string, materialOverride: s
return res.data
}
export async function patchOrderLine(orderId: string, lineId: string, data: { material_override?: string | null }) {
export async function patchOrderLine(orderId: string, lineId: string, data: { material_override?: string | null; render_overrides?: Record<string, unknown> | null }) {
const res = await api.patch<{ updated: boolean; line_id: string }>(
`/orders/${orderId}/lines/${lineId}`,
data
@@ -260,6 +262,14 @@ export async function patchOrderLine(orderId: string, lineId: string, data: { ma
return res.data
}
export async function batchRenderOverrides(orderId: string, renderOverrides: Record<string, unknown> | null) {
const res = await api.post<{ updated: number; render_overrides: Record<string, unknown> | null }>(
`/orders/${orderId}/batch-render-overrides`,
{ render_overrides: renderOverrides }
)
return res.data
}
export async function cancelOrderRenders(orderId: string) {
const res = await api.post<{ cancelled: number; order_status: string; errors: string[] | null }>(
`/orders/${orderId}/cancel-renders`