Skip to content

Test/milestone repository queries#938

Merged
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
AugistineCreates:test/milestone-repository-queries
Jun 29, 2026
Merged

Test/milestone repository queries#938
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
AugistineCreates:test/milestone-repository-queries

Conversation

@AugistineCreates

Copy link
Copy Markdown
Contributor

this pr closes #866

Description

This PR adds query methods (findMany and findById) to the MilestoneRepository and introduces a comprehensive query-behaviour test matrix in src/tests/milestoneRepository.queries.test.ts.

These changes support milestone listing, verifier assignment, and soft-deletes under strict organization scoping.

Key Changes

  • MilestoneRepository:
    • Implemented findMany supporting keyset pagination (afterId, limit), soft-delete exclusion (filtered by default, optional via includeDeleted), verifier-assignment filtering (verifierUserId), and organization-scoping (orgId).
    • Implemented findById supporting organization-scoping and soft-delete filtering.
    • Fixed a TypeScript compiler warning by casting the raw database result in nearestNeighbors to any.
  • Tests:
    • Created src/tests/milestoneRepository.queries.test.ts to assert that:
      • Keyset pagination is stable across concurrent inserts (no skipped/duplicated rows).
      • Soft-deleted milestones are excluded by default and includable explicitly.
      • Verifier-assignment filters return only the assigned verifier's milestones.
      • Every query path strictly enforces organization scoping.

Verification

  • Verified TypeScript compilation:
    npx tsc --noEmit src/repositories/milestoneRepository.ts src/tests/milestoneRepository.queries.test.ts
  • Checked that tests run and gracefully skip when DATABASE_URL is not configured, matching existing database test patterns.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@AugistineCreates Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits


export const adminVaultReplayRouter = Router()

adminVaultReplayRouter.use(authenticate)
@1nonlypiece 1nonlypiece merged commit 15ba622 into Disciplr-Org:main Jun 29, 2026
1 of 4 checks passed
@1nonlypiece

Copy link
Copy Markdown
Contributor

milestone repo query tests look thorough, merging

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 milestoneRepository pagination, soft-delete, and verifier-filter tests in src/tests/milestoneRepository.queries.test.ts

3 participants