Skip to content

FACT-2674 - being edited by (court locking)#299

Open
hurricanepilot wants to merge 18 commits into
masterfrom
FACT-2674-being-edited-by
Open

FACT-2674 - being edited by (court locking)#299
hurricanepilot wants to merge 18 commits into
masterfrom
FACT-2674-being-edited-by

Conversation

@hurricanepilot

@hurricanepilot hurricanepilot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

JIRA link

FACT-2674

Change description

  • Generalised locking from courts-only to subject-based
    • Replaced CourtLock with Lock (subjectType + subjectId) which supports both COURT and SERVICE_CENTRE
    • Renamed CourtLockController/CourtLockService/CourtLockRepository to LockController/LockService/LockRepository
    • Replaced old court-specific values (COURT, COURT_ACCESSIBILITY, etc.) with broader page set (GENERAL, ADDRESS, ACCESSIBILITY, PHOTO, etc.)
    • Renamed AuditSubjectType to shared SubjectType and updated audit entity, controller, service, repository, and tests accordingly.
    • Database migration for lock generalization
    • Endpoints moved from /courts/{courtId}/v1/locks... to /locks/{subjectType}/{subjectId}/v1...
  • Added lock lifecycle aspects
    • LockAspect replaces timeout validator and now handles:
      • @LockTimeoutCheck (conflict vs stale lock expiry logic)
      • @LockCleanupCheck (proactive cleanup of expired locks before reads)
  • Changed lock behaviour to single active lock per user
  • Tests
    • Mostly refactoring: Functional, integration, and unit tests renamed/rewired to new lock API and model.
    • New/updated tests for service-centre locking and lock cleanup aspect behaviour.

Does this PR require manual testing? (check one with "x")

[ ] Yes
[x] No

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

- Introduced Lock and LockService to replace CourtLock and CourtLockService.
- Updated database schema to generalize locks for both courts and service centres.
- Added LockCleanupCheck and LockTimeoutCheck annotations for method-level lock management.
- Refactored controller and service methods to accommodate new lock structure.
- Updated tests to reflect changes in lock handling and naming conventions.
@hurricanepilot hurricanepilot marked this pull request as ready for review July 8, 2026 11:26
Comment thread src/main/java/uk/gov/hmcts/reform/fact/data/api/services/LockService.java Outdated
debolina-seal
debolina-seal previously approved these changes Jul 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants