Skip to content
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

Question - valid_until vs ends_at #41

Closed
llioor opened this issue Aug 23, 2018 · 1 comment
Closed

Question - valid_until vs ends_at #41

llioor opened this issue Aug 23, 2018 · 1 comment
Labels

Comments

@llioor
Copy link

llioor commented Aug 23, 2018

Hi guys,
Someone can explain what is the usage/differences of:
PlanSubscription "ends_at" attribute and PlanSubscriptionUsage "valid_until" attribute.

I understood that the PlanSubscription talks about the subscription itself when the PlanSubscriptionUsage talks about the usage but I didn't understand the "usage" thing...

Please someone can explain by example.
Thank you very much for the package and time saving!

Leo.

@gerardojbaez
Copy link
Owner

Plan subscription "ends_at" attribute is the date when the subscription ends; for example, when the user has paid for 1 month of service and that month has passed.

As for the "valid_until" attribute of a usage record, it is the date when a usage record needs to be reset. For example, let's say you have a Listings feature, a user has used 10 of them; assuming you have configured Listings to be reset every month, the next time the user uses the Listings feature and the valid_until date has been reached, the Listings usage count is reset back to 0, then increased as per your instructions when using record($feature) method. This feature is optional and is only used when resettable_interval and resettable_count are set. I don't recall why exactly this feature was implemented but it seems unnecessary and redundant 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants