Skip to content
29 changes: 0 additions & 29 deletions Data/Sources/Repository/Kakao/KakaoFinalizeRepository.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import Foundation

import Dependencies
/// Analytics 이벤트 전송을 위한 Repository 프로토콜
public protocol AnalyticsRepositoryProtocol: Sendable {
func sendEvent(_ event: AnalyticsEvent) async
}

// MARK: - Dependencies
public struct AnalyticsRepositoryDependency: DependencyKey {
public static var liveValue: AnalyticsRepositoryProtocol {
fatalError("AnalyticsRepositoryDependency liveValue not implemented")
}
public static var previewValue: AnalyticsRepositoryProtocol = MockAnalyticsRepository()
public static var testValue: AnalyticsRepositoryProtocol = MockAnalyticsRepository()
}

public extension DependencyValues {
var analyticsRepository: AnalyticsRepositoryProtocol {
get { self[AnalyticsRepositoryDependency.self] }
set { self[AnalyticsRepositoryDependency.self] = newValue }
}
}
37 changes: 27 additions & 10 deletions Domain/Sources/Repository/Auth/AuthRepositoryProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,34 @@
//

import Foundation
import Dependencies

public protocol AuthRepositoryProtocol {
// 세션/토큰
func refresh(token: String) async throws -> TokenResult
func logout(sessionId: String) async throws -> LogoutStatus
func delete() async throws -> AuthDeleteStatus
func registerDeviceToken(token: String) async throws -> DeviceToken
// 세션/토큰
func refresh(token: String) async throws -> TokenResult
func logout(sessionId: String) async throws -> LogoutStatus
func delete() async throws -> AuthDeleteStatus
func registerDeviceToken(token: String) async throws -> DeviceToken

// 인증/가입
func checkUser(input: OAuthUserInput) async throws -> OAuthCheckUser
func login(input: OAuthUserInput) async throws -> AuthResult
func signUp(input: OAuthUserInput) async throws -> AuthResult
func finalizeKakao(ticket: String) async throws -> AuthResult
}

// MARK: - Dependencies
public struct AuthRepositoryDependency: DependencyKey {
public static var liveValue: AuthRepositoryProtocol {
fatalError("AuthRepositoryDependency liveValue not implemented")
}
public static var previewValue: AuthRepositoryProtocol = MockAuthRepository()
public static var testValue: AuthRepositoryProtocol = MockAuthRepository()
}

// 인증/가입
func checkUser(input: OAuthUserInput) async throws -> OAuthCheckUser
func login(input: OAuthUserInput) async throws -> AuthResult
func signUp(input: OAuthUserInput) async throws -> AuthResult
func finalizeKakao(ticket: String) async throws -> AuthResult
public extension DependencyValues {
var authRepository: AuthRepositoryProtocol {
get { self[AuthRepositoryDependency.self] }
set { self[AuthRepositoryDependency.self] = newValue }
}
}
17 changes: 17 additions & 0 deletions Domain/Sources/Repository/Country/CountryRepositoryProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,24 @@
//

import Foundation
import Dependencies

public protocol CountryRepositoryProtocol {
func fetchCountries() async throws -> [Country]
}

// MARK: - Dependencies
public struct CountryRepositoryDependencyKey: DependencyKey {
public static var liveValue: CountryRepositoryProtocol {
fatalError("CountryRepositoryDependency liveValue not implemented")
}
public static var previewValue: CountryRepositoryProtocol = MockCountriesRepository()
public static var testValue: CountryRepositoryProtocol = MockCountriesRepository()
}

