File size: 1,074 Bytes
d491754
b7f0477
 
 
 
 
 
eb78df6
 
 
 
 
 
 
b7f0477
 
 
 
 
 
eb78df6
 
 
 
 
 
 
 
 
b7f0477
 
 
 
 
 
d491754
 
 
 
 
 
 
 
eb78df6
 
 
b7f0477
 
 
86f4808
eb78df6
86f4808
b7f0477
 
 
eb78df6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b7f0477
 
 
eb78df6
b7f0477
d491754
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
import { Expose, Transform } from "class-transformer";
import { serialize } from "@helpers/serialize";



class Days {
  @Expose()
  day_number: number;

  @Expose()
  total_number_exercises: number;

  @Expose()
  day_type: string;

  @Expose({ name: "exercises" })
  exercises: any;
}

class TemplateWeeks {
  @Expose()
  week_number: number;

  @Expose()
  week_name: string;

  @Expose()
  week_description: string;

  @Expose({ name: "days" })
  @Transform(
    ({ value }) => serialize(value, Days)
  )
  days: any;
}

export class WorkoutSerialization {
  @Expose({ name: "_id" })
  id: string;

  @Expose()
  name: string;

  @Expose()
  description: string;

  @Expose()
  type: string;

  @Expose()
  image: string;

  @Expose()
  created_by: string;

  @Expose()
  fitness_level: string;

  @Expose()
  fitness_goal: string;

  @Expose()
  place: any;

  @Expose()
  min_per_day: number;

  @Expose()
  total_number_days: number;

  @Expose({ name: "template_weeks" })
  @Transform(
    ({ value }) => serialize(value, TemplateWeeks)
  )
  template_weeks: any;

}