File tree Expand file tree Collapse file tree 6 files changed +20
-59
lines changed
src/main/java/com/ClubAccount_BE/receipt Expand file tree Collapse file tree 6 files changed +20
-59
lines changed Original file line number Diff line number Diff line change 33import com .ClubAccount_BE .core .response .PagingResponse ;
44import com .ClubAccount_BE .receipt .adapter .in .web .api .FindReceiptApi ;
55import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptCategoryResponse ;
6- import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptDetailResponse ;
76import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptExpenseResponse ;
7+ import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptItemResponse ;
88import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptResponse ;
99import com .ClubAccount_BE .receipt .application .port .in .FindReceiptUseCase ;
1010import jakarta .validation .constraints .Positive ;
@@ -40,11 +40,11 @@ public PagingResponse<ReceiptResponse> getReceiptList(
4040 }
4141
4242 @ GetMapping ("/{link}/receipts/{receiptId}" )
43- public ReceiptDetailResponse getReceipt (
43+ public List < ReceiptItemResponse > getReceiptItem (
4444 @ PathVariable (value = "link" ) UUID link ,
4545 @ PathVariable ("receiptId" ) Long receiptId
4646 ) {
47- return findReceiptUseCase .getReceipt (link , receiptId );
47+ return findReceiptUseCase .getReceiptItem (link , receiptId );
4848 }
4949
5050 @ GetMapping ("/{link}/receipts/category" )
Original file line number Diff line number Diff line change 22
33import com .ClubAccount_BE .core .response .PagingResponse ;
44import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptCategoryResponse ;
5- import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptDetailResponse ;
65import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptExpenseResponse ;
6+ import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptItemResponse ;
77import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptResponse ;
88import io .swagger .v3 .oas .annotations .Operation ;
99import io .swagger .v3 .oas .annotations .tags .Tag ;
@@ -32,8 +32,8 @@ PagingResponse<ReceiptResponse> getReceiptList(
3232 @ PageableDefault (page = 1 , sort = "createdAt" , direction = Sort .Direction .ASC ) Pageable pageable
3333 );
3434
35- @ Operation (summary = "영수증 상세 목록 조회" , description = "파싱된 영수증 정보를 조회한다." )
36- ReceiptDetailResponse getReceipt (
35+ @ Operation (summary = "영수증 상세 목록 조회" , description = "파싱된 영수증 상세 아이템을 조회한다." )
36+ List < ReceiptItemResponse > getReceiptItem (
3737 @ PathVariable (value = "link" ) UUID link ,
3838 @ PathVariable ("receiptId" ) Long receiptId
3939 );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11package com .ClubAccount_BE .receipt .adapter .in .web .dto .response ;
22
33import com .ClubAccount_BE .receipt .domain .ReceiptItem ;
4- import java .util . List ;
4+ import java .math . BigDecimal ;
55import lombok .Builder ;
66
77@ Builder
88public record ReceiptItemResponse (
99 Long id ,
1010 String name ,
11- String price ,
12- String totalPrice ,
13- int quantity
11+ int quantity ,
12+ BigDecimal price ,
13+ BigDecimal totalPrice
1414) {
1515
1616 public static ReceiptItemResponse of (ReceiptItem receiptItem ) {
1717 return ReceiptItemResponse .builder ()
1818 .id (receiptItem .getId ())
1919 .name (receiptItem .getName ())
20- .price (receiptItem .getPrice ().toString ())
21- .totalPrice (receiptItem .getTotalPrice ().toString ())
2220 .quantity (receiptItem .getQuantity ())
21+ .price (receiptItem .getPrice ())
22+ .totalPrice (receiptItem .getTotalPrice ())
2323 .build ();
2424 }
25-
26- public static List <ReceiptItemResponse > of (List <ReceiptItem > items ) {
27- return items .stream ()
28- .map (ReceiptItemResponse ::of )
29- .toList ();
30- }
3125}
Original file line number Diff line number Diff line change 22
33import com .ClubAccount_BE .core .response .PagingResponse ;
44import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptCategoryResponse ;
5- import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptDetailResponse ;
65import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptExpenseResponse ;
6+ import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptItemResponse ;
77import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptResponse ;
88import java .time .LocalDate ;
99import java .util .List ;
@@ -21,7 +21,7 @@ PagingResponse<ReceiptResponse> getReceiptList(
2121 Pageable pageable
2222 );
2323
24- ReceiptDetailResponse getReceipt (UUID link , Long receiptId );
24+ List < ReceiptItemResponse > getReceiptItem (UUID link , Long receiptId );
2525
2626 List <ReceiptExpenseResponse > getReceiptExpenseList (UUID link , int year );
2727}
Original file line number Diff line number Diff line change 55import com .ClubAccount_BE .core .exception .ApiException ;
66import com .ClubAccount_BE .core .response .PagingResponse ;
77import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptCategoryResponse ;
8- import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptDetailResponse ;
98import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptExpenseResponse ;
9+ import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptItemResponse ;
1010import com .ClubAccount_BE .receipt .adapter .in .web .dto .response .ReceiptResponse ;
1111import com .ClubAccount_BE .receipt .application .port .in .FindReceiptUseCase ;
1212import com .ClubAccount_BE .receipt .application .port .out .FindReceiptPort ;
@@ -35,11 +35,14 @@ public class FindReceiptService implements FindReceiptUseCase {
3535 private final ReceiptEditor receiptEditor ;
3636
3737 @ Override
38- public ReceiptDetailResponse getReceipt (UUID link , Long receiptId ) {
38+ public List < ReceiptItemResponse > getReceiptItem (UUID link , Long receiptId ) {
3939
4040 User user = findUserPort .getUserByLink (link );
4141 Receipt receipt = findReceiptPort .getReceipt (user , receiptId );
42- return ReceiptDetailResponse .of (receipt );
42+ return receipt .getReceiptItems ()
43+ .stream ()
44+ .map (ReceiptItemResponse ::of )
45+ .toList ();
4346 }
4447
4548 @ Override
You can’t perform that action at this time.
0 commit comments