feat: implement BE-66, BE-68, QA-01, QA-04 - #1248
Conversation
- DistinctCodes#1036 BE-66: WebSocket gateway for real-time asset events and notifications - DistinctCodes#1038 BE-68: Bulk operations endpoints for assets (status, assign, delete) - DistinctCodes#1051 QA-01: Playwright E2E test suite for critical user flows - DistinctCodes#1054 QA-04: WCAG 2.1 AA accessibility fixes across main pages
|
@Mkalbani is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Mkalbani 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! 🚀 |
yusuftomilola
left a comment
There was a problem hiding this comment.
Reviewed this large diff (69 files) closing four issues:
- BE-66:
EventsGateway(JWT-authenticated WebSocket, per-user rooms,notification.new/asset.status_changed/maintenance.dueevents), aNotificationsModulepersisting notifications, and an hourly cron scanning for maintenance due within 24h. - BE-68:
PATCH /assets/bulk/status,PATCH /assets/bulk/assign,DELETE /assets/bulkwith sensible guards (skips RETIRED assets on bulk status change, requires at least one target on bulk assign). - QA-01: a Playwright e2e suite (auth, login, navigation, asset CRUD, accessibility) plus config.
- QA-04: WCAG 2.1 AA fixes across main pages, new shadcn-style UI primitives (dialog, dropdown, select, sheet, table, tabs).
Also does real cleanup this batch badly needed: deletes the duplicate typo'd backend/src/assests/ folder (superseded by the correctly-named assets/ module), and removes the dead placeholder files from earlier low-effort PRs in this batch (danielships.spec.ts, prismn.spec.ts, the unwired cloudinary testers). Rewrites auth.service.ts/auth.controller.ts to actually import real, existing modules (UsersService, User/UserRole entity, RegisterDto/LoginDto) instead of the ~12 nonexistent files the earlier auth module (from #1237, kept over #1240 per this batch's conflict policy) was broken on — verified every import in the new version resolves, and that @nestjs/jwt, bcryptjs, @nestjs/event-emitter, @nestjs/websockets, @nestjs/platform-socket.io, socket.io, and @nestjs/schedule are all declared dependencies (added by this PR's own package.json changes).
Real conflict in frontend/app/(dashboard)/dashboard/page.tsx: this PR's branch predates #1247 (merged just before it), which replaced the dashboard's static "recent assets" table with a drag-to-reorder widget system. This PR's version still has the old inline table + mobile-card markup at the same location. Confirmed the new widget system (dashboard-widgets.tsx) already renders an equivalent recent_assets widget, so nothing is lost — kept #1247's customization-toolbar JSX and dropped the superseded inline table from this PR. Verified no orphaned imports (RowSkeleton, StatusBadge, format, Link) were left dangling after the removal.
app.module.ts merged cleanly this time (no conflict) — NotificationsModule/GatewayModule registered alongside every module already present. Approving.
Summary
Implements four issues in a single branch:
Changes
Backend
#1036 BE-66 — WebSocket gateway
src/gateway/events.gateway.tstokenuser:<id>notification.new,asset.status_changed, andmaintenance.dueeventssrc/gateway/gateway.module.tswith a hourly cron scheduler that scans for maintenance records due within 24 hourssrc/notifications/module/entity/service that persists notifications and emitsnotification.newasset.status_changedevents intoAssetsService.bulkStatusEventEmitterModuleandGatewayModuleinAppModule#1038 BE-68 — Bulk asset operations
PATCH /assets/bulk/status{ ids: string[], status: AssetStatus }RETIREDassets, returns them inskippedPATCH /assets/bulk/assign{ ids: string[], userId?: string, departmentId?: string }userIdordepartmentIdDELETE /assets/bulk{ ids: string[] }ADMINrole{ succeeded, failed: { id, reason }[], skipped }ArrayMaxSizeAuditLogentry andAssetHistoryrecordsrc/audit-logs/module/serviceAuth consistency fixes required by tests
AuthService,AuthController, andAuthModuleto match existing user entity and JWT strategyJwtAuthGuardandGetUserdecoratorPOST /auth/forgot-passwordendpointCleanup
src/assests/typo foldertesters/and broken placeholder spec filesassets.service.spec.tsandauth.service.spec.tsto match current service signaturesFrontend
#1051 QA-01 — Playwright E2E
@playwright/testand@axe-core/playwrightplaywright.config.tstargetinghttp://localhost:3000with Chromiumtest:e2escript topackage.jsone2e/auth.spec.ts— register → dashboard, logout → logine2e/login.spec.ts— valid login, invalid credentials error, forgot-password successe2e/asset-crud.spec.ts— create, list, view, edit, delete with confirmatione2e/navigation.spec.ts— sidebar links without 404/blank rendere2e/accessibility.spec.ts— axe-core audits on login, dashboard, assets, settings#1054 QA-04 — Accessibility
:focus-visibleoutline rings inglobals.cssaria-labels to icon-only buttons (mobile menu, user menu, close modal, delete document/note)sr-onlylabels (asset search, filters)alttext paths for avatars and asset imagesaria-expanded/aria-haspopupto dropdown triggersSupporting UI / fixes discovered during E2E work
ui/*imports (Dialog,Select,Tabs,Sheet,Table,Badge,Avatar,Label,Textarea,DropdownMenu)forgot-passwordpageEditAssetModalcomponent anduseUpdateAssethook so the edit-asset E2E flow can runBulkActionBarandBulkAssignModalto call the new bulk endpointsVerification
cd backend && npm run buildpassescd backend && npm run testpasses (31 tests)cd frontend && npm run buildpassescd frontend && npx playwright test --listlists 17 testsNotes for reviewers
http://localhost:6003with a seeded test database (per the existing.env.examplePORT=6003).npm run test:e2e.