From 63d4f93d31e16ca788dfeb10e701c0a8d9503986 Mon Sep 17 00:00:00 2001 From: pricelees Date: Fri, 15 Aug 2025 18:43:28 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B2=B0=EC=A0=9C=20=EC=83=81=EC=84=B8?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=EB=A5=BC=20=EC=A0=80=EC=9E=A5=ED=95=98?= =?UTF-8?q?=EB=8A=94=20PaymentDetailEntity=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../persistence/v2/PaymentDetailEntity.kt | 78 +++++++++++++++++++ .../persistence/v2/PaymentDetailRepository.kt | 5 ++ 2 files changed, 83 insertions(+) create mode 100644 src/main/kotlin/roomescape/payment/infrastructure/persistence/v2/PaymentDetailEntity.kt create mode 100644 src/main/kotlin/roomescape/payment/infrastructure/persistence/v2/PaymentDetailRepository.kt diff --git a/src/main/kotlin/roomescape/payment/infrastructure/persistence/v2/PaymentDetailEntity.kt b/src/main/kotlin/roomescape/payment/infrastructure/persistence/v2/PaymentDetailEntity.kt new file mode 100644 index 00000000..e7940e7e --- /dev/null +++ b/src/main/kotlin/roomescape/payment/infrastructure/persistence/v2/PaymentDetailEntity.kt @@ -0,0 +1,78 @@ +package roomescape.payment.infrastructure.persistence.v2 + +import jakarta.persistence.* +import roomescape.common.entity.PersistableBaseEntity +import roomescape.payment.infrastructure.common.* +import kotlin.jvm.Transient + +@Entity +@Table(name = "payment_detail") +@Inheritance(strategy = InheritanceType.JOINED) +open class PaymentDetailEntity( + id: Long, + + open val paymentId: Long, + open val netAmount: Int, + open val vat: Int, + + @Transient + private var isNewEntity: Boolean = true +) : PersistableBaseEntity(id) + +@Entity +@Table(name = "payment_card_detail") +class PaymentCardDetailEntity( + id: Long, + paymentId: Long, + netAmount: Int, + vat: Int, + + @Enumerated(EnumType.STRING) + val issuerCode: CardIssuerCode, + + @Enumerated(EnumType.STRING) + val cardType: CardType, + + @Enumerated(EnumType.STRING) + val ownerType: CardOwnerType, + + val amount: Int, + val cardNumber: String, + val approvalNumber: String, + + @Column(name = "installment_plan_months", columnDefinition = "TINYINT") + val installmentPlanMonths: Int, + val isInterestFree: Boolean, + + @Enumerated(EnumType.STRING) + val easypayProviderCode: EasyPayCompanyCode?, + + val easypayDiscountAmount: Int? +) : PaymentDetailEntity(id, paymentId, netAmount, vat) + +@Entity +@Table(name = "payment_bank_transfer_detail") +class PaymentBankTransferDetailEntity( + id: Long, + paymentId: Long, + netAmount: Int, + vat: Int, + + @Enumerated(EnumType.STRING) + val bankCode: BankCode +) : PaymentDetailEntity(id, paymentId, netAmount, vat) + +@Entity +@Table(name = "payment_easypay_prepaid_detail") +class PaymentEasypayPrepaidDetailEntity( + id: Long, + paymentId: Long, + netAmount: Int, + vat: Int, + + @Enumerated(EnumType.STRING) + val easypayProviderCode: EasyPayCompanyCode, + + val amount: Int, + val discountAmount: Int +) : PaymentDetailEntity(id, paymentId, netAmount, vat) diff --git a/src/main/kotlin/roomescape/payment/infrastructure/persistence/v2/PaymentDetailRepository.kt b/src/main/kotlin/roomescape/payment/infrastructure/persistence/v2/PaymentDetailRepository.kt new file mode 100644 index 00000000..68723420 --- /dev/null +++ b/src/main/kotlin/roomescape/payment/infrastructure/persistence/v2/PaymentDetailRepository.kt @@ -0,0 +1,5 @@ +package roomescape.payment.infrastructure.persistence.v2 + +import org.springframework.data.jpa.repository.JpaRepository + +interface PaymentDetailRepository: JpaRepository \ No newline at end of file