Skip to content

Feature/bulk milestone checkin#956

Merged
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
Simongodw:feature/bulk-milestone-checkin
Jun 29, 2026
Merged

Feature/bulk milestone checkin#956
1nonlypiece merged 2 commits into
Disciplr-Org:mainfrom
Simongodw:feature/bulk-milestone-checkin

Conversation

@Simongodw

@Simongodw Simongodw commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Closes #851


#851 Add bulk milestone check-in submission with partial-failure reporting

Summary

Adds POST /api/verifications/bulk endpoint that accepts multiple milestone check-in submissions in a single request. Each item is validated and applied independently; failures are reported per-item without aborting the entire batch.

Changes

  • Added bulk check-in endpoint to src/routes/verifications.ts
    • Accepts array of check-in submissions (max 100 items)
    • Per-item validation and independent processing
    • Partial-failure reporting with typed error codes
    • Reuses existing validation, authorization, and idempotency from single check-ins
  • Added comprehensive tests in src/tests/verifications.bulk.test.ts
    • Request validation (array format, empty array, batch size cap)
    • Per-item validation (missing fields, invalid formats)
    • Mixed success/failure scenarios
    • Idempotent retry behavior
    • Duplicate items in batch
    • Authorization requirements
  • Added documentation to docs/milestones.md

Key Features

  • Per-item isolation: One bad item never aborts the batch
  • Idempotency: Retried batches are safe via existing VerificationConflictError handling
  • Authorization: Same VERIFIER role and replay protection as single check-ins
  • Bounded batch size: Maximum 100 items per request

Testing

All edge cases covered:

  • ✅ Mixed success/failure scenarios
  • ✅ Batch-size cap enforcement
  • ✅ Idempotent retry behavior
  • ✅ Unauthorized item rejected
  • ✅ Duplicate items in one batch

Checklist

Add POST /api/verifications/bulk endpoint that accepts multiple check-in
submissions in a single request. Each item is validated and applied
independently; failures are reported per-item without aborting the entire
batch.

- Add bulk check-in endpoint to src/routes/verifications.ts
- Reuse existing validation/authorization from single check-in
- Enforce batch size cap (100 items)
- Return per-item success/error results with summary
- Add comprehensive tests in src/tests/verifications.bulk.test.ts
- Document in docs/milestones.md

Per-item isolation ensures one bad item never aborts the batch.
Idempotency support via existing VerificationConflictError handling.
Revert validation errors to throw instead of return next() to ensure
per-item isolation. Using return next() would abort the entire batch
on the first validation error, violating the partial-failure requirement.

if (!Array.isArray(items)) {
return next(AppError.badRequest('Request body must be an array of check-in items'))
}

const cleanTargetId = targetId.trim()
const cleanEvidenceReferenceUrl = evidenceReferenceUrl.trim()

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Simongodw 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

@1nonlypiece 1nonlypiece merged commit 783931f into Disciplr-Org:main Jun 29, 2026
1 of 4 checks passed
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 bulk milestone check-in submission with partial-failure reporting to src/routes/verifications.ts

3 participants