Skip to content

[BE-22] Implement POST /assets - create asset endpoint #587

@yusuftomilola

Description

@yusuftomilola

Overview

Implement the create asset endpoint inside backend/contrib/. This is one of the most important endpoints in the system.

Location

All work must be inside backend/contrib/src/assets/.

Acceptance Criteria

  • POST /assets endpoint implemented, protected by JwtAuthGuard
  • CreateAssetDto with fields: name*, categoryId*, departmentId*, description?, serialNumber?, purchaseDate?, purchasePrice?, currentValue?, warrantyExpiration?, status?, condition?, location?, assignedToId?, manufacturer?, model?, tags?, notes?
  • assetId auto-generated in format AST-1001, AST-1002 etc. (padded, sequential)
  • AssetHistory entry created with action CREATED after successful save
  • Returns the created asset with all relations loaded
  • createdBy set to the currently authenticated user

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions