Overview
Operations teams frequently need to update dozens of assets at once — decommissioning a whole lab of equipment, reassigning a department's assets after restructuring, or mass-tagging assets after a physical audit. Individual PATCH calls for each asset are prohibitively slow at scale.
Context
- All bulk operations must be atomic per item (partial success is acceptable — failed items are returned in the response)
- Each successful change must still create an
AuditLog entry and an AssetHistory record
- The endpoint body must accept an array of IDs plus the change to apply (not individual payloads per asset)
Acceptance Criteria
Overview
Operations teams frequently need to update dozens of assets at once — decommissioning a whole lab of equipment, reassigning a department's assets after restructuring, or mass-tagging assets after a physical audit. Individual PATCH calls for each asset are prohibitively slow at scale.
Context
AuditLogentry and anAssetHistoryrecordAcceptance Criteria
PATCH /assets/bulk/statusbody:{ ids: string[], status: AssetStatus }— updates status on all valid IDs, skips RETIRED assets (returns them inskippedarray)PATCH /assets/bulk/assignbody:{ ids: string[], userId?: string, departmentId?: string }— reassigns assets; at least one ofuserIdordepartmentIdrequiredDELETE /assets/bulkbody:{ ids: string[] }— soft-deletes all listed assets; ADMIN only{ succeeded: string[], failed: { id, reason }[], skipped: string[] }400with a clear message if exceeded