Backend (.NET 10): - Domain: BaseEntity/AuditableEntity, ContractType/Phase/ApprovalDecision enums, User/Role (Identity<Guid>), AppRoles (12 const) - Application: IApplicationDbContext/ICurrentUser/IDateTime/IJwtTokenService, custom exceptions, ValidationBehavior (MediatR pipeline), Auth CQRS (Login/Refresh/Me), DependencyInjection - Infrastructure: ApplicationDbContext (IdentityDbContext), AuditingInterceptor (auto audit + soft delete), DbInitializer (seed 12 role + admin), DesignTimeDbContextFactory, JwtTokenService, DateTimeService, DI - Api: CurrentUserService, GlobalExceptionMiddleware (ProblemDetails), AuthController, Program.cs rewrite (Serilog + JWT + CORS + Swagger), appsettings + launchSettings (port 5443) - Migration Init applied to SolutionErp_Dev LocalDB Frontend (React 19 + Vite 8 + Tailwind 4): - fe-admin (:8082 blue) + fe-user (:8080 emerald) - shared structure, khac menu + brand color - Tailwind 4 via @tailwindcss/vite plugin, theme brand colors - AuthContext (localStorage token), ProtectedRoute, Layout (sidebar + header) - UI kit: Button/Input/Label (CVA + Tailwind) - LoginPage voi toast error, DashboardPage/InboxPage placeholder - Axios interceptor: auto Bearer + 401 redirect - TanStack Query client, React Router 7, Sonner toast Package downgrades (do .NET 10 / TS 6 compat): - MediatR 14 -> 12.4.1 (v14 breaking changes) - Swashbuckle 10 -> 6.9.0 (v10 khong tuong thich OpenApi 2) - Removed Microsoft.AspNetCore.OpenApi (conflict voi Swashbuckle) E2E verified: POST /api/auth/login qua Vite proxy ca 2 FE -> JWT + user info Credentials seed: admin@solutionerp.local / Admin@123456 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
77 lines
3.4 KiB
Markdown
77 lines
3.4 KiB
Markdown
# STATUS — Snapshot hiện tại
|
||
|
||
> **Update rule:** trước khi bắt đầu 1 task → ghi row vào `🔥 In Progress`. Xong → chuyển sang `✅ Recently Done`.
|
||
|
||
**Last updated:** 2026-04-21 11:00
|
||
|
||
## 📍 Phase hiện tại: **Phase 1 — Alpha Core** (foundation xong, chờ đợt 2)
|
||
|
||
## 🔥 In Progress
|
||
|
||
_(không có — Phase 1 foundation xong, chờ quyết định bước tiếp)_
|
||
|
||
## ✅ Recently Done (newest on top)
|
||
|
||
| Ngày | Ai | Task | Commit |
|
||
|---|---|---|---|
|
||
| 2026-04-21 | Claude | **Phase 1 foundation HOÀN TẤT** — BE (Clean Arch + Identity + JWT + migration) + FE (2 app, Tailwind 4, Router, AuthContext, Login) — E2E login pass qua Vite proxy | (chưa commit, sắp xong) |
|
||
| 2026-04-21 | Claude | **Phase 0 HOÀN TẤT** — scaffold + parse FORM/QUY_TRINH + docs + skills + git init | `25dad7f` |
|
||
|
||
Session logs:
|
||
- [`changelog/sessions/2026-04-21-1045-phase0-scaffold.md`](changelog/sessions/2026-04-21-1045-phase0-scaffold.md)
|
||
- [`changelog/sessions/2026-04-21-1100-phase1-foundation.md`](changelog/sessions/2026-04-21-1100-phase1-foundation.md)
|
||
|
||
## 🎯 Next up — Phase 1 đợt 2 (CRUD master + Permission Matrix)
|
||
|
||
### Backend
|
||
- [ ] `Domain/Entities/Supplier`, `Project`, `Department` (+ EF configurations)
|
||
- [ ] `Application/Suppliers/{Commands,Queries}/*` (Create, Update, Delete, GetById, List)
|
||
- [ ] Tương tự cho Project + Department
|
||
- [ ] `Api/Controllers/{SuppliersController, ProjectsController, DepartmentsController}`
|
||
- [ ] Pagination, search, sort server-side (`GetListQuery` với `PagedResult<T>`)
|
||
- [ ] Migration 2: `AddMasterData`
|
||
|
||
### Permission Matrix
|
||
- [ ] `Domain/Entities/MenuItem`, `Permission`
|
||
- [ ] Seed default menu tree (based on FE screens)
|
||
- [ ] `Application/Permissions/Queries/GetMyMenuTreeQuery`
|
||
- [ ] `Api/Controllers/{MenusController, RolesController, PermissionsController}`
|
||
- [ ] Admin UI: Permission Matrix grid (role × menu × CRUD checkbox)
|
||
|
||
### Contract draft (chưa workflow)
|
||
- [ ] `Domain/Entities/Contract` skeleton (không state machine)
|
||
- [ ] Basic CRUD controller + FE list page
|
||
|
||
### FE
|
||
- [ ] `<PermissionGuard menuKey="Contracts">` + `usePermission()` hook
|
||
- [ ] 3 trang CRUD admin (Suppliers / Projects / Departments) với table + modal
|
||
- [ ] Route guard theo role (admin-only routes)
|
||
|
||
## 📊 Thông số sau Phase 1 foundation
|
||
|
||
- **Backend LOC:** ~400 (Domain 60 + Application 170 + Infrastructure 190 + Api 120)
|
||
- **Frontend LOC:** ~450 mỗi app (shared 90%)
|
||
- **Build time:** .NET ~4s, FE TS check ~3s mỗi app, Vite dev ~3s ready
|
||
- **E2E verified:** Login (fe-admin proxy + fe-user proxy) → API → JWT + user info + /me
|
||
|
||
## 🚨 Blockers / risks
|
||
|
||
- ⏳ **Gitea remote** chưa có URL — push sau
|
||
- ⚠️ **Swashbuckle 10.x** không tương thích với .NET 10 + Microsoft.OpenApi 2.0 — đã downgrade về 6.9.0. Theo dõi update sau.
|
||
- ⚠️ **MediatR 14.x** breaking changes — đã downgrade về 12.4.1. Ok cho Phase 1-5.
|
||
- ⚠️ **Microsoft.AspNetCore.OpenApi** đã remove (conflict Swashbuckle 6.9). Nếu sau muốn dùng built-in OpenAPI thì phải chọn 1 trong 2.
|
||
- ⚠️ **Design-time DB (`SolutionErp_Design`)** được tạo khi chạy `dotnet ef` — có thể drop an toàn (không chứa data thật)
|
||
- ⚠️ **3 file `.doc` FORM** chưa convert được — Phase 2
|
||
|
||
## Credentials mặc định
|
||
|
||
```
|
||
Email: admin@solutionerp.local
|
||
Password: Admin@123456
|
||
```
|
||
|
||
URLs dev:
|
||
- API: http://localhost:5443 — Swagger ở `/swagger`
|
||
- Admin FE: http://localhost:8082
|
||
- User FE: http://localhost:8080
|