Mobile Repository (Android)
Overview
Criar interface I<Bc>Repository (domínio puro) e class <Bc>RepositoryImpl (data layer) que delega para <Bc>ApiService (Retrofit). Todos os métodos retornam suspend fun ... : Result<T>.
Guidelines
interface I<Bc>Repositoryemdomain/repository/— Kotlin puro, sem Android.<Bc>ApiServiceemdata/remote/— Retrofit interface.<Bc>Dtoemdata/remote/— data class para serialização JSON.<Bc>RepositoryImplemdata/repository/— implementa interface, captura exceções.- Toda exception de rede →
Result.failure(CustomerFailure.NetworkError(e)).
Workflow
- Criar
interface I<Bc>Repositorycom métodossuspend. - Criar
<Bc>Dto(data class com @SerializedName). - Criar
<Bc>ApiService(Retrofit interface). - Criar
<Bc>RepositoryImpl @Inject constructor(api: Service). - Registrar no
NetworkModule(Hilt).
References
- Consultar references/android-repository-pattern.md para código completo.
- Consultar ../skills-standards.md para convenções globais.
Global Standards
- Consultar ../skills-standards.md para padrões globais de nomenclatura e convenções gerais entre skills.