CaravanaCloud / ecomarkets

Helping people get healthier through organic nutrition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create service/tests to divide products added to baskets between farmers

ericrlessa opened this issue · comments

Precondition:

  1.  There is a fair validity period, normally one week, to sell products.
    
  2.  The farmers will add their products to the fair to be available to sell.
    
  3.  The partners will add the available products to baskets regardless of the farmer that produced
    

Use case:

  1.   For each product added in different baskets, the service should divide equally the products between farmers' production available.
    
  2.   If it is impossible to divide the products equally among the farmers due to variations in available stock, the farmer with the least amount available should receive priority for the remainder of the distribution. This means that farmers with less stock may receive a greater portion than others