Fix: Throughput API v1 available - Details posted to Irving. POWERBI_KEY was missing from the .ENV file, so was not live.
Add: Editor now supports editing a mix's resolved formula directly, with % and kg dual entry on ingredient rows
Fix: Mix Editor should bring through correct ingredients. New resolved formula (same logic we use in Mix Calculator).
Fix: Security headers on all API responses (hardening)
Add: New mix button available on the Mix Editor.
Add: New ingredient button available on the Ingredient Editor
This commit is contained in:
2026-06-16 14:43:17 +12:00
parent 8f9a7b8193
commit 7db95e2027
46 changed files with 3805 additions and 1049 deletions
+17
View File
@@ -8,9 +8,12 @@ import type {
ClientUserModulePermission,
ClientUserUpdateInput,
LoginResponse,
EditorMixCreateInput,
EditorMixUpdateInput,
EditorMixRow,
EditorMixFormula,
EditorResolvedMixFormula,
EditorMixFormulaRowInput,
EditorIngredientRow,
EditorIngredientCreateInput,
EditorIngredientUpdateInput,
@@ -387,6 +390,11 @@ export const api = {
const path = qs ? `/api/editor/mixes?${qs}` : '/api/editor/mixes';
return cachedFetchJson<EditorMixRow[]>(path, 'client', fetcher);
},
createEditorMix: (payload: EditorMixCreateInput) =>
request<EditorMixRow>('/api/editor/mixes', {
method: 'POST',
body: JSON.stringify(payload)
}, 'client'),
updateEditorMix: (mixId: number, payload: EditorMixUpdateInput) =>
request<EditorMixRow>(`/api/editor/mixes/${mixId}`, {
method: 'PATCH',
@@ -394,6 +402,15 @@ export const api = {
}, 'client'),
editorMixFormula: (mixId: number) =>
request<EditorMixFormula>(`/api/editor/mixes/${mixId}/ingredients`, {}, 'client'),
// The resolved formula matching the Mix Calculator (product-first), used by
// the Mix Editor ingredient panel.
editorMixResolvedFormula: (mixId: number) =>
request<EditorResolvedMixFormula>(`/api/editor/mixes/${mixId}/formula`, {}, 'client'),
replaceEditorMixFormula: (mixId: number, rows: EditorMixFormulaRowInput[]) =>
request<EditorResolvedMixFormula>(`/api/editor/mixes/${mixId}/formula`, {
method: 'PUT',
body: JSON.stringify({ rows })
}, 'client'),
addEditorMixIngredient: (mixId: number, payload: { raw_material_id: number; quantity_kg: number; notes?: string | null }) =>
request<EditorMixFormula>(`/api/editor/mixes/${mixId}/ingredients`, {
method: 'POST',