Spaces:
Running
Running
Hozifa Elgharbawy
refactor: Add image property to meal serialization and populate serialization
b561958
| import { Expose, Transform } from "class-transformer"; | |
| import { SwaggerResponseProperty } from "@lib/decorators/swagger-response-property.decorator"; | |
| import { IngredientSerialization } from "./ingredient.serialization"; | |
| import { serialize } from "@helpers/serialize"; | |
| export class MealPopulateSerialization { | |
| ({ name: "_id" }) | |
| ({ type: "string" }) | |
| id: string; | |
| () | |
| ({ type: "string" }) | |
| name: string; | |
| () | |
| ({ type: "string" }) | |
| created_at: Date; | |
| () | |
| ({ type: "string" }) | |
| image: string; | |
| () | |
| ({ type: [IngredientSerialization] }) | |
| ( | |
| ({ value }) => serialize(value, IngredientSerialization) | |
| ) | |
| ingredients: any; | |
| () | |
| ({ type: "number" }) | |
| calories: number; | |
| () | |
| ({ type: "number" }) | |
| carbs: number; | |
| () | |
| ({ type: "number" }) | |
| proteins: number; | |
| () | |
| ({ type: "number" }) | |
| fats: number; | |
| () | |
| ({ type: "string" }) | |
| type: string; | |
| } |