Browse Source

some changes...

Tomi Cvetic 5 years ago
parent
commit
f3ae4f4e13

File diff suppressed because it is too large
+ 673 - 224
backend/database/generated/prisma-client/index.d.ts


+ 5 - 1
backend/database/generated/prisma-client/index.js

@@ -33,7 +33,11 @@ var models = [
     embedded: false
   },
   {
-    name: "Excersise",
+    name: "Exercise",
+    embedded: false
+  },
+  {
+    name: "BaseExercise",
     embedded: false
   },
   {

+ 349 - 85
backend/database/generated/prisma-client/prisma-schema.js

@@ -3,7 +3,11 @@ module.exports = {
   // Please don't change this file manually but run `prisma generate` to update it.
   // For more information, please read the docs: https://www.prisma.io/docs/prisma-client/
 
-/* GraphQL */ `type AggregateBlock {
+/* GraphQL */ `type AggregateBaseExercise {
+  count: Int!
+}
+
+type AggregateBlock {
   count: Int!
 }
 
@@ -11,7 +15,7 @@ type AggregateComment {
   count: Int!
 }
 
-type AggregateExcersise {
+type AggregateExercise {
   count: Int!
 }
 
@@ -39,6 +43,135 @@ type AggregateUser {
   count: Int!
 }
 
+type BaseExercise {
+  id: ID!
+  name: String!
+  variations(where: ExerciseWhereInput, orderBy: ExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Exercise!]
+}
+
+type BaseExerciseConnection {
+  pageInfo: PageInfo!
+  edges: [BaseExerciseEdge]!
+  aggregate: AggregateBaseExercise!
+}
+
+input BaseExerciseCreateInput {
+  id: ID
+  name: String!
+  variations: ExerciseCreateManyWithoutBaseExerciseInput
+}
+
+input BaseExerciseCreateOneWithoutVariationsInput {
+  create: BaseExerciseCreateWithoutVariationsInput
+  connect: BaseExerciseWhereUniqueInput
+}
+
+input BaseExerciseCreateWithoutVariationsInput {
+  id: ID
+  name: String!
+}
+
+type BaseExerciseEdge {
+  node: BaseExercise!
+  cursor: String!
+}
+
+enum BaseExerciseOrderByInput {
+  id_ASC
+  id_DESC
+  name_ASC
+  name_DESC
+}
+
+type BaseExercisePreviousValues {
+  id: ID!
+  name: String!
+}
+
+type BaseExerciseSubscriptionPayload {
+  mutation: MutationType!
+  node: BaseExercise
+  updatedFields: [String!]
+  previousValues: BaseExercisePreviousValues
+}
+
+input BaseExerciseSubscriptionWhereInput {
+  mutation_in: [MutationType!]
+  updatedFields_contains: String
+  updatedFields_contains_every: [String!]
+  updatedFields_contains_some: [String!]
+  node: BaseExerciseWhereInput
+  AND: [BaseExerciseSubscriptionWhereInput!]
+  OR: [BaseExerciseSubscriptionWhereInput!]
+  NOT: [BaseExerciseSubscriptionWhereInput!]
+}
+
+input BaseExerciseUpdateInput {
+  name: String
+  variations: ExerciseUpdateManyWithoutBaseExerciseInput
+}
+
+input BaseExerciseUpdateManyMutationInput {
+  name: String
+}
+
+input BaseExerciseUpdateOneRequiredWithoutVariationsInput {
+  create: BaseExerciseCreateWithoutVariationsInput
+  update: BaseExerciseUpdateWithoutVariationsDataInput
+  upsert: BaseExerciseUpsertWithoutVariationsInput
+  connect: BaseExerciseWhereUniqueInput
+}
+
+input BaseExerciseUpdateWithoutVariationsDataInput {
+  name: String
+}
+
+input BaseExerciseUpsertWithoutVariationsInput {
+  update: BaseExerciseUpdateWithoutVariationsDataInput!
+  create: BaseExerciseCreateWithoutVariationsInput!
+}
+
+input BaseExerciseWhereInput {
+  id: ID
+  id_not: ID
+  id_in: [ID!]
+  id_not_in: [ID!]
+  id_lt: ID
+  id_lte: ID
+  id_gt: ID
+  id_gte: ID
+  id_contains: ID
+  id_not_contains: ID
+  id_starts_with: ID
+  id_not_starts_with: ID
+  id_ends_with: ID
+  id_not_ends_with: ID
+  name: String
+  name_not: String
+  name_in: [String!]
+  name_not_in: [String!]
+  name_lt: String
+  name_lte: String
+  name_gt: String
+  name_gte: String
+  name_contains: String
+  name_not_contains: String
+  name_starts_with: String
+  name_not_starts_with: String
+  name_ends_with: String
+  name_not_ends_with: String
+  variations_every: ExerciseWhereInput
+  variations_some: ExerciseWhereInput
+  variations_none: ExerciseWhereInput
+  AND: [BaseExerciseWhereInput!]
+  OR: [BaseExerciseWhereInput!]
+  NOT: [BaseExerciseWhereInput!]
+}
+
+input BaseExerciseWhereUniqueInput {
+  id: ID
+}
+
 type BatchPayload {
   count: Long!
 }
@@ -51,7 +184,8 @@ type Block {
   variation: String
   format: Format
   tracks(where: TrackWhereInput, orderBy: TrackOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Track!]
-  excersises(where: ExcersiseWhereInput, orderBy: ExcersiseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Excersise!]
+  exercises(where: ExerciseWhereInput, orderBy: ExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Exercise!]
+  description: String!
 }
 
 type BlockConnection {
@@ -68,7 +202,8 @@ input BlockCreateInput {
   variation: String
   format: FormatCreateOneInput
   tracks: TrackCreateManyInput
-  excersises: ExcersiseCreateManyInput
+  exercises: ExerciseCreateManyInput
+  description: String!
 }
 
 input BlockCreateManyInput {
@@ -92,6 +227,8 @@ enum BlockOrderByInput {
   duration_DESC
   variation_ASC
   variation_DESC
+  description_ASC
+  description_DESC
 }
 
 type BlockPreviousValues {
@@ -100,6 +237,7 @@ type BlockPreviousValues {
   title: String!
   duration: Int!
   variation: String
+  description: String!
 }
 
 input BlockScalarWhereInput {
@@ -161,6 +299,20 @@ input BlockScalarWhereInput {
   variation_not_starts_with: String
   variation_ends_with: String
   variation_not_ends_with: String
+  description: String
+  description_not: String
+  description_in: [String!]
+  description_not_in: [String!]
+  description_lt: String
+  description_lte: String
+  description_gt: String
+  description_gte: String
+  description_contains: String
+  description_not_contains: String
+  description_starts_with: String
+  description_not_starts_with: String
+  description_ends_with: String
+  description_not_ends_with: String
   AND: [BlockScalarWhereInput!]
   OR: [BlockScalarWhereInput!]
   NOT: [BlockScalarWhereInput!]
@@ -191,7 +343,8 @@ input BlockUpdateDataInput {
   variation: String
   format: FormatUpdateOneInput
   tracks: TrackUpdateManyInput
-  excersises: ExcersiseUpdateManyInput
+  exercises: ExerciseUpdateManyInput
+  description: String
 }
 
 input BlockUpdateInput {
@@ -201,7 +354,8 @@ input BlockUpdateInput {
   variation: String
   format: FormatUpdateOneInput
   tracks: TrackUpdateManyInput
-  excersises: ExcersiseUpdateManyInput
+  exercises: ExerciseUpdateManyInput
+  description: String
 }
 
 input BlockUpdateManyDataInput {
@@ -209,6 +363,7 @@ input BlockUpdateManyDataInput {
   title: String
   duration: Int
   variation: String
+  description: String
 }
 
 input BlockUpdateManyInput {
@@ -228,6 +383,7 @@ input BlockUpdateManyMutationInput {
   title: String
   duration: Int
   variation: String
+  description: String
 }
 
 input BlockUpdateManyWithWhereNestedInput {
@@ -309,9 +465,23 @@ input BlockWhereInput {
   tracks_every: TrackWhereInput
   tracks_some: TrackWhereInput
   tracks_none: TrackWhereInput
-  excersises_every: ExcersiseWhereInput
-  excersises_some: ExcersiseWhereInput
-  excersises_none: ExcersiseWhereInput
+  exercises_every: ExerciseWhereInput
+  exercises_some: ExerciseWhereInput
+  exercises_none: ExerciseWhereInput
+  description: String
+  description_not: String
+  description_in: [String!]
+  description_not_in: [String!]
+  description_lt: String
+  description_lte: String
+  description_gt: String
+  description_gte: String
+  description_contains: String
+  description_not_contains: String
+  description_starts_with: String
+  description_not_starts_with: String
+  description_ends_with: String
+  description_not_ends_with: String
   AND: [BlockWhereInput!]
   OR: [BlockWhereInput!]
   NOT: [BlockWhereInput!]
@@ -524,43 +694,58 @@ input CommentWhereUniqueInput {
 
 scalar DateTime
 
-type Excersise {
+type Exercise {
   id: ID!
   name: String!
   description: String!
   video: String!
   targets: [String!]!
+  baseExercise: BaseExercise!
 }
 
-type ExcersiseConnection {
+type ExerciseConnection {
   pageInfo: PageInfo!
-  edges: [ExcersiseEdge]!
-  aggregate: AggregateExcersise!
+  edges: [ExerciseEdge]!
+  aggregate: AggregateExercise!
 }
 
-input ExcersiseCreateInput {
+input ExerciseCreateInput {
   id: ID
   name: String!
   description: String!
   video: String!
-  targets: ExcersiseCreatetargetsInput
+  targets: ExerciseCreatetargetsInput
+  baseExercise: BaseExerciseCreateOneWithoutVariationsInput!
+}
+
+input ExerciseCreateManyInput {
+  create: [ExerciseCreateInput!]
+  connect: [ExerciseWhereUniqueInput!]
 }
 
-input ExcersiseCreateManyInput {
-  create: [ExcersiseCreateInput!]
-  connect: [ExcersiseWhereUniqueInput!]
+input ExerciseCreateManyWithoutBaseExerciseInput {
+  create: [ExerciseCreateWithoutBaseExerciseInput!]
+  connect: [ExerciseWhereUniqueInput!]
 }
 
-input ExcersiseCreatetargetsInput {
+input ExerciseCreatetargetsInput {
   set: [String!]
 }
 
-type ExcersiseEdge {
-  node: Excersise!
+input ExerciseCreateWithoutBaseExerciseInput {
+  id: ID
+  name: String!
+  description: String!
+  video: String!
+  targets: ExerciseCreatetargetsInput
+}
+
+type ExerciseEdge {
+  node: Exercise!
   cursor: String!
 }
 
-enum ExcersiseOrderByInput {
+enum ExerciseOrderByInput {
   id_ASC
   id_DESC
   name_ASC
@@ -571,7 +756,7 @@ enum ExcersiseOrderByInput {
   video_DESC
 }
 
-type ExcersisePreviousValues {
+type ExercisePreviousValues {
   id: ID!
   name: String!
   description: String!
@@ -579,7 +764,7 @@ type ExcersisePreviousValues {
   targets: [String!]!
 }
 
-input ExcersiseScalarWhereInput {
+input ExerciseScalarWhereInput {
   id: ID
   id_not: ID
   id_in: [ID!]
@@ -636,90 +821,122 @@ input ExcersiseScalarWhereInput {
   video_not_starts_with: String
   video_ends_with: String
   video_not_ends_with: String
-  AND: [ExcersiseScalarWhereInput!]
-  OR: [ExcersiseScalarWhereInput!]
-  NOT: [ExcersiseScalarWhereInput!]
+  AND: [ExerciseScalarWhereInput!]
+  OR: [ExerciseScalarWhereInput!]
+  NOT: [ExerciseScalarWhereInput!]
 }
 
-type ExcersiseSubscriptionPayload {
+type ExerciseSubscriptionPayload {
   mutation: MutationType!
-  node: Excersise
+  node: Exercise
   updatedFields: [String!]
-  previousValues: ExcersisePreviousValues
+  previousValues: ExercisePreviousValues
 }
 
-input ExcersiseSubscriptionWhereInput {
+input ExerciseSubscriptionWhereInput {
   mutation_in: [MutationType!]
   updatedFields_contains: String
   updatedFields_contains_every: [String!]
   updatedFields_contains_some: [String!]
-  node: ExcersiseWhereInput
-  AND: [ExcersiseSubscriptionWhereInput!]
-  OR: [ExcersiseSubscriptionWhereInput!]
-  NOT: [ExcersiseSubscriptionWhereInput!]
+  node: ExerciseWhereInput
+  AND: [ExerciseSubscriptionWhereInput!]
+  OR: [ExerciseSubscriptionWhereInput!]
+  NOT: [ExerciseSubscriptionWhereInput!]
 }
 
-input ExcersiseUpdateDataInput {
+input ExerciseUpdateDataInput {
   name: String
   description: String
   video: String
-  targets: ExcersiseUpdatetargetsInput
+  targets: ExerciseUpdatetargetsInput
+  baseExercise: BaseExerciseUpdateOneRequiredWithoutVariationsInput
 }
 
-input ExcersiseUpdateInput {
+input ExerciseUpdateInput {
   name: String
   description: String
   video: String
-  targets: ExcersiseUpdatetargetsInput
+  targets: ExerciseUpdatetargetsInput
+  baseExercise: BaseExerciseUpdateOneRequiredWithoutVariationsInput
 }
 
-input ExcersiseUpdateManyDataInput {
+input ExerciseUpdateManyDataInput {
   name: String
   description: String
   video: String
-  targets: ExcersiseUpdatetargetsInput
+  targets: ExerciseUpdatetargetsInput
 }
 
-input ExcersiseUpdateManyInput {
-  create: [ExcersiseCreateInput!]
-  update: [ExcersiseUpdateWithWhereUniqueNestedInput!]
-  upsert: [ExcersiseUpsertWithWhereUniqueNestedInput!]
-  delete: [ExcersiseWhereUniqueInput!]
-  connect: [ExcersiseWhereUniqueInput!]
-  set: [ExcersiseWhereUniqueInput!]
-  disconnect: [ExcersiseWhereUniqueInput!]
-  deleteMany: [ExcersiseScalarWhereInput!]
-  updateMany: [ExcersiseUpdateManyWithWhereNestedInput!]
+input ExerciseUpdateManyInput {
+  create: [ExerciseCreateInput!]
+  update: [ExerciseUpdateWithWhereUniqueNestedInput!]
+  upsert: [ExerciseUpsertWithWhereUniqueNestedInput!]
+  delete: [ExerciseWhereUniqueInput!]
+  connect: [ExerciseWhereUniqueInput!]
+  set: [ExerciseWhereUniqueInput!]
+  disconnect: [ExerciseWhereUniqueInput!]
+  deleteMany: [ExerciseScalarWhereInput!]
+  updateMany: [ExerciseUpdateManyWithWhereNestedInput!]
 }
 
-input ExcersiseUpdateManyMutationInput {
+input ExerciseUpdateManyMutationInput {
   name: String
   description: String
   video: String
-  targets: ExcersiseUpdatetargetsInput
+  targets: ExerciseUpdatetargetsInput
+}
+
+input ExerciseUpdateManyWithoutBaseExerciseInput {
+  create: [ExerciseCreateWithoutBaseExerciseInput!]
+  delete: [ExerciseWhereUniqueInput!]
+  connect: [ExerciseWhereUniqueInput!]
+  set: [ExerciseWhereUniqueInput!]
+  disconnect: [ExerciseWhereUniqueInput!]
+  update: [ExerciseUpdateWithWhereUniqueWithoutBaseExerciseInput!]
+  upsert: [ExerciseUpsertWithWhereUniqueWithoutBaseExerciseInput!]
+  deleteMany: [ExerciseScalarWhereInput!]
+  updateMany: [ExerciseUpdateManyWithWhereNestedInput!]
 }
 
-input ExcersiseUpdateManyWithWhereNestedInput {
-  where: ExcersiseScalarWhereInput!
-  data: ExcersiseUpdateManyDataInput!
+input ExerciseUpdateManyWithWhereNestedInput {
+  where: ExerciseScalarWhereInput!
+  data: ExerciseUpdateManyDataInput!
 }
 
-input ExcersiseUpdatetargetsInput {
+input ExerciseUpdatetargetsInput {
   set: [String!]
 }
 
-input ExcersiseUpdateWithWhereUniqueNestedInput {
-  where: ExcersiseWhereUniqueInput!
-  data: ExcersiseUpdateDataInput!
+input ExerciseUpdateWithoutBaseExerciseDataInput {
+  name: String
+  description: String
+  video: String
+  targets: ExerciseUpdatetargetsInput
+}
+
+input ExerciseUpdateWithWhereUniqueNestedInput {
+  where: ExerciseWhereUniqueInput!
+  data: ExerciseUpdateDataInput!
+}
+
+input ExerciseUpdateWithWhereUniqueWithoutBaseExerciseInput {
+  where: ExerciseWhereUniqueInput!
+  data: ExerciseUpdateWithoutBaseExerciseDataInput!
+}
+
+input ExerciseUpsertWithWhereUniqueNestedInput {
+  where: ExerciseWhereUniqueInput!
+  update: ExerciseUpdateDataInput!
+  create: ExerciseCreateInput!
 }
 
-input ExcersiseUpsertWithWhereUniqueNestedInput {
-  where: ExcersiseWhereUniqueInput!
-  update: ExcersiseUpdateDataInput!
-  create: ExcersiseCreateInput!
+input ExerciseUpsertWithWhereUniqueWithoutBaseExerciseInput {
+  where: ExerciseWhereUniqueInput!
+  update: ExerciseUpdateWithoutBaseExerciseDataInput!
+  create: ExerciseCreateWithoutBaseExerciseInput!
 }
 
-input ExcersiseWhereInput {
+input ExerciseWhereInput {
   id: ID
   id_not: ID
   id_in: [ID!]
@@ -776,12 +993,13 @@ input ExcersiseWhereInput {
   video_not_starts_with: String
   video_ends_with: String
   video_not_ends_with: String
-  AND: [ExcersiseWhereInput!]
-  OR: [ExcersiseWhereInput!]
-  NOT: [ExcersiseWhereInput!]
+  baseExercise: BaseExerciseWhereInput
+  AND: [ExerciseWhereInput!]
+  OR: [ExerciseWhereInput!]
+  NOT: [ExerciseWhereInput!]
 }
 
-input ExcersiseWhereUniqueInput {
+input ExerciseWhereUniqueInput {
   id: ID
 }
 
@@ -930,6 +1148,12 @@ input FormatWhereUniqueInput {
 scalar Long
 
 type Mutation {
+  createBaseExercise(data: BaseExerciseCreateInput!): BaseExercise!
+  updateBaseExercise(data: BaseExerciseUpdateInput!, where: BaseExerciseWhereUniqueInput!): BaseExercise
+  updateManyBaseExercises(data: BaseExerciseUpdateManyMutationInput!, where: BaseExerciseWhereInput): BatchPayload!
+  upsertBaseExercise(where: BaseExerciseWhereUniqueInput!, create: BaseExerciseCreateInput!, update: BaseExerciseUpdateInput!): BaseExercise!
+  deleteBaseExercise(where: BaseExerciseWhereUniqueInput!): BaseExercise
+  deleteManyBaseExercises(where: BaseExerciseWhereInput): BatchPayload!
   createBlock(data: BlockCreateInput!): Block!
   updateBlock(data: BlockUpdateInput!, where: BlockWhereUniqueInput!): Block
   updateManyBlocks(data: BlockUpdateManyMutationInput!, where: BlockWhereInput): BatchPayload!
@@ -942,12 +1166,12 @@ type Mutation {
   upsertComment(where: CommentWhereUniqueInput!, create: CommentCreateInput!, update: CommentUpdateInput!): Comment!
   deleteComment(where: CommentWhereUniqueInput!): Comment
   deleteManyComments(where: CommentWhereInput): BatchPayload!
-  createExcersise(data: ExcersiseCreateInput!): Excersise!
-  updateExcersise(data: ExcersiseUpdateInput!, where: ExcersiseWhereUniqueInput!): Excersise
-  updateManyExcersises(data: ExcersiseUpdateManyMutationInput!, where: ExcersiseWhereInput): BatchPayload!
-  upsertExcersise(where: ExcersiseWhereUniqueInput!, create: ExcersiseCreateInput!, update: ExcersiseUpdateInput!): Excersise!
-  deleteExcersise(where: ExcersiseWhereUniqueInput!): Excersise
-  deleteManyExcersises(where: ExcersiseWhereInput): BatchPayload!
+  createExercise(data: ExerciseCreateInput!): Exercise!
+  updateExercise(data: ExerciseUpdateInput!, where: ExerciseWhereUniqueInput!): Exercise
+  updateManyExercises(data: ExerciseUpdateManyMutationInput!, where: ExerciseWhereInput): BatchPayload!
+  upsertExercise(where: ExerciseWhereUniqueInput!, create: ExerciseCreateInput!, update: ExerciseUpdateInput!): Exercise!
+  deleteExercise(where: ExerciseWhereUniqueInput!): Exercise
+  deleteManyExercises(where: ExerciseWhereInput): BatchPayload!
   createFormat(data: FormatCreateInput!): Format!
   updateFormat(data: FormatUpdateInput!, where: FormatWhereUniqueInput!): Format
   updateManyFormats(data: FormatUpdateManyMutationInput!, where: FormatWhereInput): BatchPayload!
@@ -1010,15 +1234,18 @@ enum Permission {
 }
 
 type Query {
+  baseExercise(where: BaseExerciseWhereUniqueInput!): BaseExercise
+  baseExercises(where: BaseExerciseWhereInput, orderBy: BaseExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [BaseExercise]!
+  baseExercisesConnection(where: BaseExerciseWhereInput, orderBy: BaseExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): BaseExerciseConnection!
   block(where: BlockWhereUniqueInput!): Block
   blocks(where: BlockWhereInput, orderBy: BlockOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Block]!
   blocksConnection(where: BlockWhereInput, orderBy: BlockOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): BlockConnection!
   comment(where: CommentWhereUniqueInput!): Comment
   comments(where: CommentWhereInput, orderBy: CommentOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Comment]!
   commentsConnection(where: CommentWhereInput, orderBy: CommentOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): CommentConnection!
-  excersise(where: ExcersiseWhereUniqueInput!): Excersise
-  excersises(where: ExcersiseWhereInput, orderBy: ExcersiseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Excersise]!
-  excersisesConnection(where: ExcersiseWhereInput, orderBy: ExcersiseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): ExcersiseConnection!
+  exercise(where: ExerciseWhereUniqueInput!): Exercise
+  exercises(where: ExerciseWhereInput, orderBy: ExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Exercise]!
+  exercisesConnection(where: ExerciseWhereInput, orderBy: ExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): ExerciseConnection!
   format(where: FormatWhereUniqueInput!): Format
   formats(where: FormatWhereInput, orderBy: FormatOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Format]!
   formatsConnection(where: FormatWhereInput, orderBy: FormatOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): FormatConnection!
@@ -1302,9 +1529,10 @@ input RatingWhereUniqueInput {
 }
 
 type Subscription {
+  baseExercise(where: BaseExerciseSubscriptionWhereInput): BaseExerciseSubscriptionPayload
   block(where: BlockSubscriptionWhereInput): BlockSubscriptionPayload
   comment(where: CommentSubscriptionWhereInput): CommentSubscriptionPayload
-  excersise(where: ExcersiseSubscriptionWhereInput): ExcersiseSubscriptionPayload
+  exercise(where: ExerciseSubscriptionWhereInput): ExerciseSubscriptionPayload
   format(where: FormatSubscriptionWhereInput): FormatSubscriptionPayload
   rating(where: RatingSubscriptionWhereInput): RatingSubscriptionPayload
   track(where: TrackSubscriptionWhereInput): TrackSubscriptionPayload
@@ -1591,7 +1819,9 @@ type Training {
   content(where: BlockWhereInput, orderBy: BlockOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Block!]
   createdAt: DateTime!
   trainingDate: DateTime!
-  participants(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User!]
+  location: String!
+  registration(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User!]
+  attendance: Int!
   ratings(where: RatingWhereInput, orderBy: RatingOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Rating!]
   published: Boolean!
 }
@@ -1608,7 +1838,9 @@ input TrainingCreateInput {
   type: TrainingTypeCreateOneInput!
   content: BlockCreateManyInput
   trainingDate: DateTime!
-  participants: UserCreateManyInput
+  location: String!
+  registration: UserCreateManyInput
+  attendance: Int!
   ratings: RatingCreateManyInput
   published: Boolean!
 }
@@ -1627,6 +1859,10 @@ enum TrainingOrderByInput {
   createdAt_DESC
   trainingDate_ASC
   trainingDate_DESC
+  location_ASC
+  location_DESC
+  attendance_ASC
+  attendance_DESC
   published_ASC
   published_DESC
 }
@@ -1636,6 +1872,8 @@ type TrainingPreviousValues {
   title: String!
   createdAt: DateTime!
   trainingDate: DateTime!
+  location: String!
+  attendance: Int!
   published: Boolean!
 }
 
@@ -1802,7 +2040,9 @@ input TrainingUpdateInput {
   type: TrainingTypeUpdateOneRequiredInput
   content: BlockUpdateManyInput
   trainingDate: DateTime
-  participants: UserUpdateManyInput
+  location: String
+  registration: UserUpdateManyInput
+  attendance: Int
   ratings: RatingUpdateManyInput
   published: Boolean
 }
@@ -1810,6 +2050,8 @@ input TrainingUpdateInput {
 input TrainingUpdateManyMutationInput {
   title: String
   trainingDate: DateTime
+  location: String
+  attendance: Int
   published: Boolean
 }
 
@@ -1862,9 +2104,31 @@ input TrainingWhereInput {
   trainingDate_lte: DateTime
   trainingDate_gt: DateTime
   trainingDate_gte: DateTime
-  participants_every: UserWhereInput
-  participants_some: UserWhereInput
-  participants_none: UserWhereInput
+  location: String
+  location_not: String
+  location_in: [String!]
+  location_not_in: [String!]
+  location_lt: String
+  location_lte: String
+  location_gt: String
+  location_gte: String
+  location_contains: String
+  location_not_contains: String
+  location_starts_with: String
+  location_not_starts_with: String
+  location_ends_with: String
+  location_not_ends_with: String
+  registration_every: UserWhereInput
+  registration_some: UserWhereInput
+  registration_none: UserWhereInput
+  attendance: Int
+  attendance_not: Int
+  attendance_in: [Int!]
+  attendance_not_in: [Int!]
+  attendance_lt: Int
+  attendance_lte: Int
+  attendance_gt: Int
+  attendance_gte: Int
   ratings_every: RatingWhereInput
   ratings_some: RatingWhereInput
   ratings_none: RatingWhereInput

+ 525 - 85
backend/database/generated/prisma.graphql

@@ -1,5 +1,9 @@
 # source: http://prisma:4466
-# timestamp: Thu Nov 07 2019 16:25:57 GMT+0000 (Coordinated Universal Time)
+# timestamp: Tue Nov 12 2019 13:41:15 GMT+0000 (Coordinated Universal Time)
+
+type AggregateBaseExercise {
+  count: Int!
+}
 
 type AggregateBlock {
   count: Int!
@@ -9,7 +13,7 @@ type AggregateComment {
   count: Int!
 }
 
-type AggregateExcersise {
+type AggregateExercise {
   count: Int!
 }
 
@@ -37,6 +41,219 @@ type AggregateUser {
   count: Int!
 }
 
+type BaseExercise implements Node {
+  id: ID!
+  name: String!
+  variations(where: ExerciseWhereInput, orderBy: ExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Exercise!]
+}
+
+"""A connection to a list of items."""
+type BaseExerciseConnection {
+  """Information to aid in pagination."""
+  pageInfo: PageInfo!
+
+  """A list of edges."""
+  edges: [BaseExerciseEdge]!
+  aggregate: AggregateBaseExercise!
+}
+
+input BaseExerciseCreateInput {
+  id: ID
+  name: String!
+  variations: ExerciseCreateManyWithoutBaseExerciseInput
+}
+
+input BaseExerciseCreateOneWithoutVariationsInput {
+  create: BaseExerciseCreateWithoutVariationsInput
+  connect: BaseExerciseWhereUniqueInput
+}
+
+input BaseExerciseCreateWithoutVariationsInput {
+  id: ID
+  name: String!
+}
+
+"""An edge in a connection."""
+type BaseExerciseEdge {
+  """The item at the end of the edge."""
+  node: BaseExercise!
+
+  """A cursor for use in pagination."""
+  cursor: String!
+}
+
+enum BaseExerciseOrderByInput {
+  id_ASC
+  id_DESC
+  name_ASC
+  name_DESC
+}
+
+type BaseExercisePreviousValues {
+  id: ID!
+  name: String!
+}
+
+type BaseExerciseSubscriptionPayload {
+  mutation: MutationType!
+  node: BaseExercise
+  updatedFields: [String!]
+  previousValues: BaseExercisePreviousValues
+}
+
+input BaseExerciseSubscriptionWhereInput {
+  """Logical AND on all given filters."""
+  AND: [BaseExerciseSubscriptionWhereInput!]
+
+  """Logical OR on all given filters."""
+  OR: [BaseExerciseSubscriptionWhereInput!]
+
+  """Logical NOT on all given filters combined by AND."""
+  NOT: [BaseExerciseSubscriptionWhereInput!]
+
+  """The subscription event gets dispatched when it's listed in mutation_in"""
+  mutation_in: [MutationType!]
+
+  """
+  The subscription event gets only dispatched when one of the updated fields names is included in this list
+  """
+  updatedFields_contains: String
+
+  """
+  The subscription event gets only dispatched when all of the field names included in this list have been updated
+  """
+  updatedFields_contains_every: [String!]
+
+  """
+  The subscription event gets only dispatched when some of the field names included in this list have been updated
+  """
+  updatedFields_contains_some: [String!]
+  node: BaseExerciseWhereInput
+}
+
+input BaseExerciseUpdateInput {
+  name: String
+  variations: ExerciseUpdateManyWithoutBaseExerciseInput
+}
+
+input BaseExerciseUpdateManyMutationInput {
+  name: String
+}
+
+input BaseExerciseUpdateOneRequiredWithoutVariationsInput {
+  create: BaseExerciseCreateWithoutVariationsInput
+  connect: BaseExerciseWhereUniqueInput
+  update: BaseExerciseUpdateWithoutVariationsDataInput
+  upsert: BaseExerciseUpsertWithoutVariationsInput
+}
+
+input BaseExerciseUpdateWithoutVariationsDataInput {
+  name: String
+}
+
+input BaseExerciseUpsertWithoutVariationsInput {
+  update: BaseExerciseUpdateWithoutVariationsDataInput!
+  create: BaseExerciseCreateWithoutVariationsInput!
+}
+
+input BaseExerciseWhereInput {
+  """Logical AND on all given filters."""
+  AND: [BaseExerciseWhereInput!]
+
+  """Logical OR on all given filters."""
+  OR: [BaseExerciseWhereInput!]
+
+  """Logical NOT on all given filters combined by AND."""
+  NOT: [BaseExerciseWhereInput!]
+  id: ID
+
+  """All values that are not equal to given value."""
+  id_not: ID
+
+  """All values that are contained in given list."""
+  id_in: [ID!]
+
+  """All values that are not contained in given list."""
+  id_not_in: [ID!]
+
+  """All values less than the given value."""
+  id_lt: ID
+
+  """All values less than or equal the given value."""
+  id_lte: ID
+
+  """All values greater than the given value."""
+  id_gt: ID
+
+  """All values greater than or equal the given value."""
+  id_gte: ID
+
+  """All values containing the given string."""
+  id_contains: ID
+
+  """All values not containing the given string."""
+  id_not_contains: ID
+
+  """All values starting with the given string."""
+  id_starts_with: ID
+
+  """All values not starting with the given string."""
+  id_not_starts_with: ID
+
+  """All values ending with the given string."""
+  id_ends_with: ID
+
+  """All values not ending with the given string."""
+  id_not_ends_with: ID
+  name: String
+
+  """All values that are not equal to given value."""
+  name_not: String
+
+  """All values that are contained in given list."""
+  name_in: [String!]
+
+  """All values that are not contained in given list."""
+  name_not_in: [String!]
+
+  """All values less than the given value."""
+  name_lt: String
+
+  """All values less than or equal the given value."""
+  name_lte: String
+
+  """All values greater than the given value."""
+  name_gt: String
+
+  """All values greater than or equal the given value."""
+  name_gte: String
+
+  """All values containing the given string."""
+  name_contains: String
+
+  """All values not containing the given string."""
+  name_not_contains: String
+
+  """All values starting with the given string."""
+  name_starts_with: String
+
+  """All values not starting with the given string."""
+  name_not_starts_with: String
+
+  """All values ending with the given string."""
+  name_ends_with: String
+
+  """All values not ending with the given string."""
+  name_not_ends_with: String
+  variations_every: ExerciseWhereInput
+  variations_some: ExerciseWhereInput
+  variations_none: ExerciseWhereInput
+}
+
+input BaseExerciseWhereUniqueInput {
+  id: ID
+}
+
 type BatchPayload {
   """The number of nodes that have been affected by the Batch operation."""
   count: Long!
@@ -50,7 +267,8 @@ type Block implements Node {
   variation: String
   format: Format
   tracks(where: TrackWhereInput, orderBy: TrackOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Track!]
-  excersises(where: ExcersiseWhereInput, orderBy: ExcersiseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Excersise!]
+  exercises(where: ExerciseWhereInput, orderBy: ExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Exercise!]
+  description: String!
 }
 
 """A connection to a list of items."""
@@ -69,9 +287,10 @@ input BlockCreateInput {
   title: String!
   duration: Int!
   variation: String
+  description: String!
   format: FormatCreateOneInput
   tracks: TrackCreateManyInput
-  excersises: ExcersiseCreateManyInput
+  exercises: ExerciseCreateManyInput
 }
 
 input BlockCreateManyInput {
@@ -99,6 +318,8 @@ enum BlockOrderByInput {
   duration_DESC
   variation_ASC
   variation_DESC
+  description_ASC
+  description_DESC
 }
 
 type BlockPreviousValues {
@@ -107,6 +328,7 @@ type BlockPreviousValues {
   title: String!
   duration: Int!
   variation: String
+  description: String!
 }
 
 input BlockScalarWhereInput {
@@ -282,6 +504,46 @@ input BlockScalarWhereInput {
 
   """All values not ending with the given string."""
   variation_not_ends_with: String
+  description: String
+
+  """All values that are not equal to given value."""
+  description_not: String
+
+  """All values that are contained in given list."""
+  description_in: [String!]
+
+  """All values that are not contained in given list."""
+  description_not_in: [String!]
+
+  """All values less than the given value."""
+  description_lt: String
+
+  """All values less than or equal the given value."""
+  description_lte: String
+
+  """All values greater than the given value."""
+  description_gt: String
+
+  """All values greater than or equal the given value."""
+  description_gte: String
+
+  """All values containing the given string."""
+  description_contains: String
+
+  """All values not containing the given string."""
+  description_not_contains: String
+
+  """All values starting with the given string."""
+  description_starts_with: String
+
+  """All values not starting with the given string."""
+  description_not_starts_with: String
+
+  """All values ending with the given string."""
+  description_ends_with: String
+
+  """All values not ending with the given string."""
+  description_not_ends_with: String
 }
 
 type BlockSubscriptionPayload {
@@ -326,9 +588,10 @@ input BlockUpdateDataInput {
   title: String
   duration: Int
   variation: String
+  description: String
   format: FormatUpdateOneInput
   tracks: TrackUpdateManyInput
-  excersises: ExcersiseUpdateManyInput
+  exercises: ExerciseUpdateManyInput
 }
 
 input BlockUpdateInput {
@@ -336,9 +599,10 @@ input BlockUpdateInput {
   title: String
   duration: Int
   variation: String
+  description: String
   format: FormatUpdateOneInput
   tracks: TrackUpdateManyInput
-  excersises: ExcersiseUpdateManyInput
+  exercises: ExerciseUpdateManyInput
 }
 
 input BlockUpdateManyDataInput {
@@ -346,6 +610,7 @@ input BlockUpdateManyDataInput {
   title: String
   duration: Int
   variation: String
+  description: String
 }
 
 input BlockUpdateManyInput {
@@ -365,6 +630,7 @@ input BlockUpdateManyMutationInput {
   title: String
   duration: Int
   variation: String
+  description: String
 }
 
 input BlockUpdateManyWithWhereNestedInput {
@@ -556,13 +822,53 @@ input BlockWhereInput {
 
   """All values not ending with the given string."""
   variation_not_ends_with: String
+  description: String
+
+  """All values that are not equal to given value."""
+  description_not: String
+
+  """All values that are contained in given list."""
+  description_in: [String!]
+
+  """All values that are not contained in given list."""
+  description_not_in: [String!]
+
+  """All values less than the given value."""
+  description_lt: String
+
+  """All values less than or equal the given value."""
+  description_lte: String
+
+  """All values greater than the given value."""
+  description_gt: String
+
+  """All values greater than or equal the given value."""
+  description_gte: String
+
+  """All values containing the given string."""
+  description_contains: String
+
+  """All values not containing the given string."""
+  description_not_contains: String
+
+  """All values starting with the given string."""
+  description_starts_with: String
+
+  """All values not starting with the given string."""
+  description_not_starts_with: String
+
+  """All values ending with the given string."""
+  description_ends_with: String
+
+  """All values not ending with the given string."""
+  description_not_ends_with: String
   format: FormatWhereInput
   tracks_every: TrackWhereInput
   tracks_some: TrackWhereInput
   tracks_none: TrackWhereInput
-  excersises_every: ExcersiseWhereInput
-  excersises_some: ExcersiseWhereInput
-  excersises_none: ExcersiseWhereInput
+  exercises_every: ExerciseWhereInput
+  exercises_some: ExerciseWhereInput
+  exercises_none: ExerciseWhereInput
 }
 
 input BlockWhereUniqueInput {
@@ -941,51 +1247,66 @@ input CommentWhereUniqueInput {
 
 scalar DateTime
 
-type Excersise implements Node {
+type Exercise implements Node {
   id: ID!
   name: String!
   description: String!
   video: String!
   targets: [String!]!
+  baseExercise: BaseExercise!
 }
 
 """A connection to a list of items."""
-type ExcersiseConnection {
+type ExerciseConnection {
   """Information to aid in pagination."""
   pageInfo: PageInfo!
 
   """A list of edges."""
-  edges: [ExcersiseEdge]!
-  aggregate: AggregateExcersise!
+  edges: [ExerciseEdge]!
+  aggregate: AggregateExercise!
 }
 
-input ExcersiseCreateInput {
+input ExerciseCreateInput {
   id: ID
   name: String!
   description: String!
   video: String!
-  targets: ExcersiseCreatetargetsInput
+  targets: ExerciseCreatetargetsInput
+  baseExercise: BaseExerciseCreateOneWithoutVariationsInput!
+}
+
+input ExerciseCreateManyInput {
+  create: [ExerciseCreateInput!]
+  connect: [ExerciseWhereUniqueInput!]
 }
 
-input ExcersiseCreateManyInput {
-  create: [ExcersiseCreateInput!]
-  connect: [ExcersiseWhereUniqueInput!]
+input ExerciseCreateManyWithoutBaseExerciseInput {
+  create: [ExerciseCreateWithoutBaseExerciseInput!]
+  connect: [ExerciseWhereUniqueInput!]
 }
 
-input ExcersiseCreatetargetsInput {
+input ExerciseCreatetargetsInput {
   set: [String!]
 }
 
+input ExerciseCreateWithoutBaseExerciseInput {
+  id: ID
+  name: String!
+  description: String!
+  video: String!
+  targets: ExerciseCreatetargetsInput
+}
+
 """An edge in a connection."""
-type ExcersiseEdge {
+type ExerciseEdge {
   """The item at the end of the edge."""
-  node: Excersise!
+  node: Exercise!
 
   """A cursor for use in pagination."""
   cursor: String!
 }
 
-enum ExcersiseOrderByInput {
+enum ExerciseOrderByInput {
   id_ASC
   id_DESC
   name_ASC
@@ -996,7 +1317,7 @@ enum ExcersiseOrderByInput {
   video_DESC
 }
 
-type ExcersisePreviousValues {
+type ExercisePreviousValues {
   id: ID!
   name: String!
   description: String!
@@ -1004,15 +1325,15 @@ type ExcersisePreviousValues {
   targets: [String!]!
 }
 
-input ExcersiseScalarWhereInput {
+input ExerciseScalarWhereInput {
   """Logical AND on all given filters."""
-  AND: [ExcersiseScalarWhereInput!]
+  AND: [ExerciseScalarWhereInput!]
 
   """Logical OR on all given filters."""
-  OR: [ExcersiseScalarWhereInput!]
+  OR: [ExerciseScalarWhereInput!]
 
   """Logical NOT on all given filters combined by AND."""
-  NOT: [ExcersiseScalarWhereInput!]
+  NOT: [ExerciseScalarWhereInput!]
   id: ID
 
   """All values that are not equal to given value."""
@@ -1175,22 +1496,22 @@ input ExcersiseScalarWhereInput {
   video_not_ends_with: String
 }
 
-type ExcersiseSubscriptionPayload {
+type ExerciseSubscriptionPayload {
   mutation: MutationType!
-  node: Excersise
+  node: Exercise
   updatedFields: [String!]
-  previousValues: ExcersisePreviousValues
+  previousValues: ExercisePreviousValues
 }
 
-input ExcersiseSubscriptionWhereInput {
+input ExerciseSubscriptionWhereInput {
   """Logical AND on all given filters."""
-  AND: [ExcersiseSubscriptionWhereInput!]
+  AND: [ExerciseSubscriptionWhereInput!]
 
   """Logical OR on all given filters."""
-  OR: [ExcersiseSubscriptionWhereInput!]
+  OR: [ExerciseSubscriptionWhereInput!]
 
   """Logical NOT on all given filters combined by AND."""
-  NOT: [ExcersiseSubscriptionWhereInput!]
+  NOT: [ExerciseSubscriptionWhereInput!]
 
   """The subscription event gets dispatched when it's listed in mutation_in"""
   mutation_in: [MutationType!]
@@ -1209,78 +1530,110 @@ input ExcersiseSubscriptionWhereInput {
   The subscription event gets only dispatched when some of the field names included in this list have been updated
   """
   updatedFields_contains_some: [String!]
-  node: ExcersiseWhereInput
+  node: ExerciseWhereInput
 }
 
-input ExcersiseUpdateDataInput {
+input ExerciseUpdateDataInput {
   name: String
   description: String
   video: String
-  targets: ExcersiseUpdatetargetsInput
+  targets: ExerciseUpdatetargetsInput
+  baseExercise: BaseExerciseUpdateOneRequiredWithoutVariationsInput
 }
 
-input ExcersiseUpdateInput {
+input ExerciseUpdateInput {
   name: String
   description: String
   video: String
-  targets: ExcersiseUpdatetargetsInput
+  targets: ExerciseUpdatetargetsInput
+  baseExercise: BaseExerciseUpdateOneRequiredWithoutVariationsInput
 }
 
-input ExcersiseUpdateManyDataInput {
+input ExerciseUpdateManyDataInput {
   name: String
   description: String
   video: String
-  targets: ExcersiseUpdatetargetsInput
+  targets: ExerciseUpdatetargetsInput
 }
 
-input ExcersiseUpdateManyInput {
-  create: [ExcersiseCreateInput!]
-  connect: [ExcersiseWhereUniqueInput!]
-  set: [ExcersiseWhereUniqueInput!]
-  disconnect: [ExcersiseWhereUniqueInput!]
-  delete: [ExcersiseWhereUniqueInput!]
-  update: [ExcersiseUpdateWithWhereUniqueNestedInput!]
-  updateMany: [ExcersiseUpdateManyWithWhereNestedInput!]
-  deleteMany: [ExcersiseScalarWhereInput!]
-  upsert: [ExcersiseUpsertWithWhereUniqueNestedInput!]
+input ExerciseUpdateManyInput {
+  create: [ExerciseCreateInput!]
+  connect: [ExerciseWhereUniqueInput!]
+  set: [ExerciseWhereUniqueInput!]
+  disconnect: [ExerciseWhereUniqueInput!]
+  delete: [ExerciseWhereUniqueInput!]
+  update: [ExerciseUpdateWithWhereUniqueNestedInput!]
+  updateMany: [ExerciseUpdateManyWithWhereNestedInput!]
+  deleteMany: [ExerciseScalarWhereInput!]
+  upsert: [ExerciseUpsertWithWhereUniqueNestedInput!]
 }
 
-input ExcersiseUpdateManyMutationInput {
+input ExerciseUpdateManyMutationInput {
   name: String
   description: String
   video: String
-  targets: ExcersiseUpdatetargetsInput
+  targets: ExerciseUpdatetargetsInput
+}
+
+input ExerciseUpdateManyWithoutBaseExerciseInput {
+  create: [ExerciseCreateWithoutBaseExerciseInput!]
+  connect: [ExerciseWhereUniqueInput!]
+  set: [ExerciseWhereUniqueInput!]
+  disconnect: [ExerciseWhereUniqueInput!]
+  delete: [ExerciseWhereUniqueInput!]
+  update: [ExerciseUpdateWithWhereUniqueWithoutBaseExerciseInput!]
+  updateMany: [ExerciseUpdateManyWithWhereNestedInput!]
+  deleteMany: [ExerciseScalarWhereInput!]
+  upsert: [ExerciseUpsertWithWhereUniqueWithoutBaseExerciseInput!]
 }
 
-input ExcersiseUpdateManyWithWhereNestedInput {
-  where: ExcersiseScalarWhereInput!
-  data: ExcersiseUpdateManyDataInput!
+input ExerciseUpdateManyWithWhereNestedInput {
+  where: ExerciseScalarWhereInput!
+  data: ExerciseUpdateManyDataInput!
 }
 
-input ExcersiseUpdatetargetsInput {
+input ExerciseUpdatetargetsInput {
   set: [String!]
 }
 
-input ExcersiseUpdateWithWhereUniqueNestedInput {
-  where: ExcersiseWhereUniqueInput!
-  data: ExcersiseUpdateDataInput!
+input ExerciseUpdateWithoutBaseExerciseDataInput {
+  name: String
+  description: String
+  video: String
+  targets: ExerciseUpdatetargetsInput
+}
+
+input ExerciseUpdateWithWhereUniqueNestedInput {
+  where: ExerciseWhereUniqueInput!
+  data: ExerciseUpdateDataInput!
+}
+
+input ExerciseUpdateWithWhereUniqueWithoutBaseExerciseInput {
+  where: ExerciseWhereUniqueInput!
+  data: ExerciseUpdateWithoutBaseExerciseDataInput!
+}
+
+input ExerciseUpsertWithWhereUniqueNestedInput {
+  where: ExerciseWhereUniqueInput!
+  update: ExerciseUpdateDataInput!
+  create: ExerciseCreateInput!
 }
 
-input ExcersiseUpsertWithWhereUniqueNestedInput {
-  where: ExcersiseWhereUniqueInput!
-  update: ExcersiseUpdateDataInput!
-  create: ExcersiseCreateInput!
+input ExerciseUpsertWithWhereUniqueWithoutBaseExerciseInput {
+  where: ExerciseWhereUniqueInput!
+  update: ExerciseUpdateWithoutBaseExerciseDataInput!
+  create: ExerciseCreateWithoutBaseExerciseInput!
 }
 
-input ExcersiseWhereInput {
+input ExerciseWhereInput {
   """Logical AND on all given filters."""
-  AND: [ExcersiseWhereInput!]
+  AND: [ExerciseWhereInput!]
 
   """Logical OR on all given filters."""
-  OR: [ExcersiseWhereInput!]
+  OR: [ExerciseWhereInput!]
 
   """Logical NOT on all given filters combined by AND."""
-  NOT: [ExcersiseWhereInput!]
+  NOT: [ExerciseWhereInput!]
   id: ID
 
   """All values that are not equal to given value."""
@@ -1441,9 +1794,10 @@ input ExcersiseWhereInput {
 
   """All values not ending with the given string."""
   video_not_ends_with: String
+  baseExercise: BaseExerciseWhereInput
 }
 
-input ExcersiseWhereUniqueInput {
+input ExerciseWhereUniqueInput {
   id: ID
 }
 
@@ -1707,56 +2061,62 @@ scalar Long
 
 type Mutation {
   createTraining(data: TrainingCreateInput!): Training!
+  createBaseExercise(data: BaseExerciseCreateInput!): BaseExercise!
   createComment(data: CommentCreateInput!): Comment!
   createUser(data: UserCreateInput!): User!
+  createExercise(data: ExerciseCreateInput!): Exercise!
   createTrainingType(data: TrainingTypeCreateInput!): TrainingType!
   createTrack(data: TrackCreateInput!): Track!
-  createExcersise(data: ExcersiseCreateInput!): Excersise!
   createBlock(data: BlockCreateInput!): Block!
   createFormat(data: FormatCreateInput!): Format!
   createRating(data: RatingCreateInput!): Rating!
   updateTraining(data: TrainingUpdateInput!, where: TrainingWhereUniqueInput!): Training
+  updateBaseExercise(data: BaseExerciseUpdateInput!, where: BaseExerciseWhereUniqueInput!): BaseExercise
   updateComment(data: CommentUpdateInput!, where: CommentWhereUniqueInput!): Comment
   updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User
+  updateExercise(data: ExerciseUpdateInput!, where: ExerciseWhereUniqueInput!): Exercise
   updateTrainingType(data: TrainingTypeUpdateInput!, where: TrainingTypeWhereUniqueInput!): TrainingType
   updateTrack(data: TrackUpdateInput!, where: TrackWhereUniqueInput!): Track
-  updateExcersise(data: ExcersiseUpdateInput!, where: ExcersiseWhereUniqueInput!): Excersise
   updateBlock(data: BlockUpdateInput!, where: BlockWhereUniqueInput!): Block
   updateFormat(data: FormatUpdateInput!, where: FormatWhereUniqueInput!): Format
   updateRating(data: RatingUpdateInput!, where: RatingWhereUniqueInput!): Rating
   deleteTraining(where: TrainingWhereUniqueInput!): Training
+  deleteBaseExercise(where: BaseExerciseWhereUniqueInput!): BaseExercise
   deleteComment(where: CommentWhereUniqueInput!): Comment
   deleteUser(where: UserWhereUniqueInput!): User
+  deleteExercise(where: ExerciseWhereUniqueInput!): Exercise
   deleteTrainingType(where: TrainingTypeWhereUniqueInput!): TrainingType
   deleteTrack(where: TrackWhereUniqueInput!): Track
-  deleteExcersise(where: ExcersiseWhereUniqueInput!): Excersise
   deleteBlock(where: BlockWhereUniqueInput!): Block
   deleteFormat(where: FormatWhereUniqueInput!): Format
   deleteRating(where: RatingWhereUniqueInput!): Rating
   upsertTraining(where: TrainingWhereUniqueInput!, create: TrainingCreateInput!, update: TrainingUpdateInput!): Training!
+  upsertBaseExercise(where: BaseExerciseWhereUniqueInput!, create: BaseExerciseCreateInput!, update: BaseExerciseUpdateInput!): BaseExercise!
   upsertComment(where: CommentWhereUniqueInput!, create: CommentCreateInput!, update: CommentUpdateInput!): Comment!
   upsertUser(where: UserWhereUniqueInput!, create: UserCreateInput!, update: UserUpdateInput!): User!
+  upsertExercise(where: ExerciseWhereUniqueInput!, create: ExerciseCreateInput!, update: ExerciseUpdateInput!): Exercise!
   upsertTrainingType(where: TrainingTypeWhereUniqueInput!, create: TrainingTypeCreateInput!, update: TrainingTypeUpdateInput!): TrainingType!
   upsertTrack(where: TrackWhereUniqueInput!, create: TrackCreateInput!, update: TrackUpdateInput!): Track!
-  upsertExcersise(where: ExcersiseWhereUniqueInput!, create: ExcersiseCreateInput!, update: ExcersiseUpdateInput!): Excersise!
   upsertBlock(where: BlockWhereUniqueInput!, create: BlockCreateInput!, update: BlockUpdateInput!): Block!
   upsertFormat(where: FormatWhereUniqueInput!, create: FormatCreateInput!, update: FormatUpdateInput!): Format!
   upsertRating(where: RatingWhereUniqueInput!, create: RatingCreateInput!, update: RatingUpdateInput!): Rating!
   updateManyTrainings(data: TrainingUpdateManyMutationInput!, where: TrainingWhereInput): BatchPayload!
+  updateManyBaseExercises(data: BaseExerciseUpdateManyMutationInput!, where: BaseExerciseWhereInput): BatchPayload!
   updateManyComments(data: CommentUpdateManyMutationInput!, where: CommentWhereInput): BatchPayload!
   updateManyUsers(data: UserUpdateManyMutationInput!, where: UserWhereInput): BatchPayload!
+  updateManyExercises(data: ExerciseUpdateManyMutationInput!, where: ExerciseWhereInput): BatchPayload!
   updateManyTrainingTypes(data: TrainingTypeUpdateManyMutationInput!, where: TrainingTypeWhereInput): BatchPayload!
   updateManyTracks(data: TrackUpdateManyMutationInput!, where: TrackWhereInput): BatchPayload!
-  updateManyExcersises(data: ExcersiseUpdateManyMutationInput!, where: ExcersiseWhereInput): BatchPayload!
   updateManyBlocks(data: BlockUpdateManyMutationInput!, where: BlockWhereInput): BatchPayload!
   updateManyFormats(data: FormatUpdateManyMutationInput!, where: FormatWhereInput): BatchPayload!
   updateManyRatings(data: RatingUpdateManyMutationInput!, where: RatingWhereInput): BatchPayload!
   deleteManyTrainings(where: TrainingWhereInput): BatchPayload!
+  deleteManyBaseExercises(where: BaseExerciseWhereInput): BatchPayload!
   deleteManyComments(where: CommentWhereInput): BatchPayload!
   deleteManyUsers(where: UserWhereInput): BatchPayload!
+  deleteManyExercises(where: ExerciseWhereInput): BatchPayload!
   deleteManyTrainingTypes(where: TrainingTypeWhereInput): BatchPayload!
   deleteManyTracks(where: TrackWhereInput): BatchPayload!
-  deleteManyExcersises(where: ExcersiseWhereInput): BatchPayload!
   deleteManyBlocks(where: BlockWhereInput): BatchPayload!
   deleteManyFormats(where: FormatWhereInput): BatchPayload!
   deleteManyRatings(where: RatingWhereInput): BatchPayload!
@@ -1797,29 +2157,32 @@ enum Permission {
 
 type Query {
   trainings(where: TrainingWhereInput, orderBy: TrainingOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Training]!
+  baseExercises(where: BaseExerciseWhereInput, orderBy: BaseExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [BaseExercise]!
   comments(where: CommentWhereInput, orderBy: CommentOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Comment]!
   users(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User]!
+  exercises(where: ExerciseWhereInput, orderBy: ExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Exercise]!
   trainingTypes(where: TrainingTypeWhereInput, orderBy: TrainingTypeOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [TrainingType]!
   tracks(where: TrackWhereInput, orderBy: TrackOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Track]!
-  excersises(where: ExcersiseWhereInput, orderBy: ExcersiseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Excersise]!
   blocks(where: BlockWhereInput, orderBy: BlockOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Block]!
   formats(where: FormatWhereInput, orderBy: FormatOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Format]!
   ratings(where: RatingWhereInput, orderBy: RatingOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Rating]!
   training(where: TrainingWhereUniqueInput!): Training
+  baseExercise(where: BaseExerciseWhereUniqueInput!): BaseExercise
   comment(where: CommentWhereUniqueInput!): Comment
   user(where: UserWhereUniqueInput!): User
+  exercise(where: ExerciseWhereUniqueInput!): Exercise
   trainingType(where: TrainingTypeWhereUniqueInput!): TrainingType
   track(where: TrackWhereUniqueInput!): Track
-  excersise(where: ExcersiseWhereUniqueInput!): Excersise
   block(where: BlockWhereUniqueInput!): Block
   format(where: FormatWhereUniqueInput!): Format
   rating(where: RatingWhereUniqueInput!): Rating
   trainingsConnection(where: TrainingWhereInput, orderBy: TrainingOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): TrainingConnection!
+  baseExercisesConnection(where: BaseExerciseWhereInput, orderBy: BaseExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): BaseExerciseConnection!
   commentsConnection(where: CommentWhereInput, orderBy: CommentOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): CommentConnection!
   usersConnection(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection!
+  exercisesConnection(where: ExerciseWhereInput, orderBy: ExerciseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): ExerciseConnection!
   trainingTypesConnection(where: TrainingTypeWhereInput, orderBy: TrainingTypeOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): TrainingTypeConnection!
   tracksConnection(where: TrackWhereInput, orderBy: TrackOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): TrackConnection!
-  excersisesConnection(where: ExcersiseWhereInput, orderBy: ExcersiseOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): ExcersiseConnection!
   blocksConnection(where: BlockWhereInput, orderBy: BlockOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): BlockConnection!
   formatsConnection(where: FormatWhereInput, orderBy: FormatOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): FormatConnection!
   ratingsConnection(where: RatingWhereInput, orderBy: RatingOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): RatingConnection!
@@ -2291,11 +2654,12 @@ input RatingWhereUniqueInput {
 
 type Subscription {
   training(where: TrainingSubscriptionWhereInput): TrainingSubscriptionPayload
+  baseExercise(where: BaseExerciseSubscriptionWhereInput): BaseExerciseSubscriptionPayload
   comment(where: CommentSubscriptionWhereInput): CommentSubscriptionPayload
   user(where: UserSubscriptionWhereInput): UserSubscriptionPayload
+  exercise(where: ExerciseSubscriptionWhereInput): ExerciseSubscriptionPayload
   trainingType(where: TrainingTypeSubscriptionWhereInput): TrainingTypeSubscriptionPayload
   track(where: TrackSubscriptionWhereInput): TrackSubscriptionPayload
-  excersise(where: ExcersiseSubscriptionWhereInput): ExcersiseSubscriptionPayload
   block(where: BlockSubscriptionWhereInput): BlockSubscriptionPayload
   format(where: FormatSubscriptionWhereInput): FormatSubscriptionPayload
   rating(where: RatingSubscriptionWhereInput): RatingSubscriptionPayload
@@ -2852,7 +3216,9 @@ type Training implements Node {
   content(where: BlockWhereInput, orderBy: BlockOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Block!]
   createdAt: DateTime!
   trainingDate: DateTime!
-  participants(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User!]
+  location: String!
+  registration(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User!]
+  attendance: Int!
   ratings(where: RatingWhereInput, orderBy: RatingOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Rating!]
   published: Boolean!
 }
@@ -2871,10 +3237,12 @@ input TrainingCreateInput {
   id: ID
   title: String!
   trainingDate: DateTime!
+  location: String!
+  attendance: Int!
   published: Boolean!
   type: TrainingTypeCreateOneInput!
   content: BlockCreateManyInput
-  participants: UserCreateManyInput
+  registration: UserCreateManyInput
   ratings: RatingCreateManyInput
 }
 
@@ -2896,6 +3264,10 @@ enum TrainingOrderByInput {
   createdAt_DESC
   trainingDate_ASC
   trainingDate_DESC
+  location_ASC
+  location_DESC
+  attendance_ASC
+  attendance_DESC
   published_ASC
   published_DESC
 }
@@ -2905,6 +3277,8 @@ type TrainingPreviousValues {
   title: String!
   createdAt: DateTime!
   trainingDate: DateTime!
+  location: String!
+  attendance: Int!
   published: Boolean!
 }
 
@@ -3198,16 +3572,20 @@ input TrainingTypeWhereUniqueInput {
 input TrainingUpdateInput {
   title: String
   trainingDate: DateTime
+  location: String
+  attendance: Int
   published: Boolean
   type: TrainingTypeUpdateOneRequiredInput
   content: BlockUpdateManyInput
-  participants: UserUpdateManyInput
+  registration: UserUpdateManyInput
   ratings: RatingUpdateManyInput
 }
 
 input TrainingUpdateManyMutationInput {
   title: String
   trainingDate: DateTime
+  location: String
+  attendance: Int
   published: Boolean
 }
 
@@ -3344,6 +3722,68 @@ input TrainingWhereInput {
 
   """All values greater than or equal the given value."""
   trainingDate_gte: DateTime
+  location: String
+
+  """All values that are not equal to given value."""
+  location_not: String
+
+  """All values that are contained in given list."""
+  location_in: [String!]
+
+  """All values that are not contained in given list."""
+  location_not_in: [String!]
+
+  """All values less than the given value."""
+  location_lt: String
+
+  """All values less than or equal the given value."""
+  location_lte: String
+
+  """All values greater than the given value."""
+  location_gt: String
+
+  """All values greater than or equal the given value."""
+  location_gte: String
+
+  """All values containing the given string."""
+  location_contains: String
+
+  """All values not containing the given string."""
+  location_not_contains: String
+
+  """All values starting with the given string."""
+  location_starts_with: String
+
+  """All values not starting with the given string."""
+  location_not_starts_with: String
+
+  """All values ending with the given string."""
+  location_ends_with: String
+
+  """All values not ending with the given string."""
+  location_not_ends_with: String
+  attendance: Int
+
+  """All values that are not equal to given value."""
+  attendance_not: Int
+
+  """All values that are contained in given list."""
+  attendance_in: [Int!]
+
+  """All values that are not contained in given list."""
+  attendance_not_in: [Int!]
+
+  """All values less than the given value."""
+  attendance_lt: Int
+
+  """All values less than or equal the given value."""
+  attendance_lte: Int
+
+  """All values greater than the given value."""
+  attendance_gt: Int
+
+  """All values greater than or equal the given value."""
+  attendance_gte: Int
   published: Boolean
 
   """All values that are not equal to given value."""
@@ -3352,9 +3792,9 @@ input TrainingWhereInput {
   content_every: BlockWhereInput
   content_some: BlockWhereInput
   content_none: BlockWhereInput
-  participants_every: UserWhereInput
-  participants_some: UserWhereInput
-  participants_none: UserWhereInput
+  registration_every: UserWhereInput
+  registration_some: UserWhereInput
+  registration_none: UserWhereInput
   ratings_every: RatingWhereInput
   ratings_some: RatingWhereInput
   ratings_none: RatingWhereInput

+ 13 - 3
backend/datamodel.prisma

@@ -23,7 +23,9 @@ type Training {
     content: [Block]!
     createdAt: DateTime! @createdAt
     trainingDate: DateTime!
-    participants: [User]!
+    location: String!
+    registration: [User]!
+    attendance: Int!
     ratings: [Rating]!
     published: Boolean!
 }
@@ -42,7 +44,8 @@ type Block {
     variation: String
     format: Format
     tracks: [Track]!
-    excersises: [Excersise]!
+    exercises: [Exercise]!
+    description: String!
 }
 
 type Format {
@@ -59,12 +62,19 @@ type Track {
     link: String!
 }
 
-type Excersise {
+type Exercise {
     id: ID! @id
     name: String!
     description: String!
     video: String!
     targets: [String]! @scalarList(strategy: RELATION) 
+    baseExercise: BaseExercise!
+}
+
+type BaseExercise {
+    id: ID! @id
+    name: String!
+    variations: [Exercise]!
 }
 
 type Rating {

+ 6 - 6
backend/package-lock.json

@@ -274,18 +274,18 @@
       "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw=="
     },
     "@types/mongodb": {
-      "version": "3.3.8",
-      "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.3.8.tgz",
-      "integrity": "sha512-hsLcKRBFVeam4FyJOU6bwklvsNHzmUBI5SIxQ2meZu+RZgTDzrv+W19YAHgDIuiTn6UqHrVolweLMk0RpKEbxg==",
+      "version": "3.3.9",
+      "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.3.9.tgz",
+      "integrity": "sha512-jvB6SfyHxs47R6vvywV0pWNU7191t4GwnypqMLMZKmdG21KxHT6t4wdfpzIhbfz8bfKoXg+qJuv3ALCNOC/7Bg==",
       "requires": {
         "@types/bson": "*",
         "@types/node": "*"
       }
     },
     "@types/mysql": {
-      "version": "2.15.7",
-      "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.7.tgz",
-      "integrity": "sha512-S7cpDl+heeTe2zd7LGeAodEsx9AnkzW1vHJ9kKwr9ype1KohW01jaUmCYhpafrQvnxzcUJAfeYdDr3fET8ufPw==",
+      "version": "2.15.8",
+      "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.8.tgz",
+      "integrity": "sha512-l0TUdg6KDEaLO75/yjdjksobJDRWv8iZlpRfv/WW1lQZCQDKdTDnKCkeH10oapzP/JTuKiTy6Cvq/sm/0GgcUw==",
       "requires": {
         "@types/node": "*"
       }

+ 1 - 1
docker-compose.yml

@@ -39,7 +39,7 @@ services:
     environment:
       PRISMA_CONFIG: |
         port: 4466
-        #managementApiSecret: "PrismaSecret"
+        managementApiSecret: "PrismaSecret"
         databases:
           default:
             connector: mysql

+ 0 - 1
frontend/components/header.js

@@ -3,7 +3,6 @@ import Logo from './logo'
 const Header = props => (
   <header>
     <Logo />
-    <p>Header</p>
   </header>
 )
 

+ 17 - 8
frontend/components/logo.js

@@ -1,17 +1,17 @@
 const Logo = () => (
-  <div className='logo'>
+  <div id='logo'>
     <div id='circle'><span id='dot'>˙</span><span id='u'>u</span></div>
-    <div id='text'>fit</div>
+    <div id='text'><span>fit</span></div>
 
     <style jsx>{`
-      .logo {
+      #logo {
         display: grid;
         grid-template-columns: 60px 1fr;
         grid-auto-flow: column;
-        grid-gap: 10px;
+        grid-spacing: 3px;
         font-family: roboto_black;
-        font-size: 36px;
-        font-weight: bold;
+        font-size: 40px;
+        line-height: 1;
       }
 
       #circle {
@@ -23,14 +23,23 @@ const Logo = () => (
         width: 60px;
         height: 60px;
         border-radius: 30px;
-        text-align: right;
-        vertical-align: text-bottom;
+        vertical-align: bottom;
       }
 
       #text {
+        display: grid;
         height: 60px;
         vertical-align: text-bottom;
       }
+
+      #circle > span,
+      #text > span {
+        padding-top: 12px;
+      }
+
+      #dot {
+        text-align: right;
+      }
     `}</style>
   </div>
 )

+ 74 - 10
frontend/components/training.js

@@ -1,11 +1,11 @@
-function calculateRating (ratings) {
+function calculateRating(ratings) {
   const numberOfRatings = ratings.length
   const sumOfRatings = ratings.reduce(
     (accumulator, rating) => accumulator + rating.value,
     0
   )
   console.log(ratings, sumOfRatings, numberOfRatings)
-  return sumOfRatings / numberOfRatings
+  return numberOfRatings ? sumOfRatings / numberOfRatings : '-'
 }
 
 const TrainingArchive = props => (
@@ -28,15 +28,79 @@ const TrainingHint = props => (
 )
 
 const Training = props => (
-  <div>
-    <h3>{props.training.title}</h3>
-    <p>Date: {props.training.date}</p>
-    <p>Location: {props.training.location}</p>
-    <p>Participants: {props.training.participants.length}</p>
-    <p>Rating: {calculateRating(props.training.ratings)}</p>
-    <p>Content</p>
-  </div>
+  <article>
+    <h2>{props.title}</h2>
+    <section id='info'>
+      <p>
+        <span className='caption'>Type: </span>
+        <span className='data'>{props.type.name}</span>
+      </p>
+      <p>
+        <span className='caption'>Date: </span>
+        <span className='data'>{(new Date(props.trainingDate)).toLocaleDateString()}</span>
+      </p>
+      <p>
+        <span className='caption'>Location: </span>
+        <span className='data'>{props.location}</span>
+      </p>
+      <p>
+        <span className='caption'>Registrations: </span>
+        <span className='data'>{props.registration.length} <a href=''>Register!</a></span>
+      </p>
+      <p>
+        <span className='caption'>Attendance: </span>
+        <span className='data'>{props.attendance}</span>
+      </p>
+      <p>
+        <span className='caption'>Rating: </span>
+        <span className='data'>{calculateRating(props.ratings)} [<a href=''>{props.ratings.length}</a>]
+          Rate it!
+          <a href=''>*</a>
+          <a href=''>*</a>
+          <a href=''>*</a>
+          <a href=''>*</a>
+          <a href=''>*</a>
+        </span>
+      </p>
+    </section>
+    <section id='content'>
+      <h3>Content</h3>
+      {props.content.sort(block => block.sequence).map(block => <Block key={block.id} {...block} />)}
+    </section>
+  </article>
 )
 
+const Block = props => <article>
+  <h2>{props.title}</h2>
+  <section id='info'>
+    <p>
+      <span className='caption'>Duration: </span>
+      <span className='data'>{props.duration}</span>
+    </p>
+    <p>
+      <span className='caption'>Variation: </span>
+      <span className='data'>{props.variation}</span>
+    </p>
+    <p>
+      <span className='caption'>Format: </span>
+      <span className='data'>{props.format.name}</span>
+    </p>
+    <p>
+      <span className='caption'>Description: </span>
+      <span className='data'>{props.description}</span>
+    </p>
+  </section>
+</article>
+
+class TrainingCreateForm extends React.Component {
+  render() {
+    return <form>
+      <label htmlFor="title">Title<input type="text" id="title" /></label>
+      <label htmlFor="title">Title<input type="text" id="title" /></label>
+      <label htmlFor="title">Title<input type="text" id="title" /></label>
+    </form>
+  }
+}
+
 export { TrainingArchive }
 export default Training

+ 125 - 75
frontend/initial-data.js

@@ -1,81 +1,131 @@
 const data = {
-  trainings: [
-    {
-      id: 0,
-      title: 'Indoor HIIT + Core',
-      date: 1572345900000,
-      location: 'Yoga Room',
-      participants: [0, 2],
-      ratings: [
-        {
-          user: 0,
-          createdAt: 1572621963544,
-          value: 5,
-          comment: 'Best training ever.'
-        }
-      ],
-      content: [
-        {
-          name: 'Warmup',
-          duration: 153,
-          track: {
-            artist: 'Sam & Dave',
-            title: "Hold on, I'm coming",
-            link: 'https://www.youtube.com/watch?v=AREppyQf5uw'
-          },
-          exercises: [0]
-        }
-      ]
+  trainings: [{
+    id: 'training0',
+    title: 'Indoor HIIT + Core',
+    type: {
+      id: 'type0',
+      name: 'HIIT',
+      description: 'High Intensity Interval Training'
     },
-    {
-      id: 1,
-      title: 'Indoor HIIT + Core',
-      date: 1572345900000,
-      location: 'Yoga Room',
-      participants: [0, 2],
-      ratings: [
-        {
-          user: 0,
-          createdAt: 1572621963544,
-          value: 5,
-          comment: 'Best training ever.'
-        }
-      ],
-      content: [
-        {
-          name: 'Warmup',
+    createdAt: '2019-11-11T21:13:43.284Z',
+    trainingDate: '2019-11-12T11:45:00.000Z',
+    location: 'Yoga Room',
+    registration: [],
+    attendance: 14,
+    ratings: [],
+    published: true,
+    content: [
+      {
+        id: 'block0',
+        sequence: 0,
+        title: 'Warmup',
+        duration: 153,
+        variation: '',
+        format: {
+          id: 'format0',
+          name: 'Sequence',
+          description: 'Simple sequence of exercises'
+        },
+        tracks: [{
+          id: 0,
+          title: "Hold on, I'm coming",
+          artist: 'Sam & Dave',
           duration: 153,
-          track: {
-            artist: 'Sam & Dave',
-            title: "Hold on, I'm coming",
-            link: 'https://www.youtube.com/watch?v=AREppyQf5uw'
-          },
-          exercises: [0]
-        }
-      ]
-    }
-  ],
-  exercises: [
-    {
-      id: 0,
-      name: 'Burpee',
-      description: 'Squat, kick legs back, bring legs back forward, stand up.',
-      video: null
-    }
-  ],
-  people: [
-    {
-      id: 0,
-      name: 'Tomi',
-      password: 'hacked',
-      phone: '077 665 54 43'
-    },
-    {
-      id: 2,
-      name: 'Marius',
-      password: 'hacked',
-      phone: '077 766 55 44'
-    }
+          link: 'https://www.youtube.com/watch?v=AREppyQf5uw'
+        }],
+        exercises: [{
+          id: 'exercise0',
+          name: 'Squat',
+          variations: [{
+            id: 'exerciseVariation0',
+            name: 'lateral jump squat',
+            description: '',
+            link: ''
+          }]
+        }],
+        description: 'Warm up everything.'
+      },
+      {
+        id: 'block1',
+        sequence: 1,
+        title: 'Circuit',
+        duration: 720,
+        variation: '',
+        format: {
+          id: 'format1',
+          name: 'Circuit',
+          description: ''
+        },
+        tracks: [{
+          artist: 'Daniel Portman',
+          title: "You're Not Alone",
+          link: ''
+        }, {
+          artist: 'ATFC & David Penn',
+          title: "Hipcats",
+          link: ''
+        }, {
+          artist: 'Eli Brown',
+          title: "In the Dance",
+          link: ''
+        }, {
+          artist: 'Biscits',
+          title: "Do It Like This",
+          link: ''
+        }],
+        exercises: [{
+          base: [{
+            name: 'On the Spot Run',
+            variations: [{
+              name: 'regular', description: '', video: ''
+            }, {
+              name: 'high knees', description: '', video: ''
+            }, {
+              name: 'sprint', description: '', video: ''
+            }, {
+              name: 'butt kick', description: '', video: ''
+            }, {
+              name: 'boxer', description: '', video: ''
+            }]
+          }, {
+            name: 'Squat',
+            variations: [{
+              name: 'regular', description: '', video: ''
+            }, {
+              name: 'jump', description: '', video: ''
+            }, {
+              name: 'sumo', description: '', video: ''
+            }, {
+              name: 'drop', description: '', video: ''
+            }, {
+              name: '1/4 turn', description: '', video: ''
+            }, {
+              name: '1/2 turn', description: '', video: ''
+            }, {
+              name: 'prisoner', description: '', video: ''
+            }, {
+              name: 'side-to-side', description: '', video: ''
+            }, {
+              name: 'in-out', description: '', video: ''
+            }]
+          }],
+          variation: '8 boxers, 4 Rotational Drop Squats'
+        }, {
+          base: [{
+            name: 'Push-Up',
+            variations: ['regular', 'narrow', 'wide', 'plyo', 'around the world', 'push-back', 'jack']
+          }, {
+            name: 'Frog Jump',
+            variations: ['regular', 'jump', 'sumo', 'drop', '1/4 turn', '1/2 turn', 'prisoner', 'side-to-side', 'in-out']
+          }, {
+            name: 'Kick-Out',
+            variations: ['regular', 'jump', 'sumo', 'drop', '1/4 turn', '1/2 turn', 'prisoner', 'side-to-side', 'in-out']
+          }],
+          variation: '8 boxers, 4 Rotational Drop Squats'
+        }]
+      }
+    ]
+  }
   ],
   polls: []
 }

+ 1 - 5
frontend/pages/index.js

@@ -23,11 +23,7 @@ const Home = () => (
     <Header />
     <Nav />
     <main>
-      <Poll />
-      <TrainingArchive trainings={data.trainings} />
-      <ExerciseList exercises={data.exercises} />
-      <PeopleList people={data.people} />
-      <Training training={data.trainings[data.trainings.length - 1]} />
+      <Training {...data.trainings[data.trainings.length - 1]} />
     </main>
     <Footer />
   </div>

Some files were not shown because too many files changed in this diff