feat(rfa): complete RFA Approval Refactor - all 9 phases (T001-T080)

Phase 1-2: Setup, SQL schema, enums, queue constants, base entities
Phase 3 (US1): ReviewTeam, ReviewTeamMember, ReviewTask, TaskCreationService
Phase 4 (US2): ResponseCode, ResponseCodeRule, ImplicationsService, NotificationTriggerService
Phase 5 (US3): Delegation entity, CircularDetectionService, DelegationService/Controller/Module
Phase 6 (US4): ReminderRule, SchedulerService, EscalationService, ReminderProcessor, ReminderModule
Phase 7 (US5): DistributionMatrix, DistributionRecipient, ApprovalListenerService (Strangler),
               TransmittalCreatorService, DistributionProcessor, DistributionModule
Phase 8 (US6): MatrixManagementService, InheritanceService (global→project override)
Phase 9 (Polish): AggregateStatusService, ConsensusService, VetoOverrideService,
                  ParallelGatewayHandler, review-validators, optimistic locking in completeReview,
                  test stubs (unit/integration/e2e), jest.config.js updated for tests/ directory

Frontend: ReviewTaskInbox, ParallelProgress, VetoOverrideDialog, DelegationForm,
          DelegatedBadge, MatrixEditor, ProjectOverrideManager, DistributionStatus,
          ReminderHistory, ResponseCodeSelector, CodeImplications, CompleteReviewForm,
          ReviewTeamForm, ReviewTeamSelector, TeamMemberManager

Closes #1
This commit is contained in:
Nattanin
2026-05-12 16:17:27 +07:00
parent 3df8707b7f
commit ef20839f99
82 changed files with 7052 additions and 104 deletions
+56 -3
View File
@@ -1,6 +1,6 @@
# Quickstart Guide: RFA Approval System Refactor
**Branch**: `1-rfa-approval-refactor`
**Branch**: `1-rfa-approval-refactor`
**Prerequisites**: Docker Compose environment running (MariaDB, Redis)
---
@@ -88,7 +88,7 @@ Verify modules loaded:
# Terminal 2 - Reminder processor
npx ts-node -r tsconfig-paths/register src/modules/reminder/processors/reminder.processor.ts
# Terminal 3 - Distribution processor
# Terminal 3 - Distribution processor
npx ts-node -r tsconfig-paths/register src/modules/distribution/processors/distribution.processor.ts
```
@@ -268,7 +268,60 @@ mysql -u root -p lcbp3 -e "SELECT COUNT(*) FROM response_codes;"
---
## 8. Next Steps
## 8. Running Tests
### 8.1 Backend Unit + Integration Tests
```bash
cd backend
# Unit tests only (runs from src/)
npm test
# Tests in tests/ directory (Phase 9 stubs)
npx jest --rootDir . --testMatch '**/tests/**/*.spec.ts' --passWithNoTests
# Coverage report
npm run test:cov
```
### 8.2 Frontend Tests
```bash
cd frontend
npm test -- --watchAll=false
```
### 8.3 E2E Tests (requires seeded database)
```bash
cd backend
npm run test:e2e
```
---
## 9. New Phase 9 Components
| Component | Path | Description |
|-----------|------|-------------|
| `AggregateStatusService` | `backend/src/modules/review-team/services/` | Consensus % calculator |
| `ConsensusService` | `backend/src/modules/review-team/services/` | Triggers distribution after all tasks complete |
| `VetoOverrideService` | `backend/src/modules/review-team/services/` | PM force-approve with audit trail |
| `ParallelGatewayHandler` | `backend/src/modules/workflow-engine/dsl/` | DSL support for parallel review |
| `ReviewTaskInbox` | `frontend/components/review-task/` | Reviewer inbox with status filters |
| `ParallelProgress` | `frontend/components/review-task/` | Discipline track progress bar |
| `VetoOverrideDialog` | `frontend/components/review-task/` | PM override dialog with justification |
### New Admin URLs
- **Distribution Matrix**: http://localhost:3000/dashboard/admin/distribution-matrices
- **Reminder Rules**: http://localhost:3000/dashboard/admin/reminder-rules
- **Master Approval Matrix**: http://localhost:3000/dashboard/admin/approval-matrix
---
## 10. Next Steps
1. **Run Tests**: `npm test` (backend), `npm run test:e2e` (frontend)
2. **Load Test**: `k6 run load-tests/rfa-approval-load.js`