refactor(schema): invert relationship between items and recipes

Move item_id to recipes table and drop recipe_id from items
Update backend queries and admin UI to reflect the new domain model
This commit is contained in:
2026-04-30 09:50:11 +08:00
parent be6902333d
commit b94450d3ba
4 changed files with 90 additions and 59 deletions

View File

@@ -71,6 +71,7 @@ export interface Recipe {
export interface RecipeDetail extends Recipe {
acquisition_methods: NamedEntity[];
item: NamedEntity;
}
export interface Options {
@@ -105,7 +106,6 @@ export interface ItemPayload {
name: string;
categoryId: number;
usageId: number | null;
recipeId: number | null;
dyeable: boolean;
dualDyeable: boolean;
patternEditable: boolean;
@@ -114,7 +114,7 @@ export interface ItemPayload {
}
export interface RecipePayload {
name: string;
itemId: number;
acquisitionMethodIds: number[];
materials: Array<{ itemId: number; quantity: number }>;
}