Skip to content

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

Sugar Daddy 🍭 (DTOs)

Sweet

A Sweet object represents the data that is sent to the server when creating or updating a sweet.

export interface Sweet {
  name: string
  price: number
  description: string
  ingredients: Ingredient[]
}

Ingredient

An Ingredient object represents the data that is sent to the server when creating or updating an ingredient.

export interface Ingredient {
  name: string
  quantity: number
  unit: string
}

SweetResponse

A SweetResponse object is a view of a Sweet object that can be returned to client, it can contains additional information like the id of the object, the timestamp of the creation and update.

export interface SweetResponse extends Omit<Sweet, 'ingredients'>, Document {
  ingredients: IngredientResponse[]
}

IngredientResponse

An IngredientResponse object is a view of an Ingredient object that can be returned to client, it can contains additional information like the id of the object, the timestamp of the creation and update.

export interface IngredientResponse extends Ingredient, Document {}

Document

Mongo document

{
    _id: string
    createdAt: string
    updatedAt: string
    ...
}

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages