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

Refactor subscriptions as orders #65

Closed
csjx opened this issue Sep 21, 2020 · 3 comments
Closed

Refactor subscriptions as orders #65

csjx opened this issue Sep 21, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@csjx
Copy link
Member

csjx commented Sep 21, 2020

Since we don't technically support ongoing subscriptions to services, merge them into orders throughout the code base. Also, change subscribers to owners. Products are now purchased as opposed to subscribed to.

@csjx csjx added the enhancement New feature or request label Sep 21, 2020
@csjx csjx added this to the 1.0.0 release milestone Sep 21, 2020
@csjx csjx self-assigned this Sep 21, 2020
csjx added a commit that referenced this issue Sep 22, 2020
Change all subscriptions to memberships, including the
subscriptions table, all foreign keys, etc.

refs #65
csjx added a commit that referenced this issue Sep 22, 2020
Change all subscriptions to memberships and references across models.

refs #65
csjx added a commit that referenced this issue Sep 22, 2020
Change all subscriptions to memberships and references across each store.

refs #65
csjx added a commit that referenced this issue Sep 22, 2020
Move the SubscriptionMapper to the MembershipMapper, and change all references to subscriptions as memberships.

refs #65
csjx added a commit that referenced this issue Sep 22, 2020
modify the OrdersResource, QuotasResource, and UsagesResource to refer to subscriptions as memberships.

refs #65
csjx added a commit that referenced this issue Sep 22, 2020
Rename the SubscriptionHelper to MembershipHelper,
and update the QuotaHelper and UsageHelper to refer to subscriptions as memberships.

refs #65
csjx added a commit that referenced this issue Sep 22, 2020
Refer to subscriptions as memberships in each test.

refs #65
csjx added a commit that referenced this issue Sep 22, 2020
csjx added a commit that referenced this issue Sep 22, 2020
Memberships have owners now (vs subscribers),
so reflect this in the quotas table as well since it is a copy of the identifier.

refs #65
csjx added a commit that referenced this issue Sep 22, 2020
csjx added a commit that referenced this issue Sep 22, 2020
csjx added a commit that referenced this issue Sep 22, 2020
csjx added a commit that referenced this issue Sep 22, 2020
@csjx
Copy link
Member Author

csjx commented Sep 22, 2020

Subscriptions are now Memberships, and subscribers are owners. Note that a Customer.subject aligns with a Membership.owner, and may align with the Quota.owner for individuals, but this may be replaced by a group owner subject.

@csjx csjx closed this as completed Sep 22, 2020
@csjx
Copy link
Member Author

csjx commented Sep 24, 2020

I was having some difficulties modeling a Membership with multiple products, and realized that this is not correct. I discussed this with @gothub, and we realized that a Subscription is not actual a Membership, but rather an instantiation of a Product, tying it to a Customer and setting the Quotas. I'm reopening this issue, and changing the title so that Subscriptions are now Services merged into Orders - akin to any online service that somebody purchases (vs subscribes to) and we need to keep track of.

@csjx csjx reopened this Sep 24, 2020
@csjx csjx changed the title Refactor subscriptions as memberships Refactor subscriptions as services Sep 24, 2020
@csjx csjx changed the title Refactor subscriptions as services Refactor subscriptions as orders Sep 27, 2020
csjx added a commit that referenced this issue Oct 7, 2020
Associates a quota with an order for easier recognition.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
Rename it back given it is the most appropriate name. It get's copied from Order.subject now, which can be a user or group.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
As we use orders to represent subscriptions/memberships, delete the memberships SQL scripts, and add appropriate attributes to the quotas and orders tables. Renumber the scripts for flyway migrations.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
csjx added a commit that referenced this issue Oct 7, 2020
csjx added a commit that referenced this issue Oct 7, 2020
Now that orders also represent a paid subscription, update the SQL SELECT statement to return quotas associated with a given order (if any, i.e. LEFT JOIN).
In the interface SELECT methods, use the OrderMapper and the OrderQuotasReducer to populate the returned JSON object with an embedded quota list.
For the INSERT and UPDATE operations, add the new properties that are now part of an order.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
Change the reducer to produce an Order with a list of quotas if quotas are present in the result set. Otherwise, return a plain Order object.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
Since the result set may include joined quotas, use table prefixes to identify columns, and add in the new Order properties to the mapper.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
csjx added a commit that referenced this issue Oct 7, 2020
Insert test quotas with order identifiers rather than membership identifiers, and rename methods to use Orders.
Add javadoc. Improve formatting.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
Migrate the test methods to select, insert, update, and delete orders with new properties.  Update SELECTs to optionally join quotas into the orders.
Add Javadoc. Improve formatting.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
Remove membership insertions.
Also set the trialing status and transitions.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
csjx added a commit that referenced this issue Oct 7, 2020
csjx added a commit that referenced this issue Oct 7, 2020
these are no longer needed with the simplified model where orders represent subscriptions.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
csjx added a commit that referenced this issue Oct 7, 2020
Change all tests to build orders, insert orders, etc.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
Change all tests to build orders, insert orders, etc.

refs #65
csjx added a commit that referenced this issue Oct 7, 2020
@csjx
Copy link
Member Author

csjx commented Oct 8, 2020

This refactor is complete, and we are testing via the test deployment. We'll open new issues as needed. Closing this one.

@csjx csjx closed this as completed Oct 8, 2020
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
Change all subscriptions to memberships and references across models.

refs DataONEorg/bookkeeper#65
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
Refer to subscriptions as memberships in each test.

refs DataONEorg/bookkeeper#65
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
Associates a quota with an order for easier recognition.

refs DataONEorg/bookkeeper#65
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
Rename it back given it is the most appropriate name. It get's copied from Order.subject now, which can be a user or group.

refs DataONEorg/bookkeeper#65
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
Add the subject, name, seriesId, startDate, and endDate fields to the Order model in lieu of a subscription.
Update the status enum to merge in Subscription status values.
Add getters and setters for new fields, and update the equals() and hashcode() methods.
Add JsonProperty annotations on methods as needed.

refs DataONEorg/bookkeeper#65
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
Change the subscriptionId property to orderId, and update the getter and setter methods accordingly.

refs DataONEorg/bookkeeper#65
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
these are no longer needed with the simplified model where orders represent subscriptions.

refs DataONEorg/bookkeeper#65
csjx added a commit to DataONEorg/bookkeeper-api that referenced this issue Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant