1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 10:29:35 +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:
Sebastian Frick 2026-02-19 19:38:14 +01:00
parent 1e12353b9b
commit 63f51bc1a9
8 changed files with 290 additions and 6 deletions

View file

@ -82,8 +82,10 @@ export type {
UpdateStorageLocationRequest,
RecipeDTO,
IngredientDTO,
ProductionStepDTO,
CreateRecipeRequest,
AddRecipeIngredientRequest,
AddProductionStepRequest,
} from '@effigenix/types';
// Resource types (runtime, stay in resource files)

View file

@ -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}`);
},
};
}

View file

@ -8,7 +8,9 @@ import type { components } from './generated/api';
// Response DTOs
export type RecipeDTO = components['schemas']['RecipeResponse'];
export type IngredientDTO = components['schemas']['IngredientResponse'];
export type ProductionStepDTO = components['schemas']['ProductionStepResponse'];
// Request types
export type CreateRecipeRequest = components['schemas']['CreateRecipeRequest'];
export type AddRecipeIngredientRequest = components['schemas']['AddRecipeIngredientRequest'];
export type AddProductionStepRequest = components['schemas']['AddProductionStepRequest'];