[CLAUDE] App+Infra+FE-Admin: seed master data + MyDashboard widgets
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m48s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m48s
Task 1 — Seed master data unblock UAT/demo: - DbInitializer.SeedDepartmentsAsync: 9 departments từ QT-TP-NCC.docx (PM/QS/CCM/PRO/FIN/ACT/EQU/HRA/BOD) — reference data không phải demo. - DbInitializer.SeedDemoMasterDataAsync: 5 demo suppliers (NCC VLXD, NTP Xây dựng, TĐ Hoàng Nam, DV Clean, CĐT Vingroup — covers cả 5 SupplierType) + 3 demo projects (FLOCK01, SkyGarden, Industrial). Chỉ seed nếu tables empty — respect admin's real data khi họ add. Task 2 — Roles CRUD đã có sẵn trong UsersPage (Shield icon button mở dialog gán 12 roles từ AppRoles.cs). Skip. Task 3 — MyDashboard role-specific widgets: - GetMyDashboardQuery (Reports): returns DraftsInProgress (tôi là Drafter + phase soạn thảo), PendingMyApproval (phase eligible role tôi + không phải tôi drafter), DueSoon 24h, Overdue, DraftsTotalValue. - Endpoint GET /api/reports/my-dashboard. - FE MyDashboardRow ở đầu DashboardPage: 4 card hover → navigate. Admin ẩn row nếu tất cả = 0 (ERP noise reduction). 'Đang soạn thảo' + 'Chờ tôi duyệt' clickable → /contracts?filter=... (filter param để wire lần sau; row hiện chưa implement). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using SolutionErp.Application.Reports.Commands.ExportContractsToExcel;
|
||||
using SolutionErp.Application.Reports.Dtos;
|
||||
using SolutionErp.Application.Reports.Queries.GetDashboardStats;
|
||||
using SolutionErp.Application.Reports.Queries.GetMyDashboard;
|
||||
using SolutionErp.Domain.Contracts;
|
||||
|
||||
namespace SolutionErp.Api.Controllers;
|
||||
@ -17,6 +18,10 @@ public class ReportsController(IMediator mediator) : ControllerBase
|
||||
public async Task<ActionResult<DashboardStatsDto>> Dashboard(CancellationToken ct)
|
||||
=> Ok(await mediator.Send(new GetDashboardStatsQuery(), ct));
|
||||
|
||||
[HttpGet("my-dashboard")]
|
||||
public async Task<ActionResult<MyDashboardDto>> MyDashboard(CancellationToken ct)
|
||||
=> Ok(await mediator.Send(new GetMyDashboardQuery(), ct));
|
||||
|
||||
[HttpGet("contracts/export")]
|
||||
public async Task<IActionResult> ExportContracts(
|
||||
[FromQuery] ContractPhase? phase,
|
||||
|
||||
Reference in New Issue
Block a user