Spaces:
Running
Running
| using BakeryErp.Infrastructure.Repositories; | |
| using BakeryErp.Web; | |
| using Microsoft.AspNetCore.Mvc.RazorPages; | |
| namespace BakeryErp.Web.Pages; | |
| public sealed class IndexModel : PageModel | |
| { | |
| private readonly DashboardRepository _dashboardRepository; | |
| private readonly AppRuntimeInfo _runtimeInfo; | |
| public IndexModel(DashboardRepository dashboardRepository, AppRuntimeInfo runtimeInfo) | |
| { | |
| _dashboardRepository = dashboardRepository; | |
| _runtimeInfo = runtimeInfo; | |
| } | |
| public DashboardCounts Counts { get; private set; } = new(0, 0, 0, 0, 0); | |
| public string DatabasePath => _runtimeInfo.DatabasePath; | |
| public IReadOnlyList<ModuleSummary> Modules { get; } = | |
| [ | |
| new("OCR", "AI OCR 智能進貨辨識", "上傳進貨單、發票或送貨單,辨識供應商、品項、數量與金額。"), | |
| new("INV", "庫存管理", "管理原物料、半成品、成品、包材與多倉庫即時庫存。"), | |
| new("PO", "採購與月結", "建立採購單、進貨驗收、供應商月結與應付帳款。"), | |
| new("CASH", "零用金管理", "登錄門市小額支出、憑證、審核狀態與撥補紀錄。"), | |
| new("TRF", "中央廚房調撥", "處理門市叫貨、中央廚房出庫、門市收貨與差異。"), | |
| new("RTN", "門市退貨", "管理退貨申請、退貨原因、審核與後續庫存處理。") | |
| ]; | |
| public void OnGet() | |
| { | |
| Counts = _dashboardRepository.GetCounts(); | |
| } | |
| } | |
| public sealed record ModuleSummary(string Code, string Title, string Description); | |