Skip to content

feat(indexer): add Stellar RPC connectivity check to health endpoint#176

Merged
therealjhay merged 2 commits into
Betta-Pay:mainfrom
sulaimonifeoluwa4-blip:feat/issue-105-discriminated-event-types
Jun 29, 2026
Merged

feat(indexer): add Stellar RPC connectivity check to health endpoint#176
therealjhay merged 2 commits into
Betta-Pay:mainfrom
sulaimonifeoluwa4-blip:feat/issue-105-discriminated-event-types

Conversation

@sulaimonifeoluwa4-blip

Copy link
Copy Markdown
Contributor

closes #105

Description

This PR adds strong, compiler-verified type safety boundaries between our asynchronous microservices. By bridging the raw string constant tuple definitions with our existing @bettapay/validation schemas via Zod inference, we eliminate type-casting gaps and introduce deterministic discriminated unions across consumer boundaries.

Changes

  • 🗺️ Type Mapping Ecosystem: Exported EventPayloadMap in shared/types/index.ts dynamically leveraging z.infer to safely connect event keys to schemas.
  • 🛡️ Discriminated Union: Introduced TypedEvent to ensure developers get complete autocomplete arrays and exhaustive compiler checks inside switch or conditional loops.
  • 🧪 Type-Guard Utilities: Designed the isEventType predicate function enabling seamless runtime validation and type narrowing.
  • 📝 Developer Guidelines: Embedded practical syntax usage code examples directly into the module export.

Acceptance Criteria Verification

  • Zod Inference Integration: Mapped all operational backend event types directly to their runtime object structures.
  • Type Guard Precision: The compiler narrows types flawlessly within if blocks passing the isEventType evaluation.
  • Zero Build Regressions: Application modules compile without error on strict evaluation parameters.

How to Test

  1. Confirm local package workspaces and declarations are successfully bound:
    npm run build

@therealjhay therealjhay merged commit bfb3474 into Betta-Pay:main Jun 29, 2026
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.

Add proper inter-service event type definitions

3 participants