Skip to content

[BE-19] Maintenance / issue reporting: backend #1187

Description

@yusuftomilola

Overview

Members who encounter a broken chair, faulty air conditioning, or a safety hazard have no formal channel to report it in the platform. A maintenance request module creates a trackable workflow for the hub team to investigate and resolve.

Context

  • User entity: backend/src/users/entities/user.entity.ts
  • WorkspacesModule: backend/src/workspaces/ — workspace FK for issue location
  • NotificationsModule: backend/src/notifications/ — alert admins on new request; alert member on resolution
  • CloudinaryModule: backend/src/cloudinary/ — for optional photo attachment upload

Tasks

  • Create MaintenanceRequest entity: id, reportedByUserId (FK), workspaceId (FK, nullable — some issues are general), category (EQUIPMENT / FACILITY / SAFETY / OTHER), description (text), imageUrl (nullable), status (OPEN / IN_PROGRESS / RESOLVED), resolvedAt (nullable timestamptz), resolvedByStaffId (nullable FK), createdAt, updatedAt
  • POST /maintenance — member submits a request; sends in-app notification to all admins/staff
  • GET /maintenance/mine — member views their own submitted requests (paginated)
  • GET /maintenance — admin/staff views all requests (paginated, filterable by status, category, workspaceId)
  • PATCH /maintenance/:id/status — admin updates status to IN_PROGRESS or RESOLVED; when resolved, notify the reporting member via NotificationsModule and email
  • GET /maintenance/:id — detail view (admin or own request)

Files to Modify / Create

  • New: backend/src/maintenance/ (module, entity, controller, service, providers)
  • backend/src/app.module.ts

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