Allow MANUAL and RATE_PLAN rate sources
All checks were successful
build-and-deploy / build-deploy (push) Successful in 2m35s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 2m35s
This commit is contained in:
@@ -539,7 +539,7 @@ class BookingFlow(
|
|||||||
private fun parseRateSource(value: String?): RateSource? {
|
private fun parseRateSource(value: String?): RateSource? {
|
||||||
if (value.isNullOrBlank()) return null
|
if (value.isNullOrBlank()) return null
|
||||||
return try {
|
return try {
|
||||||
RateSource.valueOf(value.trim())
|
RateSource.valueOf(value.trim().uppercase())
|
||||||
} catch (_: IllegalArgumentException) {
|
} catch (_: IllegalArgumentException) {
|
||||||
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown rate source")
|
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown rate source")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ class RoomStays(
|
|||||||
|
|
||||||
private fun parseRateSource(value: String): RateSource {
|
private fun parseRateSource(value: String): RateSource {
|
||||||
return try {
|
return try {
|
||||||
RateSource.valueOf(value.trim())
|
RateSource.valueOf(value.trim().uppercase())
|
||||||
} catch (_: IllegalArgumentException) {
|
} catch (_: IllegalArgumentException) {
|
||||||
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown rate source")
|
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown rate source")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.android.trisolarisserver.models.room
|
package com.android.trisolarisserver.models.room
|
||||||
|
|
||||||
enum class RateSource {
|
enum class RateSource {
|
||||||
|
MANUAL,
|
||||||
PRESET,
|
PRESET,
|
||||||
|
RATE_PLAN,
|
||||||
NEGOTIATED,
|
NEGOTIATED,
|
||||||
OTA
|
OTA
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user