public extension DependencyValues {
var countryRepository: CountryRepositoryProtocol {
get { self[CountryRepositoryDependencyKey.self] }
set { self[CountryRepositoryDependencyKey.self] = newValue }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@
//

import Foundation
import Dependencies

public protocol ExchangeRateRepositoryProtocol {
func fetchExchangeRate(base: String) async throws -> ExchangeRate
}

public struct ExchangeRateRepositoryDependencyKey: DependencyKey {
public static var liveValue: ExchangeRateRepositoryProtocol {
fatalError("ExchangeRateRepositoryDependencyKey liveValue not implemented")
}
public static var previewValue: ExchangeRateRepositoryProtocol = MockExchangeRateRepository()
public static var testValue: ExchangeRateRepositoryProtocol = MockExchangeRateRepository()
}

public extension DependencyValues {
var exchangeRateRepository: ExchangeRateRepositoryProtocol {
get { self[ExchangeRateRepositoryDependencyKey.self] }
set { self[ExchangeRateRepositoryDependencyKey.self] = newValue }
}
}
20 changes: 19 additions & 1 deletion Domain/Sources/Repository/Login/LoginRepositoryProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@
//
// Created by Wonji Suh on 11/26/25.
//
import Foundation
import Dependencies

public protocol LoginRepositoryProtocol {
func login(input: OAuthUserInput) async throws -> AuthResult
func login(input: OAuthUserInput) async throws -> AuthResult
}

// MARK: - Dependencies
public struct LoginRepositoryDependency: DependencyKey {
public static var liveValue: LoginRepositoryProtocol {
fatalError("LoginRepositoryDependency liveValue not implemented")
}
public static var previewValue: LoginRepositoryProtocol = MockLoginRepository()
public static var testValue: LoginRepositoryProtocol = MockLoginRepository()
}

public extension DependencyValues {
var loginRepository: LoginRepositoryProtocol {
get { self[LoginRepositoryDependency.self] }
set { self[LoginRepositoryDependency.self] = newValue }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ import Foundation
import Dependencies

public protocol AppleOAuthRepositoryProtocol {
func signIn() async throws -> AppleOAuthPayload
func signIn() async throws -> AppleOAuthPayload
}

// MARK: - Dependencies
public struct AppleOAuthServiceDependency: DependencyKey {
public static var liveValue: AppleOAuthRepositoryProtocol = MockAppleOAuthRepository()
public static var previewValue: AppleOAuthRepositoryProtocol = MockAppleOAuthRepository()
public static var testValue: AppleOAuthRepositoryProtocol = MockAppleOAuthRepository()
public struct AppleOAuthRepositoryDependencyKey: DependencyKey {
public static var liveValue: AppleOAuthRepositoryProtocol {
fatalError("AppleOAuthServiceDependency liveValue not implemented")
}
public static var previewValue: AppleOAuthRepositoryProtocol = MockAppleOAuthRepository()
public static var testValue: AppleOAuthRepositoryProtocol = MockAppleOAuthRepository()
}

public extension DependencyValues {
var appleOAuthService: AppleOAuthRepositoryProtocol {
get { self[AppleOAuthServiceDependency.self] }
set { self[AppleOAuthServiceDependency.self] = newValue }
}
var appleOAuthRepository: AppleOAuthRepositoryProtocol {
get { self[AppleOAuthRepositoryDependencyKey.self] }
set { self[AppleOAuthRepositoryDependencyKey.self] = newValue }
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// GoogleOAuthServicing.swift
// GoogleOAuthRepositoryProtocol.swift
// Domain
//
// Created by Wonji Suh on 11/17/25.
Expand All @@ -9,6 +9,21 @@ import Foundation
import Dependencies

public protocol GoogleOAuthRepositoryProtocol {
func signIn() async throws -> GoogleOAuthPayload
func signIn() async throws -> GoogleOAuthPayload
}

// MARK: - Dependencies
public struct GoogleOAuthRepositoryDependencyKey: DependencyKey {
public static var liveValue: GoogleOAuthRepositoryProtocol {
fatalError("GoogleOAuthServiceDependency liveValue not implemented")
}
public static var previewValue: GoogleOAuthRepositoryProtocol = MockGoogleOAuthRepository()
public static var testValue: GoogleOAuthRepositoryProtocol = MockGoogleOAuthRepository()
}

public extension DependencyValues {
var googleOAuthRepository: GoogleOAuthRepositoryProtocol {
get { self[GoogleOAuthRepositoryDependencyKey.self] }
set { self[GoogleOAuthRepositoryDependencyKey.self] = newValue }
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,21 @@ import Foundation
import Dependencies

public protocol KakaoOAuthRepositoryProtocol {
func signIn() async throws -> KakaoOAuthPayload
func signIn() async throws -> KakaoOAuthPayload
}

// MARK: - Dependencies
public struct KakaoOAuthRepositoryDependencyKey: DependencyKey {
public static var liveValue: KakaoOAuthRepositoryProtocol {
fatalError("KakaoOAuthRepositoryDependency liveValue not implemented")
}
public static var previewValue: KakaoOAuthRepositoryProtocol = MockKakaoOAuthRepository()
public static var testValue: KakaoOAuthRepositoryProtocol = MockKakaoOAuthRepository()
}

public extension DependencyValues {
var kakaoOAuthRepository: KakaoOAuthRepositoryProtocol {
get { self[KakaoOAuthRepositoryDependencyKey.self] }
set { self[KakaoOAuthRepositoryDependencyKey.self] = newValue }
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,32 @@
//

import Foundation
import ComposableArchitecture
import Dependencies

public protocol OAuthRepositoryProtocol {
func signIn(
provider: SocialType,
idToken: String,
nonce: String?,
displayName: String?,
authorizationCode: String?
) async throws -> UserProfile
func updateUserDisplayName(_ name: String) async throws
func signIn(
provider: SocialType,
idToken: String,
nonce: String?,
displayName: String?,
authorizationCode: String?
) async throws -> UserProfile

func updateUserDisplayName(_ name: String) async throws
}

// MARK: - Dependencies
public struct OAuthRepositoryDependency: DependencyKey {
public static var liveValue: OAuthRepositoryProtocol {
fatalError("OAuthRepositoryDependency liveValue not implemented")
}
public static var previewValue: OAuthRepositoryProtocol = MockOAuthRepository()
public static var testValue: OAuthRepositoryProtocol = MockOAuthRepository()
}

public extension DependencyValues {
var oAuthRepository: OAuthRepositoryProtocol {
get { self[OAuthRepositoryDependency.self] }
set { self[OAuthRepositoryDependency.self] = newValue }
}
}
21 changes: 19 additions & 2 deletions Domain/Sources/Repository/Profile/ProfileRepositoryProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,25 @@
//

import Foundation
import Dependencies

public protocol ProfileRepositoryProtocol {
func getProfile() async throws -> Profile
func editProfile(name: String?, avatarData: Data?, fileName: String?) async throws -> Profile
func getProfile() async throws -> Profile
func editProfile(name: String?, avatarData: Data?, fileName: String?) async throws -> Profile
}

// MARK: - Dependencies
private struct ProfileRepositoryDependencyKey: DependencyKey {
public static var liveValue: ProfileRepositoryProtocol {
fatalError("ProfileRepositoryDependency liveValue not implemented")
}
public static var previewValue: ProfileRepositoryProtocol = MockProfileRepository()
public static var testValue: ProfileRepositoryProtocol = MockProfileRepository()
}

public extension DependencyValues {
var profileRepository: ProfileRepositoryProtocol {
get { self[ProfileRepositoryDependencyKey.self] }
set { self[ProfileRepositoryDependencyKey.self] = newValue }
}
}
Loading