-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
3 changed files
with
69 additions
and
14 deletions.
There are no files selected for viewing
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
35 changes: 35 additions & 0 deletions
35
server/src/main/java/kr/or/kosa/cmsplusmain/domain/billing/dto/InvoiceRes.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,35 @@ | ||
package kr.or.kosa.cmsplusmain.domain.billing.dto; | ||
|
||
import kr.or.kosa.cmsplusmain.domain.billing.entity.Billing; | ||
import kr.or.kosa.cmsplusmain.domain.billing.entity.BillingStatus; | ||
import kr.or.kosa.cmsplusmain.domain.member.dto.MemberDto; | ||
import kr.or.kosa.cmsplusmain.domain.member.entity.Member; | ||
import kr.or.kosa.cmsplusmain.domain.payment.dto.type.PaymentTypeInfoRes; | ||
import kr.or.kosa.cmsplusmain.domain.payment.entity.type.PaymentType; | ||
import kr.or.kosa.cmsplusmain.domain.payment.entity.type.PaymentTypeInfo; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class InvoiceRes { | ||
private final Long billingId; | ||
private final String billingStatus; | ||
private final MemberDto member; | ||
private final String invoiceName; | ||
private final String invoiceMessage; | ||
private final Long billingPrice; | ||
private final PaymentTypeInfoRes paymentType; | ||
|
||
public static InvoiceRes fromEntity(Billing billing, Member member, PaymentTypeInfoRes paymentType) { | ||
return InvoiceRes.builder() | ||
.billingId(billing.getId()) | ||
.billingStatus(billing.getBillingStatus().getTitle()) | ||
.member(MemberDto.fromEntity(member)) | ||
.invoiceName(billing.getInvoiceName()) | ||
.invoiceMessage(billing.getInvoiceMessage()) | ||
.billingPrice(billing.getBillingPrice()) | ||
.paymentType(paymentType) | ||
.build(); | ||
} | ||
} |
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