Skip to content

[BE-57] Parking spot management: backend #1295

Description

@yusuftomilola

Overview

Coworking members who drive need to know whether they have an assigned parking spot. Currently there is no way for the hub to track or assign parking spots, forcing manual coordination outside the platform.

Context

  • User entity: backend/src/users/entities/user.entity.ts
  • NotificationsModule for assignment notifications: backend/src/notifications/
  • Pattern mirrors the Locker management module (BE-18)

Tasks

  • Create ParkingSpot entity: id, spotNumber (varchar, unique, e.g. A-12), level (varchar, e.g. Ground Floor), type (STANDARD / ACCESSIBLE / MOTORCYCLE / EV_CHARGING), assignedToUserId (nullable FK → User), assignedAt (nullable timestamptz), isActive (bool, default true), notes (nullable), createdAt, updatedAt
  • GET /parking — list spots:
    • Admin: all spots with assignee names, status
    • Member: only their own assigned spot (empty array if none)
  • POST /parking — add a new parking spot (admin only)
  • PATCH /parking/:id — update spot level, type, notes (admin only)
  • POST /parking/:id/assign — assign spot to a member (admin only); reject if spot already assigned; notify member in-app: "Parking spot [number] has been assigned to you"
  • POST /parking/:id/unassign — release spot (admin only); notify affected member
  • GET /parking/mine — member views their assigned spot details; returns null if none assigned
  • Register ParkingModule in AppModule

Files to Modify / Create

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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