v0.1.11b fixes

This commit is contained in:
2026-06-03 15:09:21 +12:00
parent cf968e802b
commit daa6e60a69
11 changed files with 304 additions and 43 deletions
+17
View File
@@ -20,6 +20,7 @@ import type {
ClientUserUpdateInput,
LoginResponse,
EditorMixUpdateInput,
EditorProductFormula,
EditorProductRow,
EditorProductUpdateInput,
MixCalculatorCreateInput,
@@ -340,6 +341,22 @@ export const api = {
method: 'PATCH',
body: JSON.stringify(payload)
}, 'client'),
editorProductFormula: (productId: number) =>
request<EditorProductFormula>(`/api/editor/products/${productId}/ingredients`, {}, 'client'),
addEditorProductIngredient: (productId: number, payload: { raw_material_id: number; quantity_kg: number; notes?: string | null }) =>
request<EditorProductFormula>(`/api/editor/products/${productId}/ingredients`, {
method: 'POST',
body: JSON.stringify(payload)
}, 'client'),
updateEditorProductIngredient: (productId: number, ingredientId: number, payload: MixIngredientUpdateInput) =>
request<EditorProductFormula>(`/api/editor/products/${productId}/ingredients/${ingredientId}`, {
method: 'PATCH',
body: JSON.stringify(payload)
}, 'client'),
deleteEditorProductIngredient: (productId: number, ingredientId: number) =>
request<EditorProductFormula>(`/api/editor/products/${productId}/ingredients/${ingredientId}`, {
method: 'DELETE'
}, 'client'),
productCosts: (fetcher?: ApiFetch) =>
cachedFetchJson<ProductCostBreakdown[]>('/api/powerbi/product-costs', mockCosts, 'client', fetcher),
scenarios: (fetcher?: ApiFetch) => cachedFetchJson<Scenario[]>('/api/scenarios', mockScenarios, 'client', fetcher),
@@ -285,16 +285,16 @@
th {
background: #fff;
font-size: 0.6rem;
font-size: 0.7rem;
}
td {
font-size: 0.7rem;
font-size: 0.82rem;
vertical-align: top;
}
td strong {
font-size: 0.72rem;
font-size: 0.84rem;
font-weight: 700;
color: #000;
}
@@ -1,7 +1,6 @@
import {
Calculator,
ClipboardPenLine,
FlaskConical,
Gauge,
LayoutDashboard,
ShieldCheck,
@@ -86,7 +85,8 @@ export const throughputItem: NavItem = {
};
export const workingDocumentItems: NavItem[] = [
{ href: '/mixes', label: 'Mix Master', shortLabel: 'MM', icon: FlaskConical, moduleKey: 'mix_master' }
// Mix Master remains available through the existing route and access logic,
// but is temporarily hidden from the sidebar.
];
export const accessControlItem: NavItem = {
+20
View File
@@ -241,6 +241,26 @@ export type EditorMixUpdateInput = {
notes?: string | null;
};
export type EditorProductIngredient = {
id: number;
raw_material_id: number;
raw_material_name: string;
quantity_kg: number;
sort_order: number;
notes: string | null;
};
export type EditorProductFormula = {
id: number;
tenant_id: string;
client_name: string;
name: string;
mix_id: number;
mix_name: string;
ingredients: EditorProductIngredient[];
total_kg: number;
};
export type Scenario = {
id: number;
name: string;