Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Phase 3 - DONE#64

Merged
mrmeaow merged 47 commits intomainfrom
phase-3-web
Apr 3, 2026
Merged

Phase 3 - DONE#64
mrmeaow merged 47 commits intomainfrom
phase-3-web

Conversation

@mrmeaow
Copy link
Copy Markdown
Owner

@mrmeaow mrmeaow commented Apr 3, 2026

[PHASE 3] Web tests & code-base iterations

ISSUES: #41, #42, #43, #44, #45, #46, #47, #48, #49, #50, #51, #52, #53, #54

Note

I covered all of in multiple latest PRs and this one as its final one.

mrmeaow and others added 30 commits March 26, 2026 22:27
- Add FindTicketsOptions and FindTicketsResult interfaces
- Implement cursor-based pagination with hasMore/nextCursor
- Add ownership scoping (agents see own tickets, admins see all)
- Enhance search to include both title and description
- Use QueryBuilder for complex filtering queries
- Add findByUserId method for stats aggregation
- Update service to pass userId and isAdmin to repository
- Update controller to extract isAdmin from user roles

Closes #4

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
feat(tickets): implement repository with filtering and pagination
- Enhance SseService with proper Observable-based streaming
- Add SseJobResult interface for type-safe job status updates
- Implement client subscription management with disconnect handling
- Update SSE controller to stream job results as MessageEvents
- Add JWT query param support in JwtAuthGuard for SSE connections
- Integrate SSE notifications in AiService (pending/processing/completed/failed)
- Auto-disconnect clients on final job states (completed/failed)
- Add logging for SSE client lifecycle events

Closes #6
feat(sse): implement real-time AI job status streaming
- Add Orval configuration for TypeScript SDK generation
- Update export-openapi.mjs script to include /api prefix
- Add Swagger decorators to Auth controller with DTOs
- Add Swagger decorators to Messages controller
- Generate SDK with axios-functions client
- Export generated SDK from packages/api-sdk

Closes #11

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
feat(sdk): setup Orval SDK generation from OpenAPI spec
- Add LoginComponent with form validation and error handling
- Add RegisterComponent with name/email/password validation
- Create HeaderComponent with navigation and logout button
- Integrate header into app layout for authenticated users
- Use brand-500 color scheme consistently
- Add loading states and disabled buttons during submission
- Improve error messages for better UX

Closes #7

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
feat(web): implement auth feature with login/register components
- Create TicketService with signals-based state management
- Implement TicketListComponent with filtering by status and priority
- Add search functionality for ticket title/description
- Implement cursor-based pagination with Load More button
- Add loading and error states
- Style status and priority badges with color coding
- Make table rows clickable to navigate to ticket detail
- Show total count of tickets

Closes #8

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
feat(web): implement ticket list with filters, search, and pagination
- Create MessageService for message CRUD operations
- Implement TicketDetailComponent with full ticket view
- Add message thread with chronological display
- Implement message input with send functionality
- Style messages by role (AGENT, CUSTOMER, AI) with avatars
- Show ticket metadata (status, priority, assignee, dates)
- Add loading and error states
- Back button to return to ticket list

Closes #9

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…age-thread

feat(web): implement ticket detail with message thread
- ButtonComponent: primary/secondary/danger/ghost variants, sizes, loading state
- InputComponent: label, validation, error messages, hint text
- BadgeComponent: multiple variants including priority badges
- SpinnerComponent: configurable size and color
- EmptyStateComponent: icon, title, description, action button
- ErrorMessageComponent: error/warning variants, dismissible
- ModalComponent: sm/md/lg sizes, customizable header/footer
- ToastComponent: success/error/warning/info notifications with auto-dismiss
- Export barrel file for easy imports

Closes #13

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…ents

feat(web): add shared UI components library
- Create TicketCreateComponent with form validation
- Add title, description, priority, and assignee fields
- Integrate shared InputComponent, ButtonComponent, ErrorMessageComponent
- Admin users can assign tickets to other agents
- Redirect to ticket detail on successful creation
- Show error messages for validation and API failures

Closes #16

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Create PermissionService with role-based permission mapping
- Implement HasPermissionDirective structural directive
- Support single permission or array of permissions (AND logic)
- Usage: *hasPermission="'tickets:create'"
- Integrate with AuthService for user role detection

Closes #17

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Create AdminComponent with tabbed navigation (Users, Ticket Queue)
- Users tab: display user list with roles, status, and actions
- Ticket Queue tab: placeholder for all tickets management
- Integrate shared components: Badge, Button, Spinner, ErrorMessage, EmptyState
- Add role-based badge variants (SUPER_ADMIN=red, ADMIN=yellow, etc.)
- Mock user data for demonstration
- Admin guard protects route from non-admin users

Closes #15

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…permission

feat(web): admin panel, create ticket, and permission directive
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add AiPanelComponent with 3 action buttons (Summarize, Detect Priority, Suggest Reply)
- Add AiService for AI API calls and SSE subscription
- Integrate AI panel into ticket detail page
- Display real-time job status via SSE streaming
- Show loading state during processing
- Display results or errors when job completes
- Auto-cleanup SSE connections on destroy

