Loading
feat(fm): one agreement per partner, edited in place
A partner could hold several agreements, with the newest valid one
applying, and changing zones or terms meant creating another. In the
portal that showed up as a list where the last entry silently replaced
the others. GSMA OPG.04 has no agreement object (offered zones are
"based on the prior agreement"), so this is ours to shape.
A partner now has one agreement. POST /internal/agreements answers 409
agreement-exists, naming the existing one, when the partner already has
an agreement; PATCH changes any field but the partner, including zones,
zone terms, API types and app mappings, and runs the create checks on
the merged result. Zone edits reach a federated partner as ZONES
ADD/REMOVE through the existing notifier.
A partial unique index enforces it (one agreement per partner that isn't
expired). Migration 0008 keeps, for partners that already had several,
the one FM applied (active and valid now, else active, else newest) and
marks the rest expired, so history stays.
Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com>