DataONEorg / bookkeeper

Bookkeeper keeps track of DataONE product subscriptions and quotas for researchers using the extended services.
Other
1 stars 2 forks source link

Return full associated customer and product models in memberships #67

Closed csjx closed 3 years ago

csjx commented 3 years ago

A Membership currently includes the following attributes:

class Membership {
    id: integer
    object: string
    canceledAt: timestamp
    collectionMethod: string
    created: timestamp
    customerId: integer
    metadata: hash
    productId: integer
    quantity: integer
    startDate: timestamp
    status: string
    trialEnd: timestamp
    trialStart: timestamp
}

To support listing memberships along with their associated Customer data and the Products that are part of the membership, change the Membership model to include the full Customer object that is associated with it based on the id. Likewise, return the Products associated with the Membership. The resulting model will be:

class Membership {
    id: integer
    object: string
    canceledAt: timestamp
    collectionMethod: string
    created: timestamp
    **customer: hash**
    metadata: hash
    **products: list**
    quantity: integer
    startDate: timestamp
    status: string
    trialEnd: timestamp
    trialStart: timestamp
}
csjx commented 3 years ago

This is partially complete. We now return full Customer objects embedded in the Membership object. I'm now working on changing the Membership.product to Membership.products so we return a list of Products associated with the Membership.

csjx commented 3 years ago

We discussed this further, and decided that we actually don't what to embed the full product and customer objects. The reversion is part of #65 , so I'm closing this issue.