[230319] 결제완료 command 개발
- 각 폴더 구조 생성 - 도메인 Event 구조 생성 - kafka message sender 테스트까지 확인 - 결제 완료 예시 application service
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.example.user.domain;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
|
||||
@Entity
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class Cash {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
private BigDecimal amount;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn
|
||||
private User user;
|
||||
|
||||
@CreatedDate
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@LastModifiedDate
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public static Cash of(BigDecimal amount, User user) {
|
||||
return new Cash(UUID.fromString("cash").toString(), amount, user, null, null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user