fix: 분석화면 총지출 금액 불일치 및 다국어 지원 개선

- 월별지출현황과 총지출요약 카드의 7월 금액 불일치 수정
- 현재 월은 currentPrice 사용, 과거 월은 이벤트 기간 체크
- 월별 차트 라벨 다국어 지원 추가 (한/영/일/중)
- 홈/분석 화면 총지출 금액 통일을 위한 통화 변환 로직 모듈화
- ExchangeRateService에 convertBetweenCurrencies 메서드 추가
- CurrencyUtil 및 SubscriptionProvider 리팩토링

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
JiWoong Sul
2025-07-17 00:07:24 +09:00
parent 46883f7314
commit 91bc91383b
3 changed files with 121 additions and 97 deletions

View File

@@ -117,22 +117,13 @@ class CurrencyUtil {
for (var subscription in subscriptions) {
final price = subscription.currentPrice;
if (subscription.currency == defaultCurrency) {
// 기본 통화면 그대로 합산
total += price;
} else if (subscription.currency == 'USD') {
// USD면 기본 통화로 변환
final converted = await _exchangeRateService.convertUsdToTarget(price, defaultCurrency);
if (converted != null) {
total += converted;
}
} else if (defaultCurrency == 'USD') {
// 기본 통화가 USD인 경우 다른 통화를 USD로 변환
final converted = await _exchangeRateService.convertTargetToUsd(price, subscription.currency);
if (converted != null) {
total += converted;
}
}
final converted = await _exchangeRateService.convertBetweenCurrencies(
price,
subscription.currency,
defaultCurrency,
);
total += converted ?? price;
}
return total;
@@ -188,20 +179,13 @@ class CurrencyUtil {
if (subscription.isCurrentlyInEvent) {
final savings = subscription.eventSavings;
if (subscription.currency == defaultCurrency) {
total += savings;
} else if (subscription.currency == 'USD') {
final converted = await _exchangeRateService.convertUsdToTarget(savings, defaultCurrency);
if (converted != null) {
total += converted;
}
} else if (defaultCurrency == 'USD') {
// 기본 통화가 USD인 경우 다른 통화를 USD로 변환
final converted = await _exchangeRateService.convertTargetToUsd(savings, subscription.currency);
if (converted != null) {
total += converted;
}
}
final converted = await _exchangeRateService.convertBetweenCurrencies(
savings,
subscription.currency,
defaultCurrency,
);
total += converted ?? savings;
}
}