Skip to content

644 — Block bulk edit and change nothing when a selected record is approved

Description

Non-happy path. An approved time record is locked for edits (backend checkModificationsPermissions throws TIME_RECORD_APPROVED). The bulk patch is transactional, so a single approved record in the selection rejects the whole batch: an error toast is shown and nothing changes.

Preconditions

  • Signed in to a freshly seeded test organization.
  • Three time records seeded via the GraphQL API, each on a different client/project/task.
  • One of the three records is approved via the GraphQL API.
  • 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 via the pencil action.
  3. Set ProjectReplace and pick a project.
  4. Click Save. Expected: an error toast appears ("This time record cannot be edited because it has already been approved.") and the modal stays open.
  5. Cancel the modal.
  6. Inspect the rows. Expected: every record still carries its own original project — none were changed (the whole batch was rolled back).
  • Spec: playwright/tests/integration/timerecord.spec.ts (describe "Timerecord - Bulk edit")
  • Backend guard: TimeRecordService.checkModificationsPermissions (TIME_RECORD_APPROVED / TIME_RECORD_BILLED)