API 1.0.44 TrainingPlan active

This commit is contained in:
Bossanyi Tibor 2021-06-07 15:26:48 +02:00
parent a1cec1f7b5
commit 2e7a0a9021
7 changed files with 14 additions and 3 deletions

View File

@ -11,7 +11,7 @@ plugins {
}
group = "com.aitrainer"
version = "1.0.43"
version = "1.0.44"
java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories {

View File

@ -0,0 +1,8 @@
START TRANSACTION;
ALTER TABLE `training_plan`
ADD COLUMN `active` TINYINT NOT NULL DEFAULT 0 AFTER `free`;
UPDATE configuration set config_value = "1.0.44", date_change=CURRENT_DATE WHERE config_key = "db_version";
COMMIT;

View File

@ -16,6 +16,7 @@ data class TrainingPlan (
@Expose @get: NotBlank var type: String = "",
@Expose var internalName: String?,
@Expose var free: Boolean?,
@Expose @get: NotBlank var active: Boolean = false,
) {
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "trainingPlan")
@Fetch(value = FetchMode.SUBSELECT)

View File

@ -6,4 +6,5 @@ import org.springframework.stereotype.Repository
@Repository
interface TrackingRepository: JpaRepository<Tracking, Long> {
}

View File

@ -17,6 +17,6 @@ logging.config=classpath:logback-spring.xml
logging.file=logs
# if the database structure has been changed, increment this version number
application.version=1.0.43
application.version=1.0.44
jwt.secret=aitrainer

View File

@ -17,7 +17,7 @@ logging.config=classpath:logback-spring.xml
logging.file=logs
# if the database structure has been changed, increment this version number
application.version=1.0.43
application.version=1.0.44
jwt.secret=aitrainer
jasypt.encryptor.password=Tibor

View File

@ -176,6 +176,7 @@ class AppPackageTest {
assertEquals(plans[1].name, "Beginner Mens workout")
assertEquals(plans[1].internalName, "beginner_man")
assertEquals(plans[1].free, true)
assertEquals(plans[1].active, true)
assertEquals(plans[1].treeId, 37)
assertEquals(plans[0].details[0].exerciseTypeId, 37)
assertEquals(plans[0].details[1].weight, 20.0)