646 — Block bulk edit and change nothing when a selected record is billed¶
Description¶
Non-happy path. A fully invoiced (billed) time record is locked for edits — the backend checkModificationsPermissions throws TIME_RECORD_BILLED. The bulk patch is transactional, so one billed record in the selection rejects the whole batch 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 records is fully billed via the API (billing-report settings set to skip-draft, then a billing report is created from it so it gets an issued invoice item).
- Time Records page open in the Reports view.
Steps¶
- Tick the selection checkbox on all three rows. Expected: the floating bar shows "3 selected".
- Open the bulk-edit modal and set Project → Replace with a project.
- Click Save. Expected: an error toast appears ("This time record cannot be edited because it has already been invoiced.") and the modal stays open.
- Cancel the modal.
- Inspect the rows. Expected: every record still carries its own original project — the whole batch was rolled back.
Related¶
- Spec:
playwright/tests/integration/timerecord.spec.ts(describe "Timerecord - Bulk edit") - Backend guard:
TimeRecordService.checkModificationsPermissions→TIME_RECORD_BILLED