API 1.0.47 Customer.trial
This commit is contained in:
parent
4fcdf02221
commit
b0ab1b4f77
@ -11,7 +11,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.aitrainer"
|
||||
version = "1.0.46"
|
||||
version = "1.0.47"
|
||||
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
repositories {
|
||||
|
8
data/db/update_1_0_47.sql
Normal file
8
data/db/update_1_0_47.sql
Normal 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;
|
@ -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))
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
)
|
||||
|
@ -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
|
@ -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
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user