Skip to content

PAE-1131: add journey test for suspended accreditation#362

Merged
timrutter merged 10 commits intomainfrom
PAE-1131-status-history-check
Mar 16, 2026
Merged

PAE-1131: add journey test for suspended accreditation#362
timrutter merged 10 commits intomainfrom
PAE-1131-status-history-check

Conversation

@timrutter
Copy link
Contributor

@timrutter timrutter commented Mar 13, 2026

Ticket: PAE-1131

Summary

  • Switch org update step from PATCH to PUT to use replaceRaw endpoint, preserving caller-provided statusHistory timestamps
  • Add registration and org-level statusHistory entries in the update step with explicit dates (using validFrom)
  • Use accreditation validFrom for status change timestamps (e.g. suspended) so isAccreditedAtDates correctly classifies loads

Test plan

  • Journey tests pass in CI (epr-backend PR #934)

🤖 Generated with Claude Code

timrutter and others added 10 commits March 13, 2026 11:26
- Add step definition for updating accreditation status
- Add scenario verifying all rows are IGNORED when accreditation is suspended

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… steps

Switch from PATCH to PUT dev endpoint so statusHistory timestamps are preserved.
Add statusHistory entries for registrations and org with updatedAt set to
validFrom (before load dates) so isAccreditationApprovedAtDate works correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When updating accreditation status (e.g. to suspended), use the
accreditation validFrom date instead of new Date(). This ensures
the status change is before the load dates so isAccreditedAtDates
correctly classifies loads as IGNORED.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Using validFrom directly caused the suspension to have the same date
as the approval statusHistory default (2025-01-01), making it
impossible to find an approved status. Use validFrom + 1 day so
the suspension is after the approval but before load dates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
With status history checks, IGNORED rows (outside accreditation
period or suspended) are excluded from valid/invalid counts.
Only row 4000 (REPROCESSED_LOADS, no classifyForWasteBalance)
remains as added.valid. Rows 1000, 1001, 5000 are all IGNORED.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When all waste-balance rows are IGNORED (suspended accreditation),
no waste balance record is created. Removed the assertion expecting
a zero-amount record since no record exists at all.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@timrutter timrutter merged commit 2b8c237 into main Mar 16, 2026
4 checks passed
@timrutter timrutter deleted the PAE-1131-status-history-check branch March 16, 2026 10:01
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.

2 participants