Feature 12: Regular dinners and onboarding (#94)
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
This commit was merged in pull request #94.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
// DinnerBody is a dinner as the dinners API sends it.
|
||||
export type DinnerBody = {
|
||||
id: string
|
||||
name: string
|
||||
status: string
|
||||
origin: string
|
||||
method: string | null
|
||||
minutes_total: number | null
|
||||
difficulty: string | null
|
||||
cuisine: string | null
|
||||
is_favorite: boolean
|
||||
recipe_id: string | null
|
||||
photo_url: string | null
|
||||
grounding_status: string
|
||||
grounding_error: string | null
|
||||
updated_by: string | null
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
// dinnerBody is a Regular as the server sends it: grounded with no photo,
|
||||
// method or minutes unless overrides set them.
|
||||
export function dinnerBody(id: string, name: string, overrides: Partial<DinnerBody> = {}): DinnerBody {
|
||||
return {
|
||||
id,
|
||||
name,
|
||||
status: 'regular',
|
||||
origin: 'regular',
|
||||
method: null,
|
||||
minutes_total: null,
|
||||
difficulty: null,
|
||||
cuisine: null,
|
||||
is_favorite: false,
|
||||
recipe_id: null,
|
||||
photo_url: null,
|
||||
grounding_status: 'grounded',
|
||||
grounding_error: null,
|
||||
updated_by: null,
|
||||
created_at: '2026-10-01T15:00:00.000Z',
|
||||
updated_at: '2026-10-01T15:00:00.000Z',
|
||||
...overrides,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user