-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee58e06
commit 1c70182
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/main/java/com/wedit/weditapp/domain/bankAccounts/dto/BankAccountDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.wedit.weditapp.domain.bankAccounts.dto; | ||
|
||
import com.wedit.weditapp.domain.bankAccounts.domain.BankAccounts; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class BankAccountDTO { | ||
@NotBlank(message = "side cannot be blank") | ||
private String side; // 신랑/신부 구분 | ||
|
||
@NotBlank(message = "accountNumber cannot be blank") | ||
private String accountNumber; // 계좌 번호 | ||
|
||
@NotBlank(message = "bankName cannot be blank") | ||
private String bankName; // 은행 이름 | ||
|
||
@NotBlank(message = "accountHolder cannot be blank") | ||
private String accountHolder; // 예금주 이름 | ||
|
||
@Builder | ||
private BankAccountDTO(String side, String accountNumber, String bankName, String accountHolder) { | ||
this.side = side; | ||
this.accountNumber = accountNumber; | ||
this.bankName = bankName; | ||
this.accountHolder = accountHolder; | ||
} | ||
|
||
public static BankAccountDTO from(BankAccounts bankAccount) { | ||
return BankAccountDTO.builder() | ||
.side(bankAccount.getSide().name()) | ||
.accountNumber(bankAccount.getAccountNumber()) | ||
.bankName(bankAccount.getBankName()) | ||
.accountHolder(bankAccount.getAccountHolder()) | ||
.build(); | ||
} | ||
} |