Skip to content

Commit

Permalink
feat : 은행 추가 및 지출 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ehBeak committed Dec 6, 2023
1 parent 5c80814 commit 87efedd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.connect.accountApp.domain.expense.application.port.in.command.DailyExpenseCommand;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import lombok.AccessLevel;
Expand All @@ -29,6 +30,7 @@ public class DailyExpense {
private String expenseCategoryName;
private String expenseCategoryImage;
private List settlementSubjects;
private LocalDate expenseDate;

public DailyExpense(DailyExpenseCommand command) {
this.expenseId = command.getExpenseId();
Expand All @@ -37,6 +39,7 @@ public DailyExpense(DailyExpenseCommand command) {
this.expenseCategoryName = command.getExpenseCategory().getTitle();
this.expenseCategoryImage = command.getExpenseCategory().getImgUrl();
this.settlementSubjects = Collections.EMPTY_LIST;
this.expenseDate = command.getExpenseDate();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,18 @@ public List<DailyExpenseCommand> findSearchedExpenses(Long householdId, Searched
.join(expenseJpaEntity.spender, userJpaEntity)
.where(
expenseJpaEntity.houseHoldJpaEntity.householdId.eq(householdId),
expenseJpaEntity.expenseDate.between(condition.getExpenseDateMin(),
condition.getExpenseDateMax()),
expenseJpaEntity.expenseDate.between(condition.getExpenseDateMin(), condition.getExpenseDateMax()),
eqCategory(condition.getExpenseCategory().orElse(null)),
expenseJpaEntity.expenseAmount.between(condition.getExpenseAmountMin(),
condition.getExpenseAmountMax())

expenseJpaEntity.expenseAmount.between(condition.getExpenseAmountMin(), condition.getExpenseAmountMax())
)
.orderBy(sorted)
.transform(GroupBy.groupBy(expenseJpaEntity.expenseId).list(
Projections.constructor(DailyExpenseCommand.class,
expenseJpaEntity.expenseId,
expenseJpaEntity.expenseAmount,
expenseJpaEntity.expenseStore,
expenseJpaEntity.expenseCategory
expenseJpaEntity.expenseCategory,
expenseJpaEntity.expenseDate
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.connect.accountApp.domain.expense.domain.model.ExpenseCategory;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import lombok.AccessLevel;
import lombok.Getter;
Expand All @@ -15,13 +16,15 @@ public class DailyExpenseCommand {
private BigDecimal expenseAmount;
private String expenseStore;
private ExpenseCategory expenseCategory;
private LocalDate expenseDate;

public DailyExpenseCommand(Long expenseId, BigDecimal expenseAmount, String expenseStore,
ExpenseCategory expenseCategory) {
ExpenseCategory expenseCategory, LocalDate expenseDate) {
this.expenseId = expenseId;
this.expenseAmount = expenseAmount;
this.expenseStore = expenseStore;
this.expenseCategory = expenseCategory;
this.expenseDate = expenseDate;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public enum Bank {
MG("새마을금고", "mg.png", List.of(DIGIT_12)),
POST("우체국은행", "post.png", List.of(DIGIT_12)),
KAKAO("카카오뱅크", "kakao.png", List.of(DIGIT_12)),
JEJU("제주은행", "jeju.png", List.of(DIGIT_12)),
TOSS("토스뱅크", "toss.png", List.of(DIGIT_12)),
NH("농협은행", "nh.png", List.of(DIGIT_13));

Expand Down

0 comments on commit 87efedd

Please sign in to comment.