API 1.0.47 Customer.trial

This commit is contained in:
Tibor Bossanyi (Freelancer) 2021-08-06 18:16:17 +02:00
parent 4fcdf02221
commit b0ab1b4f77
7 changed files with 18 additions and 8 deletions

View File

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

View File

@ -0,0 +1,8 @@
START TRANSACTION;
ALTER TABLE `customer`
ADD COLUMN `trial` TINYINT NULL DEFAULT NULL AFTER `synced_date`;
UPDATE configuration set config_value = "1.0.47", date_change=CURRENT_DATE WHERE config_key = "db_version";
COMMIT;

View File

@ -117,13 +117,13 @@ class CustomerController ( private val customerRepository: CustomerRepository) {
if (newCustomer.emailSubscription != null) {
updatedCustomer.emailSubscription = newCustomer.emailSubscription
}
if (newCustomer.trial != null) {
updatedCustomer.trial = newCustomer.trial
}
updatedCustomer.sex = newCustomer.sex
updatedCustomer.birthYear = newCustomer.birthYear
updatedCustomer.fitnessLevel = newCustomer.fitnessLevel
return ResponseEntity.ok().body(customerRepository.save(updatedCustomer))
}

View File

@ -1,8 +1,6 @@
package com.aitrainer.api.model
import com.google.gson.annotations.Expose
import org.hibernate.annotations.Fetch
import org.hibernate.annotations.FetchMode
import javax.persistence.*
@Entity
@ -28,5 +26,8 @@ data class Customer (
@Expose var firebaseUid: String? = null,
@Expose var sportId: Int? = null,
@Expose var emailSubscription: Int? = 0,
@Expose var synced_date: String? = null,
@Expose var trial: Boolean? = false,
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Expose var customerId: Long = 0,
)

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.46
application.version=1.0.47
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.46
application.version=1.0.47
jwt.secret=aitrainer
jasypt.encryptor.password=Tibor

View File

@ -71,6 +71,7 @@ class AppCustomerPackageTest {
val customer: Customer = gson.fromJson(customerJson, type)
assertEquals(customer.email, "sw@andio.biz")
assertEquals(customer.birthYear, 1972)
assertEquals(customer.trial, true)
}
record[0] == Exercises::class.simpleName -> {
val exercisesJson: String = record[1]