Skip to content

[BE-03] Create Department entity with TypeORM in opsce module #731

@yusuftomilola

Description

@yusuftomilola

Problem

Assets need to be associated with departments but no Department entity exists. Without this, asset grouping and reporting by department is impossible.

Proposed Solution

Create backend/src/opsce/departments/entities/department.entity.ts with a self-referential parent/child relation for department hierarchies.

Acceptance Criteria

  • Entity has fields: id (UUID), name (unique), description, code, isActive, createdAt, updatedAt
  • @ManyToOne self-referential relation for parent department
  • @OneToMany back-reference children departments
  • @OneToMany back-reference to Asset entity
  • Module and entity registered in OpsceModule

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