Skip to content

[BE-22] Staff scheduling: backend #1193

Description

@yusuftomilola

Overview

Hub admins schedule staff shifts in WhatsApp or a spreadsheet. There is no platform tool for roster management, meaning staff miss shift assignments and coverage gaps go undetected. A scheduling module centralises this.

Context

  • User entity: backend/src/users/entities/user.entity.ts — staff members have role === 'staff'
  • NotificationsModule: backend/src/notifications/ — notify staff when a new shift is assigned to them

Tasks

  • Create Shift entity: id, staffUserId (FK to User where role=staff), startTime (timestamptz), endTime (timestamptz), roleName (string, e.g. "Front Desk"), notes (text, nullable), createdByAdminId (FK to User), createdAt, updatedAt
  • POST /shifts — create shift (admin only); notify the assigned staff member via NotificationsModule
  • PATCH /shifts/:id — update shift details (admin only)
  • DELETE /shifts/:id — delete shift (admin only)
  • GET /shifts — list shifts (admin: all; staff: only own shifts); supports ?startDate= and ?endDate= date range filter
  • GET /shifts/this-week — returns shifts for the current calendar week (Mon–Sun) for the requesting user (or all staff for admin)

Files to Modify / Create

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

Metadata

Metadata

Assignees

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