fix(account): 출금 계좌 종류 — 카드는 지출일 때만 노출
Deploy / deploy (push) Failing after 15m27s

수입·이체·상환은 카드/대출에서 나가지 않으므로 카드 제외(대출은 이미 제외).
구분 변경 시 허용 안 되는 계좌 종류면 초기화. AccountView·RecurringView 동일 적용.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
sb
2026-07-06 23:16:03 +09:00
parent 810a5d9380
commit 1b2d6a2c02
2 changed files with 27 additions and 5 deletions
+15 -3
View File
@@ -347,7 +347,15 @@ const WALLET_KINDS = [
{ value: 'INVEST', label: '증권' },
]
// 출금/결제 계좌 종류 뱃지에서는 대출 제외 — 대출은 지출·이체의 '출처'가 아니라 상환 대상
const FROM_WALLET_KINDS = WALLET_KINDS.filter((k) => k.value !== 'LOAN')
// 출금/결제 계좌 종류: 대출은 항상 제외(상환 대상), 카드는 '지출'(카드결제)일 때만 노출.
// 수입·이체·상환은 카드/대출에서 나가지 않음.
const fromWalletKinds = computed(() =>
WALLET_KINDS.filter((k) => {
if (k.value === 'LOAN') return false
if (k.value === 'CARD') return form.type === 'EXPENSE'
return true
}),
)
const TYPES = [
{ value: 'EXPENSE', label: '지출', cls: 'chip-expense' },
{ value: 'INCOME', label: '수입', cls: 'chip-income' },
@@ -402,9 +410,13 @@ async function loadCategories() {
// 필터용 전체 분류명 (중복 제거)
const allCategoryNames = computed(() => [...new Set(categories.value.map((c) => c.name))])
// 구분(수입/지출/이체) 변경 시 분류 초기화
// 구분(수입/지출/이체) 변경 시 분류 초기화 + 새 구분에서 허용 안 되는 계좌 종류면 초기화
function onTypeChange() {
form.category = ''
if (!fromWalletKinds.value.some((k) => k.value === form.walletKind)) {
form.walletKind = ''
form.walletId = ''
}
}
// 태그 (태그 관리에 등록된 태그 선택)
@@ -1148,7 +1160,7 @@ onMounted(async () => {
<div class="field">
<span class="field-label">계좌 종류</span>
<div class="wallet-chips">
<button v-for="k in FROM_WALLET_KINDS" :key="k.value" type="button"
<button v-for="k in fromWalletKinds" :key="k.value" type="button"
class="chip" :class="{ active: form.walletKind === k.value }"
:disabled="submitting" @click="form.walletKind = k.value; onWalletKindChange()">
{{ k.label }}