refactor: PaymentTypes내 private 제거 및 변수명 통일

This commit is contained in:
이상진 2025-08-18 15:53:30 +09:00
parent 0cb7f3e234
commit b38a5242ce

View File

@ -9,7 +9,7 @@ import roomescape.payment.exception.PaymentException
private val log: KLogger = KotlinLogging.logger {} private val log: KLogger = KotlinLogging.logger {}
enum class PaymentType( enum class PaymentType(
private val koreanName: String val koreanName: String
) { ) {
NORMAL("일반결제"), NORMAL("일반결제"),
BILLING("자동결제"), BILLING("자동결제"),
@ -21,9 +21,9 @@ enum class PaymentType(
@JvmStatic @JvmStatic
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
fun get(code: String): PaymentType { fun get(name: String): PaymentType {
return CACHE[code.uppercase()] ?: run { return CACHE[name.uppercase()] ?: run {
log.warn { "[PaymentTypes.PaymentType] 결제 타입 조회 실패: type=$code" } log.warn { "[PaymentTypes.PaymentType] 결제 타입 조회 실패: type=$name" }
throw PaymentException(PaymentErrorCode.TYPE_NOT_FOUND) throw PaymentException(PaymentErrorCode.TYPE_NOT_FOUND)
} }
} }
@ -81,7 +81,7 @@ enum class PaymentStatus {
} }
enum class CardType( enum class CardType(
private val koreanName: String val koreanName: String
) { ) {
CREDIT("신용"), CREDIT("신용"),
CHECK("체크"), CHECK("체크"),
@ -103,7 +103,7 @@ enum class CardType(
} }
enum class CardOwnerType( enum class CardOwnerType(
private val koreanName: String val koreanName: String
) { ) {
PERSONAL("개인"), PERSONAL("개인"),
CORPORATE("법인"), CORPORATE("법인"),