Skip to content

Rating Previous Orders - #37

Draft
RVRX wants to merge 3 commits into
crm/shared-cartfrom
crm/order-rating
Draft

Rating Previous Orders#37
RVRX wants to merge 3 commits into
crm/shared-cartfrom
crm/order-rating

Conversation

@RVRX

@RVRX RVRX commented Aug 11, 2022

Copy link
Copy Markdown
Contributor

Not going to have time to finish this feature, so this is some quick notes for whomever picks it up next.

Current Implementation Notes

  • Allow users to rate and edit ratings in the previous orders page. Can add to others in next feature.
  • an ORDER_ITEM has a rating, not an ITEM. Items get their [abstracted] ratings through the average of order items.
  • A user can rate each individual item in their order NOT the order as a whole. By association, this will store the rating for the SPECIFIC order item (options, extras, and all) as well.

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 view and maybe consider a rating component? Done

  • Would 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.

@RVRX
RVRX force-pushed the crm/order-rating branch from c324beb to c7f39d0 Compare August 11, 2022 15:37
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

Successfully merging this pull request may close these issues.

1 participant