Skip to content

bug: affiliate approval changes leave offer counts stale #201

@morganschp

Description

@morganschp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions