카드 매입 승인 경로 Spring Boot 3 전환 (ACX-E2E-1785394564819)
Some checks are pending
Verify / source-contract (push) Waiting to run
Some checks are pending
Verify / source-contract (push) Waiting to run
This commit is contained in:
parent
ae3098fd0f
commit
6ede413ce7
1 changed files with 89 additions and 0 deletions
89
src/main/java/com/acquirex/entity/CardAcquisition.java
Normal file
89
src/main/java/com/acquirex/entity/CardAcquisition.java
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
package com.acquirex.entity;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 카드 매입 승인 엔티티 및 리포지토리
|
||||||
|
* Spring Boot 3: javax.persistence → jakarta.persistence
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "card_acquisitions")
|
||||||
|
public class CardAcquisition {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "card_number", nullable = false, length = 16)
|
||||||
|
private String cardNumber;
|
||||||
|
|
||||||
|
@Column(name = "merchant_id", nullable = false)
|
||||||
|
private String merchantId;
|
||||||
|
|
||||||
|
@Column(name = "amount", nullable = false, precision = 15, scale = 2)
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Column(name = "currency", nullable = false, length = 3)
|
||||||
|
private String currency;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "status", nullable = false, length = 20)
|
||||||
|
private AcquisitionStatus status;
|
||||||
|
|
||||||
|
@Column(name = "approval_code", length = 12)
|
||||||
|
private String approvalCode;
|
||||||
|
|
||||||
|
@Column(name = "request_time", nullable = false)
|
||||||
|
private LocalDateTime requestTime;
|
||||||
|
|
||||||
|
@Column(name = "approval_time")
|
||||||
|
private LocalDateTime approvalTime;
|
||||||
|
|
||||||
|
@Column(name = "reject_reason", length = 255)
|
||||||
|
private String rejectReason;
|
||||||
|
|
||||||
|
public enum AcquisitionStatus {
|
||||||
|
PENDING, APPROVED, REJECTED, CANCELLED
|
||||||
|
}
|
||||||
|
|
||||||
|
public CardAcquisition() {
|
||||||
|
this.requestTime = LocalDateTime.now();
|
||||||
|
this.status = AcquisitionStatus.PENDING;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters and Setters
|
||||||
|
public Long getId() { return id; }
|
||||||
|
public void setId(Long id) { this.id = id; }
|
||||||
|
public String getCardNumber() { return cardNumber; }
|
||||||
|
public void setCardNumber(String cardNumber) { this.cardNumber = cardNumber; }
|
||||||
|
public String getMerchantId() { return merchantId; }
|
||||||
|
public void setMerchantId(String merchantId) { this.merchantId = merchantId; }
|
||||||
|
public BigDecimal getAmount() { return amount; }
|
||||||
|
public void setAmount(BigDecimal amount) { this.amount = amount; }
|
||||||
|
public String getCurrency() { return currency; }
|
||||||
|
public void setCurrency(String currency) { this.currency = currency; }
|
||||||
|
public AcquisitionStatus getStatus() { return status; }
|
||||||
|
public void setStatus(AcquisitionStatus status) { this.status = status; }
|
||||||
|
public String getApprovalCode() { return approvalCode; }
|
||||||
|
public void setApprovalCode(String approvalCode) { this.approvalCode = approvalCode; }
|
||||||
|
public LocalDateTime getRequestTime() { return requestTime; }
|
||||||
|
public void setRequestTime(LocalDateTime requestTime) { this.requestTime = requestTime; }
|
||||||
|
public LocalDateTime getApprovalTime() { return approvalTime; }
|
||||||
|
public void setApprovalTime(LocalDateTime approvalTime) { this.approvalTime = approvalTime; }
|
||||||
|
public String getRejectReason() { return rejectReason; }
|
||||||
|
public void setRejectReason(String rejectReason) { this.rejectReason = rejectReason; }
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface CardAcquisitionRepository extends JpaRepository<CardAcquisition, Long> {
|
||||||
|
List<CardAcquisition> findByStatus(AcquisitionStatus status);
|
||||||
|
Optional<CardAcquisition> findByApprovalCode(String approvalCode);
|
||||||
|
List<CardAcquisition> findByMerchantId(String merchantId);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue