Referral order using both affiliate link and coupon

Affiliate links and affiliate coupons have the same function, which means a referral order can be tracked whether it is made via the affiliate link or made with coupon.
In case the customer visits merchant's shop via the affiliate link and use coupon code of the same affiliate, that affiliate will not get double commission. Instead, they will only get commission calculated basing on order amount after applying the coupon code.
In case the affiliate link and the coupon come from 2 different affiliates (customer uses the affiliate link from affiliate A and uses a coupon from affiliate B), the affiliate with coupon (affiliate B) will get commission.
To sum up, both affiliate link and coupon can be used to track referral order, but in case both are used, coupon will be prioritized.