From b33f7d9b1181cb1f05ccf2b20c78067f04bc4937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EB=B3=91=EC=B2=A0?= Date: Tue, 17 Mar 2026 15:52:50 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[settings]=20=EB=B0=94=EB=A1=9C?= =?UTF-8?q?=EB=B9=8C=20=EC=97=B0=EB=8F=99=20=EA=B8=B0=EB=8A=A5=20=EB=B3=B4?= =?UTF-8?q?=EA=B0=95=20+=20=EC=9D=80=ED=96=89/=EC=B9=B4=EB=93=9C=20?= =?UTF-8?q?=EA=B1=B0=EB=9E=98=20=EC=A1=B0=ED=9A=8C=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 바로빌 연동: 액션/타입 확장, UI 보강 - 은행/카드 거래 조회 개선 - 공지 팝업 모달 수정 --- .../BankTransactionInquiry/index.tsx | 39 +++- .../CardTransactionInquiry/index.tsx | 39 +++- .../NoticePopupModal/NoticePopupModal.tsx | 11 +- .../settings/BarobillIntegration/actions.ts | 77 ++++++- .../settings/BarobillIntegration/index.tsx | 217 +++++++++++++++++- .../settings/BarobillIntegration/types.ts | 24 ++ 6 files changed, 394 insertions(+), 13 deletions(-) diff --git a/src/components/accounting/BankTransactionInquiry/index.tsx b/src/components/accounting/BankTransactionInquiry/index.tsx index e70c8ee5..996b09b3 100644 --- a/src/components/accounting/BankTransactionInquiry/index.tsx +++ b/src/components/accounting/BankTransactionInquiry/index.tsx @@ -54,6 +54,7 @@ import { type BankTransactionSummaryData, } from './actions'; import { TransactionFormModal } from './TransactionFormModal'; +import { syncBankTransactions } from '@/components/settings/BarobillIntegration/actions'; import { isNextRedirectError } from '@/lib/utils/redirect-error'; import { formatNumber } from '@/lib/utils/amount'; import { downloadExcel, type ExcelColumn } from '@/lib/utils/excel-download'; @@ -130,6 +131,7 @@ export function BankTransactionInquiry() { // 수정 추적 (로컬 변경사항) const [localChanges, setLocalChanges] = useState>>(new Map()); const [isBatchSaving, setIsBatchSaving] = useState(false); + const [isSyncing, setIsSyncing] = useState(false); // ===== 데이터 로드 ===== const loadData = useCallback(async () => { @@ -241,6 +243,26 @@ export function BankTransactionInquiry() { } }, [localChanges, loadData]); + // 바로빌 동기화 + const handleSync = useCallback(async () => { + setIsSyncing(true); + try { + const sd = startDate.replace(/-/g, ''); + const ed = endDate.replace(/-/g, ''); + const result = await syncBankTransactions(sd, ed); + if (result.success && result.data) { + toast.success(`은행 거래 ${result.data.synced}건 동기화 완료`); + loadData(); + } else { + toast.error(result.error || '동기화에 실패했습니다.'); + } + } catch { + toast.error('동기화 중 오류가 발생했습니다.'); + } finally { + setIsSyncing(false); + } + }, [startDate, endDate, loadData]); + // 엑셀 다운로드 (프론트 xlsx 생성) const handleExcelDownload = useCallback(async () => { try { @@ -359,9 +381,22 @@ export function BankTransactionInquiry() { onEndDateChange: setEndDate, }, - // 헤더 액션: ①저장 + 엑셀 다운로드 + ②수기 입력 + // 헤더 액션: 동기화 + ①저장 + 엑셀 다운로드 + ②수기 입력 headerActions: () => (
+ +
+ )} + {balanceLow && ( +
+ + 바로빌 충전잔액이 부족합니다. (현재: {balance?.toLocaleString()}원) +
+ )} + + )} + + + + )} + + {/* ===== 등록된 계좌/카드 목록 ===== */} + {(accounts.length > 0 || cards.length > 0) && ( +
+
+ {/* 등록된 계좌 */} + {accounts.length > 0 && ( +
+

+ 등록된 계좌 {accounts.length}개 +

+ + +
    + {accounts.map((acc, idx) => ( +
  • + + {acc.bankName} + {acc.bankAccountNum} +
  • + ))} +
+
+
+
+ )} + + {/* 등록된 카드 */} + {cards.length > 0 && ( +
+

+ 등록된 카드 {cards.length}개 +

+ + +
    + {cards.map((card, idx) => ( +
  • + + {card.cardCompanyName} + {card.cardNum} + {card.alias && ( + ({card.alias}) + )} +
  • + ))} +
+
+
+
+ )} +
+
+ )} + + {/* ===== 바로빌 연동 ===== */}

바로빌 연동

@@ -144,7 +347,7 @@ export function BarobillIntegration() {
- {/* 계좌 연동 */} + {/* ===== 계좌 연동 ===== */}

계좌 연동

@@ -200,7 +403,7 @@ export function BarobillIntegration() {
- {/* 카드 연동 & 공인인증서 등록 */} + {/* ===== 카드 연동 & 공인인증서 등록 ===== */}
{/* 카드 연동 */}
diff --git a/src/components/settings/BarobillIntegration/types.ts b/src/components/settings/BarobillIntegration/types.ts index f9186153..5ed6a29e 100644 --- a/src/components/settings/BarobillIntegration/types.ts +++ b/src/components/settings/BarobillIntegration/types.ts @@ -54,10 +54,34 @@ export const ACCOUNT_TYPE_OPTIONS = [ export interface IntegrationStatus { bankServiceCount: number; accountLinkCount: number; + cardCount: number; member?: { barobillId: string; bizNo: string; + corpName: string; status: string; serverMode: string; }; } + +// ===== 등록 계좌 ===== +export interface RegisteredAccount { + bankAccountNum: string; + bankName: string; + bankCode: string; +} + +// ===== 등록 카드 ===== +export interface RegisteredCard { + cardNum: string; + cardCompany: string; + cardCompanyName: string; + alias: string; +} + +// ===== 인증서 상태 ===== +export interface CertificateInfo { + is_valid: boolean; + expire_date: string | null; + regist_date: string | null; +}