-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from freekode/tp-copy-workout
Copy workouts
- Loading branch information
Showing
60 changed files
with
597 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
boot/src/main/kotlin/org/freekode/tp2intervals/domain/workout/WorkoutRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
package org.freekode.tp2intervals.domain.workout | ||
|
||
import java.time.LocalDate | ||
import org.freekode.tp2intervals.domain.Platform | ||
import org.freekode.tp2intervals.domain.plan.Plan | ||
import java.time.LocalDate | ||
|
||
interface WorkoutRepository { | ||
fun platform(): Platform | ||
|
||
fun getPlannedWorkouts(startDate: LocalDate, endDate: LocalDate): List<Workout> | ||
|
||
fun getWorkout(id: String): Workout | ||
|
||
fun getWorkouts(plan: Plan): List<Workout> | ||
|
||
fun planWorkout(workout: Workout) | ||
|
||
fun saveWorkout(workout: Workout, plan: Plan) | ||
fun getWorkoutsFromLibrary(plan: Plan): List<Workout> | ||
|
||
fun saveWorkoutToLibrary(workout: Workout, plan: Plan) | ||
} |
4 changes: 3 additions & 1 deletion
4
boot/src/main/kotlin/org/freekode/tp2intervals/domain/workout/structure/WorkoutStep.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package org.freekode.tp2intervals.domain.workout.structure | ||
|
||
interface WorkoutStep { | ||
import java.io.Serializable | ||
|
||
interface WorkoutStep : Serializable { | ||
fun isSingleStep(): Boolean | ||
} |
4 changes: 3 additions & 1 deletion
4
boot/src/main/kotlin/org/freekode/tp2intervals/domain/workout/structure/WorkoutStepTarget.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package org.freekode.tp2intervals.domain.workout.structure | ||
|
||
import java.io.Serializable | ||
|
||
data class WorkoutStepTarget( | ||
val start: Int, | ||
val end: Int | ||
) | ||
): Serializable |
4 changes: 3 additions & 1 deletion
4
boot/src/main/kotlin/org/freekode/tp2intervals/domain/workout/structure/WorkoutStructure.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
boot/src/main/kotlin/org/freekode/tp2intervals/infrastructure/Signature.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.freekode.tp2intervals.infrastructure | ||
|
||
class Signature { | ||
companion object { | ||
val description = """ | ||
Created by tp2intervals (https://github.com/freekode/tp2intervals) | ||
""".trimIndent() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...kode/tp2intervals/infrastructure/platform/intervalsicu/folder/IntervalsFolderApiClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.freekode.tp2intervals.infrastructure.platform.intervalsicu.folder | ||
|
||
import org.freekode.tp2intervals.infrastructure.platform.intervalsicu.IntervalsApiClientConfig | ||
import org.springframework.cloud.openfeign.FeignClient | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.RequestBody | ||
|
||
@FeignClient( | ||
value = "IntervalsFolderApiClient", | ||
url = "\${intervals.api-url}", | ||
dismiss404 = true, | ||
primary = false, | ||
configuration = [IntervalsApiClientConfig::class] | ||
) | ||
interface IntervalsFolderApiClient { | ||
|
||
@PostMapping("/api/v1/athlete/{athleteId}/folders") | ||
fun createFolder( | ||
@PathVariable("athleteId") athleteId: String, | ||
@RequestBody createFolderRequestDTO: CreateFolderRequestDTO | ||
): FolderDTO | ||
|
||
@GetMapping("/api/v1/athlete/{athleteId}/folders") | ||
fun getFolders( | ||
@PathVariable("athleteId") athleteId: String, | ||
): List<FolderDTO> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.