Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not going to have time to finish this feature, so this is some quick notes for whomever picks it up next.
Current Implementation Notes
ORDER_ITEM
has a rating, not anITEM
. Items get their [abstracted] ratings through the average of order items.Quick TODO Notes
Should use
Lunchbot.LunchbotData.update_order_item/2
when adding and editing ratings. Note that LiveView has handy features for dealing with changesets with this sort of data which should be used for editing ratings.UI-wise; Probably shouldn't use the order component for this as the events are starting to get complex and clogging up the component which is used elsewhere. Should pull order component code back into the previous orders viewand maybe consider a rating component? DoneWould be simpler to redirect to a new route with
:edit
:create
:delete
methods, but would be a lot better on the user to keep the rating system all on the previous orders page. I was thinking when you click add rating, just replace that text with a set of five stars (though for testing just "1 2 3 4 5") each with an event handler, that will assign that star value [Might have to be in a modal of some sort instead of in-line, as I'm unsure how to update template text]. The page would then auto-update due to order_items subscription.