Skip to content
Open
21 changes: 21 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,25 @@

### Mapper Pattern
- Internal mappers: `internal interface FooMapper` + `internal class FooMapperImpl`
- **No DTO suffix on mappers** - Use `InboxSearchMapper`, not `InboxSearchDTOMapper`
- Use `with` scope function for cleaner code

### Cache vs Repository Naming
- **In-memory caches are NOT repositories** - Use `InboxInMemoryCache`, not `InboxRepository`
- **Use InMemoryCacheProvider** for in-memory caches, not custom `MutableStateFlow` implementations
- **Repository** = data access with external sources (API, database)
- **Cache** = in-memory storage only

### DI Module Rules
- **Use method references, not lambdas** - `RefreshCache(manager::refresh)` not `RefreshCache { manager.refresh() }`
- **Don't use @Singleton if state is external** - If cache/state is passed in constructor, no need for @Singleton
- **Keep providers in correct feature modules** - `InboxApiService` belongs in `InboxModule`, not `JointAccountModule`

### Feature Ownership
- **Methods belong to their feature** - `getInboxMessages` belongs in inbox feature, not joint account
- **Don't mix feature concerns** - Each repository handles only its own feature's API calls
- **Cross-feature dependencies use interfaces** - Features depend on each other via domain interfaces, not implementations

## Code Quality

### Functions
Expand Down Expand Up @@ -167,6 +184,10 @@
- [ ] Unit tests for data/domain layers
- [ ] Internal classes marked `internal`
- [ ] Content descriptions for accessibility
- [ ] In-memory caches use `InMemoryCacheProvider`, not custom StateFlow
- [ ] No DTO suffix on mappers
- [ ] Method references used in DI, not lambdas
- [ ] Methods are in correct feature modules

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ import com.algorand.android.ui.common.amount.mapper.AmountRendererTypeMapper
import com.algorand.android.utils.formatAsAlgoAmount
import com.algorand.android.utils.formatAsAlgoDisplayString
import com.algorand.wallet.account.detail.domain.model.AccountType
import com.algorand.wallet.asset.assetinbox.domain.usecase.GetAssetInboxRequest
import com.algorand.wallet.inbox.asset.domain.usecase.GetAssetInboxRequest
import com.algorand.wallet.privacy.domain.model.PrivacyMode
import com.algorand.wallet.privacy.domain.usecase.GetPrivacyModeFlow
import com.algorand.wallet.remoteconfig.domain.model.FeatureToggle
import com.algorand.wallet.remoteconfig.domain.usecase.IsFeatureToggleEnabled
import java.math.BigDecimal
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import java.math.BigDecimal
import javax.inject.Inject

internal class DefaultAccountDetailAccountsItemProcessor @Inject constructor(
private val getAccountLiteCacheFlow: GetAccountLiteCacheFlow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import com.algorand.android.modules.accounts.ui.model.AccountPreview
import com.algorand.android.modules.parity.domain.model.SelectedCurrencyDetail
import com.algorand.android.modules.peraconnectivitymanager.ui.PeraConnectivityManager
import com.algorand.android.utils.CacheResult
import com.algorand.wallet.asset.assetinbox.domain.usecase.GetAssetInboxRequestCountFlow
import com.algorand.wallet.banner.domain.usecase.GetBannerFlow
import com.algorand.wallet.inbox.asset.domain.usecase.GetAssetInboxRequestCountFlow
import com.algorand.wallet.privacy.domain.usecase.GetPrivacyModeFlow
import com.algorand.wallet.spotbanner.domain.model.SpotBannerFlowData
import com.algorand.wallet.spotbanner.domain.usecase.GetSpotBannersFlow
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading