The per-stage reconciliation state for a customer: every manageable stage, whether it's granted, whether its gateway links agree with the grant, and whether it's eligible to sync.
Reconciles every manageable stage for the customer. Per stage, links/unlinks usage-plan keys so the gateway matches the grant. One stage's failure (try/catch per stage) doesn't abort the rest. Idempotent: re-running is a no-op once converged. Ineligible stages are skipped.
Reconciles a customer's AWS API Gateway usage-plan key links to their
customer_api_plangrant set. The grant set (deletedAt IS NULL) is the source of truth.Gateway-only: each of the customer's API keys must be linked to the stage's usage plan iff the stage is granted. Drift is repaired with
CreateUsagePlanKey/DeleteUsagePlanKey. Linking self-heals a key off a conflicting legacy usage plan (one that shares anapiId:stagewith the target) before creating the new link, since AWS rejects a second key link on an already-associatedapiId:stage.Admin-only — the operator sync page in
admin-dashboardis the sole consumer, so it lives here rather than in a shared domain package.