title: Create custom sales rule in magento 2 based on previous orders quantity
body: <p>I want to create a sale rule in Magento 2 that allow using a coupon code several time  until a total amount of orders is reached.
  example : while total client orders are under 1000 euro he can use a custom coupon code for a reduction of 30%.
  What is the best way to do this? 
  Thanks.</p>