Skip to content

[BE-59] Member attendance history and admin attendance report #1297

Description

@yusuftomilola

Overview

Members have no way to see their own check-in history or total hours used. Admins cannot view aggregate attendance patterns. Attendance data is captured in WorkspaceLog but is never surfaced through a useful API.

Context

  • WorkspaceLog entity (check-in/out records): backend/src/workspace-tracking/ — fields: userId, workspaceId, checkInTime, checkOutTime
  • WorkspaceTrackingController: backend/src/workspace-tracking/workspace-tracking.controller.ts
  • DashboardModule admin analytics: backend/src/dashboard/providers/admin-analytics.provider.ts

Tasks

  • GET /workspace-tracking/history — paginated check-in/out log for the authenticated member:
    • Response: { data: [{ date, workspaceName, checkInTime, checkOutTime, durationMinutes }], total, page, limit }
    • Supports ?from= and ?to= date filter (ISO 8601)
  • GET /workspace-tracking/history/summary — member's personal stats:
    • totalHoursThisMonth, totalDaysThisMonth, currentStreak (consecutive calendar days with at least one check-in), longestStreak
  • Admin: GET /reports/attendance — aggregate attendance data:
    • dailyCheckIns: array of { date, count } for the last 30 days
    • peakHours: array of { hour (0–23), averageCheckIns } computed from all historical data
    • averageSessionDurationMinutes
    • topWorkspacesByCheckIns: top 5 workspaces by check-in count this month

Files to Modify / Create

  • New: backend/src/workspace-tracking/providers/attendance-history.provider.ts
  • backend/src/workspace-tracking/workspace-tracking.controller.ts
  • backend/src/dashboard/providers/admin-analytics.provider.ts
  • backend/src/dashboard/dashboard.controller.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