feat: 결제 상세 정보를 저장하는 PaymentDetailEntity 정의

This commit is contained in:
이상진 2025-08-15 18:43:28 +09:00
parent c2906ee430
commit 63d4f93d31
2 changed files with 83 additions and 0 deletions

View File

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

View File

@ -0,0 +1,5 @@
package roomescape.payment.infrastructure.persistence.v2
import org.springframework.data.jpa.repository.JpaRepository
interface PaymentDetailRepository: JpaRepository<PaymentDetailEntity, Long>