Restructuring coupon calculations to handle various discount scenarios and refund cases with proper subsidy tracking. Discount Scenarios 1. When Admin Bears Full Discount (100% Admin, 0% Vendor) 2. Subsidy Scenario (When Discount > Admin Commission) 3. When Vendor Bears Full Discount 4. Shared Discount (30% Admin, 70% Vendor)
Refund Calculations 1. Full Refund 2. Partial Refund
Subsidy Clearing Conditions 1. When Order is canceled 2. When Customer Refunds fully / partially 3. When coupon is removed from the order
