Skip to content

647 — Block bulk edit and change nothing when records fall in a locked period

Description

Non-happy path. A record whose start is before the organization's "lock records" date can no longer be modified — patch runs validateTimeRecordcheckTimeRecordLock, which throws TIME_RECORDS_LOCKED. One locked record in the selection rejects the whole transactional batch.

Preconditions

  • Signed in to a freshly seeded test organization.
  • Three time records seeded via the GraphQL API (today), each on a different client/project/task.
  • The org's "lock records before" date is set to tomorrow via the API, so all of today's records are locked.
  • Time Records page open in the Reports view.

Steps

  1. Tick the selection checkbox on all three rows. Expected: the floating bar shows "3 selected".
  2. Open the bulk-edit modal and set ProjectReplace with a project.
  3. Click Save. Expected: an error toast appears ("Time record is already lock range and cannot be modified.") and the modal stays open.
  4. Cancel the modal.
  5. Inspect the rows. Expected: every record still carries its own original project — nothing changed.
  • Spec: playwright/tests/integration/timerecord.spec.ts (describe "Timerecord - Bulk edit")
  • Backend guard: TimeTrackingSettingsService.checkTimeRecordLockTIME_RECORDS_LOCKED