feat: 계좌 관리에 현금(CASH) 유형 추가
CI / build (push) Failing after 14m23s

- WalletRequest 유형 검증에 CASH 허용
- netWorth: CASH를 자산으로 합산(기존 else 분기에서 부채로 잡히던 것 방지)
- 추이(trend)는 부호있는 openingBalance+흐름이라 CASH 자동 반영(변경 불필요)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-06-14 15:43:29 +09:00
parent 553855b31c
commit 6eef6cbd29
2 changed files with 3 additions and 3 deletions
@@ -14,7 +14,7 @@ import java.time.LocalDate;
public class WalletRequest {
@NotBlank(message = "유형을 선택하세요.")
@Pattern(regexp = "BANK|CARD|LOAN|INVEST", message = "유형이 올바르지 않습니다.")
@Pattern(regexp = "BANK|CASH|CARD|LOAN|INVEST", message = "유형이 올바르지 않습니다.")
private String type;
@NotBlank(message = "이름을 입력하세요.")
@@ -390,7 +390,7 @@ public class AccountService {
.toList();
}
/** 순자산 = 총자산(BANK) 총부채(CARD/LOAN) */
/** 순자산 = 총자산(BANK/CASH/INVEST) 총부채(CARD/LOAN) */
public NetWorthResponse netWorth(Long memberId) {
Map<Long, Long> balances = balanceMap(memberId);
Map<Long, InvestService.WalletInvest> inv = investService.valuationByWallet(memberId);
@@ -407,7 +407,7 @@ public class AccountService {
InvestService.WalletInvest wi = inv.getOrDefault(w.getId(), new InvestService.WalletInvest());
assets += bal + wi.cashDelta + wi.stockEval;
}
} else if ("BANK".equals(w.getType())) {
} else if ("BANK".equals(w.getType()) || "CASH".equals(w.getType())) {
assets += bal;
} else {
liabilities += -bal; // 부채는 음수 잔액 → 양수 부채로 표시