Skip to content

[BE-15] Create LocationsModule with CRUD endpoints in opsce module #825

@yusuftomilola

Description

@yusuftomilola

Problem

Physical locations cannot be managed via the API. Assets cannot be tracked by building, floor, or room without this module.

Proposed Solution

Create backend/src/opsce/locations/locations.controller.ts and backend/src/opsce/locations/locations.service.ts.

Acceptance Criteria

  • POST /api/locations creates a location with optional parentId (ADMIN only)
  • GET /api/locations returns all locations as a flat list with a type filter query param
  • GET /api/locations/:id returns location with its children and asset count
  • PATCH /api/locations/:id updates location fields (ADMIN only)
  • DELETE /api/locations/:id returns 409 if any active assets are assigned to it
  • CreateLocationDto validates name, type (enum), and optional address

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