Skip to content

Feat/department management page - #1245

Merged
yusuftomilola merged 5 commits into
DistinctCodes:mainfrom
mijinummi:feat/department-management-page
Jul 28, 2026
Merged

Feat/department management page#1245
yusuftomilola merged 5 commits into
DistinctCodes:mainfrom
mijinummi:feat/department-management-page

Conversation

@mijinummi

Copy link
Copy Markdown
Contributor

🚀 Release & Pull Request Summary: Core Platform Features

This PR delivers foundational authentication, physical asset scanning, multi-format data exports, and organizational department management UI.

Closes #1060
Closes #1039
Closes #1040
Closes #1041

1. Auth Module Implementation (#1060)

  • Scope: Backend (src/auth/)
  • Key Features:
    • Implemented JWT registration (POST /api/auth/register), login (POST /api/auth/login), logout (POST /api/auth/logout), and current user profile (GET /api/auth/me).
    • Enforced password hashing using bcrypt (minimum 8 characters validated via DTOs).
    • Generic 401 UnauthorizedException returned on credential failures to eliminate user enumeration vectors.
    • Added JwtStrategy, JwtAuthGuard, and @GetUser() decorator to protect API endpoints across modules.
    • Full OpenAPI/Swagger documentation matching frontend auth-api.ts contracts ({ accessToken, user: { id, email, firstName, lastName, role } }).

2. QR Code & Barcode Generation with Scan Lookup (#1039)

  • Scope: Backend (src/assets/)
  • Key Features:
    • Integrated bwip-js (Code128 barcodes) and qrcode for asset tracking.
    • Automated generation of QR codes (${FRONTEND_URL}/assets/{id}) and Code128 barcodes upon POST /assets creation.
    • Uploaded images directly to S3 (qrcodes/{assetId}/) using FileService with database references in Asset.qrCode and Asset.barcode.
    • Added GET /assets/:id/qrcode and GET /assets/:id/barcode returning 1-hour pre-signed S3 URLs.
    • Added GET /assets/scan?code= enabling mobile barcode scanners to resolve assets by UUID or physical assetTag.
    • Added POST /assets/:id/regenerate-codes for administrative asset tag re-generation.

3. Streaming Data Exports (#1040)

  • Scope: Backend (src/common/services/export.service.ts, src/assets/, src/audit-logs/, src/reports/)
  • Key Features:
    • Integrated exceljs and streaming writers (ExcelJS.stream.xlsx.WorkbookWriter and CSV stringifiers) for low memory footprint under high record volumes.
    • GET /assets/export: Supports CSV/XLSX streaming while preserving query filters and department RBAC boundaries for MANAGER roles.
    • GET /audit-logs/export: Restricted to ADMIN roles for compliance data dumps.
    • GET /reports/export: Streams summary analytics and category/department breakdown data.
    • Properly escaped CSV special characters and set dynamic Content-Type and Content-Disposition headers with formatted filenames (filename="[dataset]-YYYY-MM-DD.[ext]").

4. Department Management UI (#1041)

  • Scope: Frontend (frontend/app/(dashboard)/departments/page.tsx, components/departments/, lib/query/hooks/useDepartments.ts)
  • Key Features:
    • Created frontend/app/(dashboard)/departments/page.tsx displaying department names, managers, member counts, asset counts, and creation dates.
    • Built useDepartments, useCreateDepartment, useUpdateDepartment, useDeleteDepartment, useDepartmentUsers, and useDepartmentAssets React Query hooks.
    • Built DepartmentModal component supporting creation and editing with manager assignment.
    • Implemented DepartmentDrawer sliding panel with tabbed views for department members and allocated assets.
    • Added member-count warnings to the deletion flow and linked "Departments" in the sidebar under "Organisation".

📊 Summary Matrix

Issue Module Path / Area Primary Benefit
#1060 Auth src/auth/ Unblocks authentication; integrates frontend auth flow
#1039 Assets src/assets/ Enables physical tagging & mobile scan resolution
#1040 Exports src/common/, src/assets/ Low-memory CSV/XLSX reporting for compliance
#1041 UI app/(dashboard)/departments/ Complete organizational hierarchy management

Closes #1060
Closes #1039
Closes #1040
Closes #1041

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@mijinummi is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@mijinummi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@yusuftomilola

Copy link
Copy Markdown
Collaborator

@mijinummi Kindly resolve conflicts

@mijinummi

Copy link
Copy Markdown
Contributor Author

on it sir. Thanks

@yusuftomilola
yusuftomilola merged commit f6d8ac3 into DistinctCodes:main Jul 28, 2026
1 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment