refactor(planner): import shared types in reasoningTags instead of re-declaring
Removes local TagItem, Recipe, SlotRecipe, Slot, SlotMap definitions and imports Recipe, Slot, SlotMap from types.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,36 +1,11 @@
|
|||||||
|
import type { Recipe, Slot, SlotMap } from '$lib/planner/types';
|
||||||
|
|
||||||
export interface ReasoningTag {
|
export interface ReasoningTag {
|
||||||
id: 'neues-protein' | 'aufwand-leicht';
|
id: 'neues-protein' | 'aufwand-leicht';
|
||||||
label: string;
|
label: string;
|
||||||
color: 'green' | 'yellow';
|
color: 'green' | 'yellow';
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TagItem {
|
|
||||||
id?: string;
|
|
||||||
name?: string;
|
|
||||||
tagType?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Recipe {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
cookTimeMin?: number;
|
|
||||||
effort?: string;
|
|
||||||
tags?: TagItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SlotRecipe {
|
|
||||||
id?: string;
|
|
||||||
tags?: TagItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Slot {
|
|
||||||
id?: string;
|
|
||||||
slotDate?: string;
|
|
||||||
recipe?: SlotRecipe | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
type SlotMap = Record<string, Slot>;
|
|
||||||
|
|
||||||
export function computeReasoningTags(slotMap: SlotMap, recipe: Recipe): ReasoningTag[] {
|
export function computeReasoningTags(slotMap: SlotMap, recipe: Recipe): ReasoningTag[] {
|
||||||
const tags: ReasoningTag[] = [];
|
const tags: ReasoningTag[] = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user