Spaces:
Sleeping
Sleeping
File size: 2,332 Bytes
339fa48 cbdd38a 339fa48 d836ad1 339fa48 f402448 339fa48 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
import { Expose, Transform } from "class-transformer";
import { serialize } from "@helpers/serialize";
import { EquipmentSerialization } from "./muscle.serialization";
import { MuscleSerialization } from "./equipment.serialization";
import { SwaggerResponseProperty } from "@lib/decorators/swagger-response-property.decorator";
class ExpectedDurationRangePopulate {
@Expose()
@SwaggerResponseProperty({ type: "number" })
min: number;
@Expose()
@SwaggerResponseProperty({ type: "number" })
max: number;
}
class MediaPopulate {
@Expose()
@SwaggerResponseProperty({ type: "string" })
type: string;
@Expose()
@SwaggerResponseProperty({ type: "string" })
url: string;
}
class TargetMusclesPopulate {
@Expose()
@SwaggerResponseProperty({ type: MuscleSerialization })
primary: string;
@Expose()
@SwaggerResponseProperty({ type: MuscleSerialization })
secondary: string;
}
export class ExercisePopulateSerialization {
@Expose({ name: "_id" })
@SwaggerResponseProperty({ type: "string" })
id: string;
@Expose()
@SwaggerResponseProperty({ type: "string" })
name: string;
@Expose()
@SwaggerResponseProperty({ type: "string" })
category: string;
@Expose()
@SwaggerResponseProperty({ type: "string" })
exerciseType: string;
@Expose()
@SwaggerResponseProperty({ type: "number" })
duration: number | null;
@Expose({ name: "expectedDurationRange" })
@SwaggerResponseProperty({ type: ExpectedDurationRangePopulate })
@Transform(({ value }) => serialize(value, ExpectedDurationRangePopulate))
expectedDurationRange: object;
@Expose()
@SwaggerResponseProperty({ type: "number" })
reps: number;
@Expose()
@SwaggerResponseProperty({ type: "number" })
sets: number;
@Expose()
@SwaggerResponseProperty({ type: "string" })
instructions: string;
@Expose()
@SwaggerResponseProperty({ type: "string" })
benefits: string;
@Expose()
@SwaggerResponseProperty({ type: TargetMusclesPopulate })
targetMuscles: any;
@Expose()
@SwaggerResponseProperty({ type: [EquipmentSerialization] })
equipments: any;
@Expose()
@SwaggerResponseProperty('string')
coverImage: string;
@Expose({ name: "media" })
@SwaggerResponseProperty({ type: MediaPopulate })
@Transform(({ value }) => serialize(value, MediaPopulate))
media: object;
}
|