Skip to content

Commit

Permalink
feat: create PaymentHistory entity
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang1221 committed Sep 2, 2024
1 parent c2da100 commit 739cdd4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/main/java/co/orange/ddanzi/domain/order/PaymentHistory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package co.orange.ddanzi.domain.order;


import co.orange.ddanzi.domain.order.enums.PayStatus;
import jakarta.persistence.*;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@NoArgsConstructor
@Table(name = "payment_histories")
@Entity
public class PaymentHistory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "payment_history_id")
private Long id;

@Column(name = "buyer_id")
private Long buyerId;

@Column(name = "pay_status")
private PayStatus payStatus;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "payment_id")
private Payment payment;

@Column
private LocalDateTime createAt;

@Builder
public PaymentHistory(Long buyerId, PayStatus payStatus, Payment payment, LocalDateTime createAt) {
this.buyerId = buyerId;
this.payStatus = payStatus;
this.payment = payment;
this.createAt = createAt;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package co.orange.ddanzi.repository;

import co.orange.ddanzi.domain.order.PaymentHistory;
import org.springframework.data.jpa.repository.JpaRepository;

public interface PaymentHistoryRepository extends JpaRepository<PaymentHistory, Long> {
}

0 comments on commit 739cdd4

Please sign in to comment.