-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Built Tanga subscription feature (#95)
* Built the subscription feature - users can now subscribe to one the two paid plans for Tanga * Fixing detekt issues * Fixing unit tests * Started adding unit tests * Minor improvements
- Loading branch information
Showing
43 changed files
with
1,223 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package app.books.tanga.entity | ||
|
||
import java.util.Date | ||
|
||
/** | ||
* Represents a subscription plan that a user can purchase. | ||
* @property identifier A unique identifier for the subscription plan. | ||
* @property productId The Store product ID of the subscription plan. | ||
* @property type The type of the subscription plan (monthly or yearly). | ||
* @property price The price of the subscription plan. | ||
*/ | ||
data class SubscriptionPlan( | ||
val identifier: String, | ||
val productId: String, | ||
val type: SubscriptionType, | ||
val price: Price, | ||
) | ||
|
||
/** | ||
* Represents the type of a subscription plan. | ||
*/ | ||
enum class SubscriptionType { | ||
MONTHLY, | ||
YEARLY | ||
} | ||
|
||
/** | ||
* Represents the price of a subscription plan. | ||
* @property formattedValue The formatted value of the price. | ||
* @property currency The currency in which the price is displayed. | ||
*/ | ||
data class Price( | ||
val formattedValue: String, | ||
val currency: String, | ||
) | ||
|
||
data class SubscriberInfo( | ||
val hasActiveSubscription: Boolean, | ||
val expirationDate: Date?, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.