feat: 데이터 가져오기(복구) — 엑셀 백업으로 전체 교체 (트랜잭션)

- POST /api/account/restore: 기존 데이터 전부 삭제 후 이름 기준 재생성
  (계좌→태그→분류(대/소)→내역→고정→예산→자주내역), 한 트랜잭션(실패 시 롤백)
- 빈 데이터 안전장치, 투자 종목/매매는 복구 대상 외(삭제됨)
- BackupMapper(deleteByMember), RestoreRequest DTO, BackupService/Controller

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-06-28 08:38:21 +09:00
co-authored by Claude Opus 4.8
parent bf6fb97ed8
commit 3b46d2ba09
5 changed files with 350 additions and 0 deletions
@@ -0,0 +1,23 @@
package com.sb.web.account.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 데이터 복구 시 회원의 기존 가계부 데이터를 전부 삭제(트랜잭션 내에서 호출).
*/
@Mapper
public interface BackupMapper {
int deleteEntryTags(@Param("memberId") Long memberId);
int deleteEntries(@Param("memberId") Long memberId);
int deleteRecurrings(@Param("memberId") Long memberId);
int deleteBudgets(@Param("memberId") Long memberId);
int deleteBudgetIncome(@Param("memberId") Long memberId);
int deleteQuickEntries(@Param("memberId") Long memberId);
int deleteInvestTrades(@Param("memberId") Long memberId);
int deleteInvestHoldings(@Param("memberId") Long memberId);
int deleteCategories(@Param("memberId") Long memberId);
int deleteTags(@Param("memberId") Long memberId);
int deleteWallets(@Param("memberId") Long memberId);
}