Skip to content

Enable 'Per User Limit' and 'total number of uses' on discount engine #1

@lukeholder

Description

@lukeholder

Decide when a discount is considered used. And then decide how will we count these limits.

Ideas

  • To check "per user limit" we have no way but to be counting each time a user has used discount. It will be a new record "CustomerDiscountUse" with incremental field "uses"
  • to check "total use limit" we can add a field to the discount model
  • each time a discount is used there will be incrementation to total discount uses and to CustomerDiscountUse
  • if there is a per user limit, then require the user to enter an email on the order to retrieve the customer record.
  • Need to define what "discount used" means. Discount should be treated as used when an order is completed only. Otherwise there can be incomplete orders which will catch and block limited discounts.
  • Need a order complete event and increment discounts use counters on that event.
  • One more problem - is there a case when we need to decrement uses counter? I guess not? If some discount reached it's limit and a moderator wants to prolong the action he can just increment the discount use limits somehow?
  • After we get "discount.totalUses" counter and uses counters per each user we can easily check if discount is available or not just in DiscountAdjuster

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions