mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 23:13:42 +01:00
feat(production): TUI-Screens für Produktionsschritte verwalten
Produktionsschritte im RecipeDetailScreen anzeigen, hinzufügen und entfernen. Neuer AddProductionStepScreen mit Formular für stepNumber, description, durationMinutes und temperatureCelsius.
This commit is contained in:
parent
1e12353b9b
commit
63f51bc1a9
8 changed files with 290 additions and 6 deletions
|
|
@ -9,8 +9,10 @@ import type { AxiosInstance } from 'axios';
|
|||
import type {
|
||||
RecipeDTO,
|
||||
IngredientDTO,
|
||||
ProductionStepDTO,
|
||||
CreateRecipeRequest,
|
||||
AddRecipeIngredientRequest,
|
||||
AddProductionStepRequest,
|
||||
} from '@effigenix/types';
|
||||
|
||||
export type RecipeType = 'RAW_MATERIAL' | 'INTERMEDIATE' | 'FINISHED_PRODUCT';
|
||||
|
|
@ -25,8 +27,10 @@ export const RECIPE_TYPE_LABELS: Record<RecipeType, string> = {
|
|||
export type {
|
||||
RecipeDTO,
|
||||
IngredientDTO,
|
||||
ProductionStepDTO,
|
||||
CreateRecipeRequest,
|
||||
AddRecipeIngredientRequest,
|
||||
AddProductionStepRequest,
|
||||
};
|
||||
|
||||
// ── Resource factory ─────────────────────────────────────────────────────────
|
||||
|
|
@ -60,6 +64,15 @@ export function createRecipesResource(client: AxiosInstance) {
|
|||
const res = await client.get<RecipeDTO>(`${BASE}/${recipeId}`);
|
||||
return res.data;
|
||||
},
|
||||
|
||||
async addProductionStep(id: string, request: AddProductionStepRequest): Promise<RecipeDTO> {
|
||||
const res = await client.post<RecipeDTO>(`${BASE}/${id}/steps`, request);
|
||||
return res.data;
|
||||
},
|
||||
|
||||
async removeProductionStep(id: string, stepNumber: number): Promise<void> {
|
||||
await client.delete(`${BASE}/${id}/steps/${stepNumber}`);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue