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

Inventory tracking and combos #109

Closed
aravindet opened this issue Oct 10, 2016 · 3 comments
Closed

Inventory tracking and combos #109

aravindet opened this issue Oct 10, 2016 · 3 comments

Comments

@aravindet
Copy link

aravindet commented Oct 10, 2016

Say there is a 2-day ticket, a day 1 ticket and a day 2 ticket. When either day 1 or day 2 tickets are fully sold out, the 2-day ticket should also be marked as fully sold out.

Bonus feature: When the day 1 tickets are 90% sold out, stop selling them but continue to offer the 2-day ticket (as that is more profitable).

Suggested implementation:

class SaleItem(...): # What’s currently called Item, except remove quantity
class InventoryItem(...): # Just quantity, number_sold? (if denormalizing)
class InventoryItemMap(): # Mapping
    quantity # over-rides the inventory item quantity, for satisfying bonus feature above
    multiplier # usually one, but if say a combo contains two t-shirts this will be 2

If not denormalizing, the query for retrieving availability information along with display items is very complex.

Edit: replaced DisplayItem with SaleItem

@shreyas-satish
Copy link
Contributor

shreyas-satish commented Oct 11, 2016

This is definitely a problem, and a good solution. Another solution to address the problem of tracking inventory, is to change the relationship between Item and ItemCollection to a many-to-many, where the join model can be named as ListedItem. If an item needs to be marketed differently based on the item collection it is being listed in, the ListedItem object can contain these specific details.

My sense is, this solution will require fewer changes to make to the code base.

@jace
Copy link
Member

jace commented Oct 12, 2016

Related to #96, which can potentially remove the need for Item being present in more than oneItemCollection. Also, this will fix #75 which calls for renaming Item to something less generic.

@jace
Copy link
Member

jace commented Jul 28, 2017

Deprecated by #171, which discusses the same idea and includes notes on complexities.

@jace jace closed this as completed Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants