| | | 1 | | using OzonDomains; |
| | | 2 | | using OzonDomains.Models; |
| | | 3 | | using OzonRepositories.Data; |
| | | 4 | | |
| | | 5 | | namespace Services.DataServices |
| | | 6 | | { |
| | | 7 | | public class StatusTransitionDataServices : IDataServices |
| | | 8 | | { |
| | | 9 | | private readonly StatusTransitionRepository _repository; |
| | | 10 | | |
| | 1 | 11 | | public StatusTransitionDataServices(StatusTransitionRepository repository) |
| | | 12 | | { |
| | 1 | 13 | | _repository = repository; |
| | 1 | 14 | | } |
| | | 15 | | |
| | | 16 | | public Task<int> Add(StatusTransition value) |
| | | 17 | | { |
| | 0 | 18 | | return _repository.Add(value); |
| | | 19 | | } |
| | | 20 | | |
| | | 21 | | public Task<int> Delete(StatusTransition value) |
| | | 22 | | { |
| | 0 | 23 | | return _repository.Delete(value); |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | public async Task<List<StatusTransition>> Get() |
| | | 27 | | { |
| | 0 | 28 | | return await _repository.Get(); |
| | 0 | 29 | | } |
| | | 30 | | |
| | | 31 | | public async Task<List<StatusTransition>> GetActive() |
| | | 32 | | { |
| | 1 | 33 | | return await _repository.GetActive(); |
| | 1 | 34 | | } |
| | | 35 | | |
| | | 36 | | public async Task<StatusTransition?> GetAsync(int id) |
| | | 37 | | { |
| | 0 | 38 | | return await _repository.GetAsync(id); |
| | 0 | 39 | | } |
| | | 40 | | |
| | | 41 | | public async Task<StatusTransition?> GetAsync(StatusTransition value) |
| | | 42 | | { |
| | 0 | 43 | | return await _repository.GetAsync(value); |
| | 0 | 44 | | } |
| | | 45 | | |
| | | 46 | | public async Task<List<StatusTransition>> GetByFromStatusId(int fromStatusId) |
| | | 47 | | { |
| | 0 | 48 | | return await _repository.GetByFromStatusId(fromStatusId); |
| | 0 | 49 | | } |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// Получает активные переходы по типу транзакции. |
| | | 53 | | /// </summary> |
| | | 54 | | public async Task<List<StatusTransition>> GetByTransactionType(TransactionType transactionType) |
| | | 55 | | { |
| | 0 | 56 | | return await _repository.GetByTransactionType(transactionType); |
| | 0 | 57 | | } |
| | | 58 | | |
| | | 59 | | public async Task<int> Update(StatusTransition value) |
| | | 60 | | { |
| | 0 | 61 | | return await _repository.Update(value); |
| | 0 | 62 | | } |
| | | 63 | | |
| | | 64 | | public async Task<int> SaveChanges() |
| | | 65 | | { |
| | 0 | 66 | | return await _repository.SaveChanges(); |
| | 0 | 67 | | } |
| | | 68 | | } |
| | | 69 | | } |