Admin & Defaults
How to operate reciprocity and benefit features day to day.
Defaults
- Provider default:
SAGA_NETWORKwhen none is supplied. - Club policy failure: reciprocity assumed enabled (warns, does not block pricing).
- Stacking mode:
BEST_PRICE(first applicable agreement). SetstackingMode: 'STACK'to combine bilaterals + network. - Priority:
ReciprocityRateConfig.prioritydefault is10_000(higher number = lower priority). - Unknown
discountType: treated as no-op; pricing falls back to base price.
Creating agreements
- Create ClubNetworkMembership rows for every club that should participate in a network.
- Insert ReciprocityAgreement (type
NETWORK) + ReciprocityRateConfig for the network code. - Add BILATERAL agreements for club-specific overrides; set
priorityto order them (lower first). - Set date bounds (
startDate, optionalendDate) andisActive=true.
Applying in pricing/streams
- Forward eligibility context:
{ tenantId, membershipNumber, providerCode?, homeClubCode?, handicap? }. - Use
stackingMode: 'STACK'when you want bilaterals applied in order and network fallback together. - Expect
appliedAgreements[]in the response showing each discount step when stacking is on.
What to check when it “doesn’t work”
- Missing membership →
MISSING_MEMBERSHIP(no discounts). - No network membership rows for the clubs →
OUT_OF_NETWORK. - Agreement exists but no
rateConfig→NO_RATE_CONFIG. - Date/time/day/handicap outside the configured window → restriction reason returned.
- Network only applies if both clubs are in the network and a network agreement exists.
- Logs will warn on home-club lookup errors; pricing falls back rather than failing.
Auditing & reconciliation
BenefitApplication: verify what discount was applied (amount, provider, membership, slot/booking).BenefitMembership: last-known validation state per provider/member.- Keep both tables in mind when reconciling billing vs. entitlements.
Admin APIs (backend)
GET /admin/reciprocity/agreements— list with filters for clubId/networkCode/active/type.POST /admin/reciprocity/agreements— create network or bilateral agreement + rate config.PUT /admin/reciprocity/agreements/:id— update agreement and upsert rate config.DELETE /admin/reciprocity/agreements/:id— remove agreement (cascade deletes rate config).POST /admin/reciprocity/preview— run ReciprocityService.checkEligibility with stackingMode.GET/PUT /admin/reciprocity/home-clubs/:providerCode— inspect or replace home-club map.GET /admin/reciprocity/networks/memberships+PUT /admin/reciprocity/networks/memberships— audit/upsert network membership rows;DELETE /admin/reciprocity/networks/:networkCode/clubs/:clubIdremoves a club.
Related docs
- Reciprocity & stacking — algorithm and inputs
- Providers & validation — provider-specific behavior
- Data model — Prisma entities and migration