Allow MANUAL and RATE_PLAN rate sources
All checks were successful
build-and-deploy / build-deploy (push) Successful in 2m35s

This commit is contained in:
androidlover5842
2026-01-29 12:01:33 +05:30
parent 92bc2c40a3
commit ff01f0ab18
3 changed files with 4 additions and 2 deletions

View File

@@ -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")
} }

View File

@@ -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")
} }

View File

@@ -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
} }