pqhuy1987 d15398fafe
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Failing after 2m0s
[CLAUDE] Domain+FE: PE thêm phase TraLai + pencil always visible + edit gating
User feedback 2026-05-07:
1. Pencil edit icon LUÔN hiện (không chỉ hover) trong workspace Panel 1
2. Pencil sáng (active brand-color) khi phase editable, xám/disabled khi không
3. Click pencil khi sáng → row sáng + auto-open edit toàn bộ (header + detail)
4. Thêm phase mới "Trả lại" — approver gửi về Drafter sửa (vs Từ chối terminal)
5. Edit chỉ cho 2 trạng thái: Đang soạn thảo + Trả lại
   (Từ chối + Đã gửi duyệt + Đã duyệt → không edit/thao tác gì)

Implementation:
  ~ Domain/PurchaseEvaluations/PurchaseEvaluationPhase.cs
    + TraLai = 98 (giữa DaDuyet=7 và TuChoi=99)
    Comment ghi rõ "approver trả về Drafter sửa, vẫn cho edit, khác TuChoi"
  ~ types/purchaseEvaluation.ts (× 2 app)
    + PurchaseEvaluationPhase enum: TraLai = 98
    + PurchaseEvaluationPhaseLabel/Color cho TraLai (yellow)
    + isEditablePhase(phase) helper: true cho DangSoanThao + TraLai
    + PeDisplayStatus thêm "TraLai" (separate, không gộp DaGuiDuyet)
    + getPeDisplayStatus map TraLai → "Trả lại" badge yellow
  ~ components/pe/PeListPanel.tsx (× 2 app)
    - Pencil icon: bỏ opacity-0 hover-only → LUÔN visible
    - editable=isEditablePhase(p.phase): bright text-brand-600 + cursor-pointer
    - !editable: text-slate-300 + cursor-not-allowed + onClick guard ignored
    - title tooltip rõ ràng "đã gửi duyệt / đã duyệt / từ chối — không sửa được"
    - Bỏ forcedPhase prop → editableOnly prop (filter client-side cả 2 phase
      DangSoanThao + TraLai vì BE chưa support multi-phase param)
    - Khi editableOnly: hiển thị "Lọc cố định: Bản nháp + Trả lại" indicator
  ~ components/pe/PeDetailTabs.tsx (× 2 app)
    - Header bar: isDraft → canEditPhase = isEditablePhase(phase)
    - InfoTab: canEdit = !readOnly && isEditablePhase
    - BudgetFieldRow: canEdit = !readOnly && isEditablePhase
    → Đồng nghĩa Drafter sửa được phiếu Trả lại sau approver send back
  ~ pages/pe/PurchaseEvaluationWorkspacePage.tsx (× 2 app)
    - PeListPanel forcedPhase=DangSoanThao → editableOnly
    - Bỏ import PurchaseEvaluationPhase

Workflow service BE chưa wire transition → TraLai (defer — user sẽ thêm button
"Trả lại" trong PeWorkflowPanel duyệt sau, hoặc dùng API PATCH manual). Phase
TraLai chỉ là enum value sẵn sàng FE hiển thị + BE ánh xạ HasConversion<int>.

UAT mode: skip verify, push ngay.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 15:38:46 +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%