Skip to content

Commit

Permalink
feat(1.1b): Add Types
Browse files Browse the repository at this point in the history
The data model for users, recipes and categories
  • Loading branch information
one-aalam committed Jul 12, 2021
1 parent 4135b1a commit a821513
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export type User = {
id: number
firstName: string
lastName: string
email: string
avatar: string
}

export type Recipe = {
id: number
name: string
desc?: string
imageUrl?: string

courseId: number // we could've modelled this
cuisineId: number // and this better, but this designed to support the referential access model popular relatonal DB's use

serves: number
prepTime?: number
cookingTime: number

ingredients: string[]
directions: string[]

source?: string
tags?: string[]
}

export type RecipeCatgeory = {
id: number
type: string
name?: string
desc?: string
}

export type RecipeCatgeoryItem = {
id: number
categoryId: number
name?: string
desc?: string
}

0 comments on commit a821513

Please sign in to comment.