Skip to main content

Admin & Defaults

How to operate reciprocity and benefit features day to day.

Defaults

  • Provider default: SAGA_NETWORK when none is supplied.
  • Club policy failure: reciprocity assumed enabled (warns, does not block pricing).
  • Stacking mode: BEST_PRICE (first applicable agreement). Set stackingMode: 'STACK' to combine bilaterals + network.
  • Priority: ReciprocityRateConfig.priority default is 10_000 (higher number = lower priority).
  • Unknown discountType: treated as no-op; pricing falls back to base price.

Creating agreements

  1. Create ClubNetworkMembership rows for every club that should participate in a network.
  2. Insert ReciprocityAgreement (type NETWORK) + ReciprocityRateConfig for the network code.
  3. Add BILATERAL agreements for club-specific overrides; set priority to order them (lower first).
  4. Set date bounds (startDate, optional endDate) and isActive=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 rateConfigNO_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/:clubId removes a club.