-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add valueInMonths
helper to Period
class
#1250
Conversation
String formatted = price.getFormatted(); | ||
Long amount = price.getAmountMicros(); | ||
String currencyCode = price.getCurrencyCode(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While looking at other things, I noticed that the Price
class didn't have API tests. This adds them.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## paywalls #1250 +/- ##
============================================
+ Coverage 85.45% 85.46% +0.01%
============================================
Files 187 187
Lines 6351 6358 +7
Branches 923 924 +1
============================================
+ Hits 5427 5434 +7
Misses 567 567
Partials 357 357
☔ View full report in Codecov by Sentry. |
@@ -41,6 +46,18 @@ data class Period( | |||
YEAR, | |||
UNKNOWN, | |||
} | |||
|
|||
val valueInMonths: Double |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess detekt doesn't enforce it, but it would be nice to always add docstrings to public methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely agree, there are actually rules to check for that but we don't have them enabled: https://detekt.dev/docs/rules/comments/#undocumentedpublicproperty. Create a linear ticket to track this.
Description
To help with the variables work needed for paywalls, this adds a helper function
valueInMonths
for thePeriod
class. This will be used to calculate the price per month.