Skip to content

[Backend] Define Asset Entity with Full Property Set #433

@yusuftomilola

Description

@yusuftomilola

The Asset entity is the core data model for the platform. It needs a rich set of fields covering identification, classification, financial data, condition tracking, and blockchain anchoring.

Required Fields

Field Type Notes
id UUID PK Auto-generated
assetId string unique Human-readable (e.g. AST-1001)
name string Required
description text nullable
category ManyToOne → Category
department ManyToOne → Department
assignedTo ManyToOne → User nullable
serialNumber string nullable
purchaseDate date nullable
purchasePrice decimal(15,2) nullable
currentValue decimal(15,2) nullable
warrantyExpiration date nullable
status enum: ACTIVE, ASSIGNED, MAINTENANCE, RETIRED
condition enum: NEW, GOOD, FAIR, POOR
location string nullable
manufacturer string nullable
model string nullable
barcode string nullable
qrCode string nullable
tags simple-array nullable
imageUrls simple-array nullable
customFields jsonb nullable
notes text nullable
stellarAssetId string nullable SHA-256 of UUID
stellarTxHash string nullable
stellarStatus enum: NOT_REGISTERED, PENDING, CONFIRMED, FAILED
createdBy ManyToOne → User
updatedBy ManyToOne → User
createdAt, updatedAt timestamps

Acceptance Criteria

  • Entity created with all fields and correct TypeORM decorators
  • Relations use @ManyToOne with @JoinColumn
  • Enums defined in a shared enums.ts file

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions