[PR #6674] [MERGED] [PM-33509] feat: Add BillingRepository and Hilt billing modules #32783

Closed
opened 2026-04-18 16:09:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6674
Author: @SaintPatrck
Created: 3/16/2026
Status: Merged
Merged: 3/18/2026
Merged by: @SaintPatrck

Base: mainHead: premium-upgrade/PM-33509-billing-repository


📝 Commits (3)

  • 2aaac13 [PM-33509] feat: Add BillingRepository and Hilt billing modules
  • 1f7424f Add custom result types for BillingRepository functions
  • d692519 Use userFriendlyMessage default and asSuccess/asFailure helpers

📊 Changes

7 files changed (+230 additions, -0 deletions)

View changed files

app/src/main/kotlin/com/x8bit/bitwarden/data/billing/datasource/network/di/BillingNetworkModule.kt (+23 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/billing/di/BillingModule.kt (+26 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/BillingRepository.kt (+20 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/BillingRepositoryImpl.kt (+29 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/model/CheckoutSessionResult.kt (+25 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/model/CustomerPortalResult.kt (+25 -0)
app/src/test/kotlin/com/x8bit/bitwarden/data/billing/repository/BillingRepositoryTest.kt (+82 -0)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-33509

📔 Objective

Create BillingRepository and BillingRepositoryImpl to abstract billing service operations into a repository layer, plus Hilt DI modules (BillingModule, BillingNetworkModule) for dependency injection wiring.

  • BillingRepository interface exposes getCheckoutSessionUrl() and getPortalUrl() returning domain-specific sealed class result types (CheckoutSessionResult, CustomerPortalResult)
  • BillingRepositoryImpl delegates to BillingService and maps response models using .fold() into the appropriate result types
  • BillingNetworkModule provides BillingService via BitwardenServiceClient
  • BillingModule provides BillingRepository as a singleton
  • Unit tests cover success and failure paths for both repository methods

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6674 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 3/16/2026 **Status:** ✅ Merged **Merged:** 3/18/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `premium-upgrade/PM-33509-billing-repository` --- ### 📝 Commits (3) - [`2aaac13`](https://github.com/bitwarden/android/commit/2aaac13f6fe069aa4b234e840d2cb7b0a40a90cc) [PM-33509] feat: Add BillingRepository and Hilt billing modules - [`1f7424f`](https://github.com/bitwarden/android/commit/1f7424fa2047ad30576a5947b8bf935353487438) Add custom result types for BillingRepository functions - [`d692519`](https://github.com/bitwarden/android/commit/d69251967144f399f2c262726772dd8945a36edd) Use userFriendlyMessage default and asSuccess/asFailure helpers ### 📊 Changes **7 files changed** (+230 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/datasource/network/di/BillingNetworkModule.kt` (+23 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/di/BillingModule.kt` (+26 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/BillingRepository.kt` (+20 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/BillingRepositoryImpl.kt` (+29 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/model/CheckoutSessionResult.kt` (+25 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/model/CustomerPortalResult.kt` (+25 -0) ➕ `app/src/test/kotlin/com/x8bit/bitwarden/data/billing/repository/BillingRepositoryTest.kt` (+82 -0) </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-33509 ## 📔 Objective Create `BillingRepository` and `BillingRepositoryImpl` to abstract billing service operations into a repository layer, plus Hilt DI modules (`BillingModule`, `BillingNetworkModule`) for dependency injection wiring. - `BillingRepository` interface exposes `getCheckoutSessionUrl()` and `getPortalUrl()` returning domain-specific sealed class result types (`CheckoutSessionResult`, `CustomerPortalResult`) - `BillingRepositoryImpl` delegates to `BillingService` and maps response models using `.fold()` into the appropriate result types - `BillingNetworkModule` provides `BillingService` via `BitwardenServiceClient` - `BillingModule` provides `BillingRepository` as a singleton - Unit tests cover success and failure paths for both repository methods --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-18 16:09:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#32783