Enum Categories - 4 categories
Product - ProductId,CategoryId
Affiliate - AfilliateId, Name
Order - OrderId, PRice, ProductId, categoryId(clothing,mobile,mobilecovers,furniture), afiiliateId,timestamp API method to update order status
Commission Engine- Rule based
- percentage with a maxCap
- flat-rate
- figure out which rule is applicable CommissionMapping - CategoryId, Percentage, FlatRate
Brokerage Payout Transaction: Transaction - AffiliateId, TransactionId, List[OrderIds]
-
when return period expires then Payout
-
TransactionToAffiliate: Minimum of 100rs and then add transaction with uuid
-
Calculate brokerage at order created state
-
method for affiliate to get their deets using affiliateId
Bonus:
- commision rules can change based on date
- handle concurrent orders
addOrder() updateOrder()