Skip to content

Settlement/Webhook/BlockchainWallet entities lack FK indexes #149

Description

@martinzhames

Category: tech-debt

Problem

None of src/settlements/entities/settlement.entity.ts (merchantId), src/webhooks/entities/webhook.entity.ts (merchantId), or src/blockchain-wallet/entities/blockchain-wallet.entity.ts (stellarAddress/userId are unique but every other query path, e.g. by status) has explicit @Index decorators — compare with src/groups/entities/group.entity.ts and src/notifications/entities/notification-preference.entity.ts, which do use @Index.

Impact

Inconsistent indexing strategy across the entity layer: some modules were clearly built with query performance in mind and others weren't, which will surface as slow admin/merchant list queries once these tables have production-scale row counts.

Suggested fix

Audit all 23 entities' actual query patterns (services' where clauses) against their @Index coverage and add a migration that backfills the missing ones, particularly settlements.merchantId and webhooks.merchantId.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions