Skip to content

[Backend] Implement Assets Service: Update, Status Update, and Delete #435

@yusuftomilola

Description

@yusuftomilola

Complete the CRUD surface for the Assets module with update and delete operations.

Requirements

update(id, dto, currentUser) — Partial update. Handles relation changes (category, department, assignedTo) as well as scalar fields. Logs a UPDATED history entry showing before/after values.

updateStatus(id, dto, currentUser) — Dedicated status change endpoint. Logs a STATUS_CHANGED entry showing the previous and new status.

remove(id) — Hard delete. Throws NotFoundException if asset doesn't exist.

Endpoints:

  • PATCH /api/assets/:id — update
  • PATCH /api/assets/:id/status — status update
  • DELETE /api/assets/:id — delete (responds 204 No Content)

Acceptance Criteria

  • Partial updates don't overwrite unspecified fields
  • History entries created for update and status change
  • Delete returns 204

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions