| | | 1 | | using OzonDomains.Models; |
| | | 2 | | using OzonRepositories.Data; |
| | | 3 | | using System; |
| | | 4 | | using System.Collections.Generic; |
| | | 5 | | using System.Threading.Tasks; |
| | | 6 | | |
| | | 7 | | namespace Services.DataServices |
| | | 8 | | { |
| | | 9 | | public class FidStatDataServices |
| | | 10 | | { |
| | | 11 | | private readonly FidStatRepository _repository; |
| | | 12 | | |
| | 0 | 13 | | public FidStatDataServices(FidStatRepository repository) |
| | | 14 | | { |
| | 0 | 15 | | _repository = repository; |
| | 0 | 16 | | } |
| | | 17 | | |
| | | 18 | | public async Task<int> Add(FidStatSnapshot snapshot) => |
| | 0 | 19 | | await _repository.Add(snapshot); |
| | | 20 | | |
| | | 21 | | public async Task<List<FidStatSnapshot>> GetAll() => |
| | 0 | 22 | | await _repository.GetAll(); |
| | | 23 | | |
| | | 24 | | public async Task<List<FidStatSnapshot>> GetFiltered( |
| | | 25 | | string? fidName, |
| | | 26 | | DateTime? dateFrom, |
| | | 27 | | DateTime? dateTo, |
| | | 28 | | int skip, |
| | | 29 | | int take) => |
| | 0 | 30 | | await _repository.GetFiltered(fidName, dateFrom, dateTo, skip, take); |
| | | 31 | | |
| | | 32 | | public async Task<int> GetFilteredCount(string? fidName, DateTime? dateFrom, DateTime? dateTo) => |
| | 0 | 33 | | await _repository.GetFilteredCount(fidName, dateFrom, dateTo); |
| | | 34 | | |
| | | 35 | | public async Task<FidStatSnapshot?> GetByIdWithItems(int id) => |
| | 0 | 36 | | await _repository.GetByIdWithItems(id); |
| | | 37 | | |
| | | 38 | | public async Task<List<string>> GetDistinctFidNames() => |
| | 0 | 39 | | await _repository.GetDistinctFidNames(); |
| | | 40 | | |
| | | 41 | | public async Task<FidStatSnapshot?> GetLatest(string fidName) => |
| | 0 | 42 | | await _repository.GetLatest(fidName); |
| | | 43 | | } |
| | | 44 | | } |