Skip to content

[BE-18] Locker management: backend #1182

Description

@yusuftomilola

Overview

Many coworking members store laptops, chargers, and personal belongings in physical lockers at the hub. Administrators currently have no platform tool to track locker assignments — this leads to double-assignments and uncollected contents.

Context

  • User entity: backend/src/users/entities/user.entity.ts
  • NotificationsModule: backend/src/notifications/ — notify member when a locker is assigned or released

Tasks

  • Create Locker entity: id, lockerNumber (string, unique), floor (string, e.g. "Floor 2"), size (SMALL / MEDIUM / LARGE), assignedToUserId (nullable FK), assignedAt (nullable timestamptz), isActive (bool), notes (text, nullable), createdAt, updatedAt
  • POST /lockers — create a locker (admin only)
  • PATCH /lockers/:id — update locker details or active status (admin only)
  • DELETE /lockers/:id — soft-delete locker (admin only; only if unassigned)
  • GET /lockers — list all lockers (admin: all; staff: all; member: only their own assigned locker)
  • GET /lockers/mine — returns the locker assigned to the current member (or null)
  • POST /lockers/:id/assign — assign locker to a member (admin only); notify member via NotificationsModule
  • POST /lockers/:id/unassign — release the locker assignment (admin only); notify former assignee

Files to Modify / Create

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

Metadata

Metadata

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