Skip to content

Refactor: Firestore DI & Repository 정리#90

Open
JUDYLEE-cloud wants to merge 8 commits intodevelopfrom
refact/DI
Open

Refactor: Firestore DI & Repository 정리#90
JUDYLEE-cloud wants to merge 8 commits intodevelopfrom
refact/DI

Conversation

@JUDYLEE-cloud
Copy link
Copy Markdown
Collaborator

✨ What’s this PR?

🧶 주요 변경 내용 (Summary)

  • FirestoreManager, Repository
    • DuoBattleRepository·FriendRepository·RunRecordRepository: Firebase Firestore 직접 접근 코드를 FirestoreManagerProtocol 기반으로 통일
    • 점령전/친구/보상 도메인을 분리하기 위해 RewardRepository 및 RewardRepositoryProtocol을 신규 추가하고, Users/{uid}/minionUnlocks 컬렉션 조회 로직을 레포지토리로 캡슐화
  • FriendView, FriendRequestView를 뷰모델로 분리
  • 레포지토리를 구체 타입 필드 + 즉시 생성 방식에서 -> 프로토콜 타입 필드 + init 주입 방식으로 리팩토링

🧪 테스트 / 검증 내역

  • UI 정상 동작 확인

✅ 체크리스트

  • 파이어베이스 info 파일이 들어가있진 않은지 확인
  • 머지하려는 브랜치 재확인
  • Assignee 설정
  • 필요없는 주석 삭제했는지
  • 하드 코딩된 부분이 없는지
  • 가독성 있는지 (뷰 분리, 함수/변수 명)
  • 작업 내용 한 번 더 확인

@JUDYLEE-cloud JUDYLEE-cloud self-assigned this Mar 7, 2026
@JUDYLEE-cloud JUDYLEE-cloud changed the title Refact/di Refactor: Firestore DI & Repository 정리 Mar 7, 2026
@JUDYLEE-cloud
Copy link
Copy Markdown
Collaborator Author

  1. repository 생성시 필요한 의존성을 외부에서 주입하는 방식 생각해보기 (init 주입 방식 다시 생각)
  2. 뷰모델은 레포지토리만 호출하고, 레포지토리에서 store/datamanager를 판단하도록 (캐싱 판단)
  • ViewModel의 책임을 UI 상태 관리로 제한
  • 데이터 전략(Store vs Network)에 대한 의존 제거
  • 변경 영향 범위를 Repository 내부로 제한

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant