Skip to content

644 — Skip an approved record in a bulk edit but apply it to the rest

Description

Partial-update path. An approved time record is locked for edits (backend checkModificationsPermissions throws TIME_RECORD_APPROVED for that record). The bulk patch is not transactional: it applies to every editable record and skips the locked one, returning a partial result — a success toast plus an "N updated, M could not be updated" info and the per-record reason. The two non-approved records get the new project; the approved one keeps its own.

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 record #2's project (a project that differs from the approved record's own, so the "kept its project" check stays divergent).
  4. Click Save. Expected: a success toast, an info toast "2 time record(s) updated, 1 could not be updated.", and an error toast "This time record cannot be edited because it has already been approved."; the modal stays open.
  5. Cancel the modal.
  6. Inspect the rows by record id. Expected: the approved record still carries its own original project; the other two now carry the replacement project.
  • Spec: playwright/tests/integration/timerecord.spec.ts (describe "Timerecord - Bulk edit")
  • Page object: assertTimeRecordProjectById, bulkReplaceProject, clickBulkSaveButton, clickBulkCancel (timerecord.page.ts)
  • Backend guard: TimeRecordService.checkModificationsPermissions (TIME_RECORD_APPROVED / TIME_RECORD_BILLED)