-
Notifications
You must be signed in to change notification settings - Fork 147
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
feat(code_push_protocol): add subscription object to user #339
Conversation
/// Converts a [Subscription] to a JSON object. | ||
Json toJson() => _$SubscriptionToJson(this); | ||
|
||
/// Billing rate, in cents. |
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.
Oh man. US Cents I assume. :) Someone is going to write an amazing typed "money" object someday. 🤣
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.
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.
Assuming usd for now.
Stripe specifies currency
on the individual price objects (https://stripe.com/docs/api/prices/object#price_object-currency), so we can get fancier if/when we need to.
|
||
/// When the subscription will be renewed or expire. | ||
@TimestampConverter() | ||
final DateTime paidThroughDate; |
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 assume this is midnight UTC on that date?
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.
Not specified, but looking at some of the live subscriptions, it seems to be purchase_time + Duration(days: 30)
Description
Adds the
Subscription
object to our API contract and adds aSubscription? subscription
toUser
.The info provided by this object will allow us to provide richer information to the user about their subscription (price, when/if it expires, when they will be charged, etc.)
Type of Change