pqhuy1987 de0f38dd25
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m14s
[CLAUDE] PE Panel 3: bỏ phase cards + render flow workflow V2 thực tế
User feedback: "bỏ luôn cái quy trình phía trên đi nhé, vì nó là trạng
thái rồi (đã có badge), update cái flow quy trình mới vào bên panel 3
đang đến ai".

BE — ApprovalFlow DTO mới (full snapshot Bước → Cấp → NV với Status):
- PurchaseEvaluationApprovalFlowDto { CurrentStepIndex, CurrentLevelOrder,
  Steps[] }
- PurchaseEvaluationApprovalFlowStepDto { Order, Name, DepartmentId/Name,
  Status, Levels[] }
- PurchaseEvaluationApprovalFlowLevelDto { Order, Name, Approvers[], Status }
- Status: "Done" | "Current" | "Pending"

Handler GetById compute Status logic:
  - Phase=DaDuyet  → tất cả Steps/Levels "Done"
  - Phase=Nháp/Trả lại/Từ chối → tất cả "Pending"
  - Phase=ChoDuyet:
    * Step.Index < currentIdx          → all Levels "Done"
    * Step.Index == currentIdx:
        Level.Order < currentLevelOrder → "Done"
        Level.Order == currentLevelOrder → "Current"
        Level.Order > currentLevelOrder → "Pending"
    * Step.Index > currentIdx           → all "Pending"
- Load Approvers info (FullName + Email) qua UserManager batch query

FE (cả 2 app mirror):
- types/purchaseEvaluation.ts: +PeApprovalFlow + Step + Level + Status union
  PeDetail.approvalFlow optional
- PeWorkflowPanel:
  * BỎ phase cards section (4 ô Nháp/TraLai/ChoDuyet/DaDuyet) — đã
    duplicate với status badge ở header
  * Header mới: "Quy trình duyệt" + Code + Version + Name workflow pin
  * Render Flow vertical: Bước (icon ✓/●/○) → border + bg theo status
    + dept badge → list Cấp (icon nhỏ) với label "đang chờ" / "đã
    duyệt" + tên NV duyệt
  * Phiếu V1 legacy (no flow): show note "dùng quy trình cũ — không
    khả dụng chi tiết"
  * Bỏ helper isPastPhase() (orphan sau khi xóa cards)

Verify: BE build 0 error · 2 FE builds OK.

Test eoffice:
1. Mở phiếu V2 đang ChoDuyet → thấy flow Bước 1 (Phòng A):
   ✓ Cấp 1 NV X (đã duyệt)
   ● Cấp 2 NV Y (đang chờ)  ← highlight
   ○ Cấp 3 NV Z (chưa)
2. Phase=DaDuyet → all Steps/Levels green ✓
3. Phase=Nháp/TraLai → all greyed ○
4. V1 legacy → fallback note
2026-05-08 16:16:40 +07:00

SOLUTION_ERP

Hệ thống quản lý Hợp đồng Nhà cung cấp / Thầu phụ / Tổ đội cho Công ty TNHH Xây dựng Solutions.

📘 AI context: CLAUDE.md (pointer) → docs/CLAUDE.md (full)

Quick start (dev)

Yêu cầu: .NET 10 SDK, Node 20+, SQL Server (local hoặc qua Docker).

# 1. DB — chạy SQL Server qua Docker (nếu chưa có local)
docker compose up -d

# 2. Backend — migration + run Api (port 5443)
dotnet ef database update --project src/Backend/SolutionErp.Infrastructure --startup-project src/Backend/SolutionErp.Api
dotnet run --project src/Backend/SolutionErp.Api

# 3. Frontend admin (port 8082) — terminal mới
cd fe-admin
npm install
npm run dev

# 4. Frontend user (port 8080) — terminal mới
cd fe-user
npm install
npm run dev

Admin mặc định (sẽ seed sau Phase 1): admin@solutionerp.local / Admin@123456

Architecture

fe-admin (:8082)          fe-user (:8080)
       │                        │
       └────── /api proxy ──────┘
                  ▼
         SolutionErp.Api (:5443)
                  │
   ┌──────────────┼──────────────┐
   ▼              ▼              ▼
 Application   Domain      Infrastructure ── SQL Server

Tech stack

  • Backend: .NET 10 + Clean Architecture + CQRS (MediatR) + FluentValidation + AutoMapper + EF Core + ASP.NET Identity + JWT
  • Frontend: React 18 + Vite + TypeScript + Tailwind + shadcn/ui + TanStack Query
  • DB: SQL Server 2022
  • Deploy: Windows Server + IIS

Roadmap

Phase Tuần Focus
0 Draft T1 Scaffold, parse FORM + QUY_TRINH
1 Alpha Core T2-4 Auth, Permission, CRUD master
2 Form Engine T5-6 Render template docx/xlsx
3 Workflow T7-9 State machine 9 phase
4 Report + Polish T10-11 Dashboard + Excel export
5 Production T12-13 CI/CD IIS, UAT, go-live

Chi tiết ở docs/changelog/migration-todos.md.

License

Proprietary — Công ty TNHH Xây dựng Solutions.

Description
H? th?ng qu?n l� H?p d?ng NCC/Th?u ph?/T? d?i � .NET 10 Clean Arch + 2 React FE
Readme 8.6 MiB
Languages
C# 55%
TypeScript 42.7%
PowerShell 1.3%
JavaScript 0.3%
CSS 0.3%
Other 0.3%