Skip to content

Real provider integration: aggregator gateway behind TravelProviderGateway (Phase 3) - #11

Merged
jckail merged 1 commit into
masterfrom
feature/aggregator-gateway
Jul 9, 2026
Merged

Real provider integration: aggregator gateway behind TravelProviderGateway (Phase 3)#11
jckail merged 1 commit into
masterfrom
feature/aggregator-gateway

Conversation

@jckail

@jckail jckail commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

The first real provider integration — replaces the simulated-only sync path with an HTTP loyalty-data aggregator adapter (the roadmap's "one adapter over a loyalty-data aggregator to cover the long tail"), activated by config and sitting behind the existing TravelProviderGateway port.

  • HttpAggregatorTravelProviderGateway (core) — POSTs {providerId, membershipNumber, credential?} to {baseUrl}/v1/balance with bearer auth, validates the response, forwards a transient credential for one-time use (never persisted), and can be scoped to supportedProviderIds. Injectable fetch; 5 unit tests including composite precedence over the simulated gateway.
  • Refactor — a shared buildTravelProviderGateway() factory composes the aggregator (when configured) ahead of the simulated fallback. The web and worker containers now use it instead of hand-composing, and dropped their direct Composite/Simulated imports — one place owns the gateway wiring.
  • ConfigAGGREGATOR_API_URL / AGGREGATOR_API_KEY (web + worker).
  • Infra — opt-in AGGREGATOR_API_KEY Secrets Manager placeholder (-c enableAggregator=true) + AGGREGATOR_API_URL context on the web service and the 6-hourly sync task; secret ARN output. Default deploys unchanged.
  • Docsdocs/integrations.md (aggregator section + factory), .env-example.

Open/closed at work: no use case, route, or schema changes — syncs just start returning real balances for covered providers, and balance history accumulates automatically.

Verification

  • 128 tests pass (97 core incl. 5 new + 20 bot + 11 extension); typecheck + eslint clean.
  • cdk synth clean both default (no aggregator) and -c enableAggregator=true (secret + env on web + sync task confirmed in the template).

🤖 Generated with Claude Code

First real provider integration: replace the simulated-only sync path with an
HTTP loyalty-data aggregator adapter, activated by config.

- core: HttpAggregatorTravelProviderGateway — POSTs {providerId, membershipNumber,
  credential?} to {baseUrl}/v1/balance with bearer auth, validates the response,
  forwards transient credentials for one-time use, optionally scoped to
  supportedProviderIds. Injectable fetch; 5 unit tests (incl. composite
  precedence over the simulated gateway).
- refactor: shared buildTravelProviderGateway() factory composes aggregator (when
  configured) ahead of the simulated fallback; web + worker containers now use
  it instead of hand-composing (dropped their direct Composite/Simulated imports).
- env: AGGREGATOR_API_URL / AGGREGATOR_API_KEY (web + worker).
- infra: opt-in AGGREGATOR_API_KEY secret (`-c enableAggregator=true`) +
  AGGREGATOR_API_URL context on the web service and the sync task; secret ARN
  output. Default deploys unchanged.
- docs: integrations.md (aggregator section + factory), .env-example.

Verification: 128 tests pass (97 core incl. 5 new + 20 bot + 11 extension);
typecheck + lint clean; cdk synth clean default + `-c enableAggregator=true`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@jckail
jckail merged commit d2f6eea into master Jul 9, 2026
2 checks passed
@jckail
jckail deleted the feature/aggregator-gateway branch July 9, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant