Spaces:
Running
Running
| using BakeryErp.Infrastructure.Database; | |
| namespace BakeryErp.Infrastructure.Repositories; | |
| public sealed class DashboardRepository | |
| { | |
| private readonly DatabaseOptions _options; | |
| public DashboardRepository(DatabaseOptions options) | |
| { | |
| _options = options; | |
| } | |
| public DashboardCounts GetCounts() | |
| { | |
| var store = LocalDataStoreFile.Load(_options); | |
| return new DashboardCounts( | |
| store.SupplierCount, | |
| store.ItemCount, | |
| store.StoreCount, | |
| store.WarehouseCount, | |
| store.OcrDocumentCount); | |
| } | |
| } | |
| public sealed record DashboardCounts( | |
| int SupplierCount, | |
| int ItemCount, | |
| int StoreCount, | |
| int WarehouseCount, | |
| int OcrDocumentCount); | |