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

Switch has_registered to a string rather than boolean #143

Open
jamezpolley opened this issue Dec 30, 2017 · 0 comments
Open

Switch has_registered to a string rather than boolean #143

jamezpolley opened this issue Dec 30, 2017 · 0 comments

Comments

@jamezpolley
Copy link

Currently it's a butt-ton of work to find out what ticket type a user has; it requires a bunch of queries to find all the line items of category TICKET_PRODUCT_CATEGORY attached to an invoice with STATUS_PAID attached to a user attached to the attendee in question.

All of this could be avoided with a small amount of de-normalisation; rather than setting has_registered to TRUE, set it to a string - the name of the item from TICKET_PRODUCT_CATEGORY. Or perhaps make it a foreignkey that points directly to the lineitem in question, so that it's simple to verify that attendee.user.has_registered.invoice.status still == STATUS_PAID

Alternative suggestions: make a new field ticket_type that does this, that always gets set/unset at the same time as has_registered. Or, make the new field ticket_type, and make has_registered into a property which is just a proxy for testing whether or not ticket_type is empty.

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

1 participant