Spaces:
Running
Running
Hozifa Elgharbawy
refactor: Update serializers for meal plans and user-registered meal plans
66780ff
import { Expose, Transform } from "class-transformer"; | |
import { serialize } from "@helpers/serialize"; | |
import { MealSerialization } from './meal.serialization'; | |
import { SwaggerResponseProperty } from "@lib/decorators/swagger-response-property.decorator"; | |
class MealPlanDaysPopulate { | |
() | |
type: "string" }) | ({|
title: string; | |
name: "meals" }) | ({|
type: MealSerialization }) | ({|
meals: any; | |
} | |
class MealPlanKeyFeaturesPopulate { | |
() | |
type: "string" }) | ({|
title: string; | |
name: "description" }) | ({|
type: "string" }) | ({|
description: any; | |
} | |
export class MealPlanPopulateSerialization { | |
name: "_id" }) | ({|
type: "string" }) | ({|
id: string; | |
() | |
type: "string" }) | ({|
image: string; | |
() | |
type: "string" }) | ({|
description: string; | |
() | |
type: "string" }) | ({|
duration: string; | |
() | |
type: "string" }) | ({|
level: string; | |
() | |
type: "string" }) | ({|
your_journey: string; | |
name: "key_features" }) | ({|
type: [MealPlanKeyFeaturesPopulate] }) | ({|
( | |
({ value }) => serialize(value, MealPlanKeyFeaturesPopulate) | |
) | |
key_features: any; | |
name: "days" }) | ({|
type: [MealPlanDaysPopulate] }) | ({|
( | |
({ value }) => serialize(value, MealPlanDaysPopulate) | |
) | |
days: any; | |
} | |
export class ListMealPlanSerialization { | |
name: "_id" }) | ({|
type: "string" }) | ({|
id: string; | |
() | |
type: "string" }) | ({|
image: string; | |
() | |
type: "string" }) | ({|
description: string; | |
() | |
type: "string" }) | ({|
duration: string; | |
() | |
type: "string" }) | ({|
level: string; | |
() | |
type: "string" }) | ({|
your_journey: string; | |
name: "key_features" }) | ({|
type: [MealPlanKeyFeaturesPopulate] }) | ({|
( | |
({ value }) => serialize(value, MealPlanKeyFeaturesPopulate) | |
) | |
key_features: any; | |
} | |
export class MSerialization { | |
name: "_id" }) | ({|
type: "string" }) | ({|
id: string; | |
() | |
type: "string" }) | ({|
image: string; | |
} |