File size: 738 Bytes
13240d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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);