Closes #10

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add handleCleanupFailedAiJobs() cron running weekly on Sundays at 3AM
- Add deleteFailedJobsOlderThan() method to AiRepository
- Clean up failed AI job records older than 30 days
- Add logging for cron execution

Closes #14

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
feat(web): implement AI panel with SSE subscription for AI actions
feat(cron): add cleanup job for failed AI job records
- Add @ApiProperty with descriptions and examples to all DTOs
- Add @exclude() to sensitive fields (passwordHash, deletedAt)
- Add @ApiHideProperty to hide excluded fields from OpenAPI spec
- Add @apiresponse for all HTTP status codes (200, 201, 400, 401, 403, 404)
- Create ErrorResponseDto for consistent error responses
- Create PaginatedResponseDto for paginated list responses
- Create CreateTicketDto and UpdateTicketDto with validation
- Add examples for all error responses
- Enhance Auth controller with comprehensive documentation
- Enhance Tickets controller with comprehensive documentation
- Add ApiBearerAuth for authenticated endpoints

Closes #28

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
feat(api): enhance OpenAPI documentation for all DTOs and controllers
API (Vitest):
- Add vitest.config.ts for unit tests
- Add test/vitest-e2e.config.ts for E2E tests
- Add test/setup.ts for global test setup
- Add test scripts: test, test:watch, test:cov, test:e2e
- Install vitest, @vitest/coverage-v8, vite-tsconfig-paths

Web (Vitest + Playwright):
- Add playwright.config.ts for E2E testing
- Add src/test-setup.ts for Testing Library
- Add e2e/app.e2e.spec.ts example test
- Add test scripts: test, test:watch, test:cov, test:e2e
- Install @playwright/test, @testing-library/angular, @testing-library/jest-dom
- Install Playwright chromium browser

Closes #29, #30, #31, #32

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
mrmeaow and others added 17 commits March 27, 2026 23:13
test: setup test infrastructure for API and Web
- Auth module tests (auth.service.spec.ts)
- Tickets module tests (tickets.service.spec.ts)
- AI module tests (ai.service.spec.ts)
- Messages module tests (messages.service.spec.ts)

Test coverage:
- AuthService: register, login, validateUser
- TicketsService: CRUD operations, filtering, stats
- AiService: AI job enqueue, prompt building
- MessagesService: message creation, AI message handling

Note: Some tests need mock refinement - foundation laid for iterative improvement.

Closes #33, #34, #35, #36

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
test(api): add unit tests for backend services
Integration Tests:
- Setup Testcontainers for PostgreSQL and Redis
- Create test/containers.ts helper for container management
- Configure E2E test suite with vitest-e2e.config.ts

E2E Test Suites:
- test/e2e/auth.e2e.spec.ts - Auth flow tests (register, login)
- test/e2e/tickets.e2e.spec.ts - Ticket CRUD tests
- test/e2e/ai.e2e.spec.ts - AI job enqueue tests

Test Coverage:
- Auth: register, login, token validation
- Tickets: create, list, filter, get by ID
- AI: summarize, detect-priority, suggest-reply endpoints
- SSE: endpoint verification

Dependencies:
- @testcontainers/postgresql ^11.13.0
- @testcontainers/redis ^11.13.0

Closes #37, #38, #39, #40

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
test(api): add integration and E2E tests with Testcontainers
Integration Tests:
- Setup Testcontainers for PostgreSQL and Redis
- Create test/containers.ts helper for container management
- Configure E2E test suite with vitest-e2e.config.ts

E2E Test Suites:
- test/e2e/auth.e2e.spec.ts - Auth flow tests (register, login)
- test/e2e/tickets.e2e.spec.ts - Ticket CRUD tests
- test/e2e/ai.e2e.spec.ts - AI job enqueue tests

Test Coverage:
- Auth: register, login, token validation
- Tickets: create, list, filter, get by ID
- AI: summarize, detect-priority, suggest-reply endpoints
- SSE: endpoint verification

Dependencies:
- @testcontainers/postgresql ^11.13.0
- @testcontainers/redis ^11.13.0

Closes #37, #38, #39, #40

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
[ API ] fix: openapi inconsistency
@mrmeaow mrmeaow self-assigned this Apr 3, 2026
@mrmeaow mrmeaow added Ticket New task or development related tickets testing Testing related issues (unit, integration, E2E) backend Backend / NestJS / API related frontend Frontend / Angular / Web related e2e End-to-End testing qa Quality Assurance / Manual Testing high-priority Important for current phase labels Apr 3, 2026
@mrmeaow mrmeaow changed the title Phase 3 web Phase 3 - DONE Apr 3, 2026
@mrmeaow mrmeaow merged commit 78f90d2 into main Apr 3, 2026
0 of 6 checks passed
@mrmeaow mrmeaow deleted the phase-3-web branch April 3, 2026 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backend Backend / NestJS / API related e2e End-to-End testing frontend Frontend / Angular / Web related high-priority Important for current phase qa Quality Assurance / Manual Testing testing Testing related issues (unit, integration, E2E) Ticket New task or development related tickets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant