Problem
Changing an affiliate application through the seller approval endpoint updates the application status but does not keep the offer total_affiliates counter in sync.
Two stale-count cases fall out of that:
- approving a pending or rejected application leaves
total_affiliates unchanged even though the offer has another approved affiliate
- rejecting a previously approved application leaves
total_affiliates too high
That counter is used by affiliate dashboards and marketplace sorting, so stale values can misrepresent offer traction after sellers approve or reject applicants.
Expected behavior
When the application status crosses the approved boundary, the offer counter should move with it:
- non-approved -> approved increments by one
- approved -> non-approved decrements by one without going below zero
- unchanged status leaves the counter unchanged
Problem
Changing an affiliate application through the seller approval endpoint updates the application status but does not keep the offer
total_affiliatescounter in sync.Two stale-count cases fall out of that:
total_affiliatesunchanged even though the offer has another approved affiliatetotal_affiliatestoo highThat counter is used by affiliate dashboards and marketplace sorting, so stale values can misrepresent offer traction after sellers approve or reject applicants.
Expected behavior
When the application status crosses the approved boundary, the offer counter should move with it: