This commit is contained in:
2023-08-04 17:53:15 +03:00
parent cf89dd6a4d
commit 70edf34cf6
17 changed files with 236 additions and 86 deletions
@@ -163,4 +163,22 @@ public class CurrencyService
return result.Set(_mapper.Map<CurrencyRateDto>(rate));
}
public Exec<CurrencyDto, GeneralExecStatus> Remove(Guid userId, Guid id)
{
var result = new Exec<CurrencyDto, GeneralExecStatus>(GeneralExecStatus.success);
var currency = _currencyRepository.Get(userId, id);
if (currency == null)
{
return result.Set(GeneralExecStatus.not_found);
}
if (!_currencyRepository.Remove(currency))
{
return result.Set(GeneralExecStatus.failure);
}
return result.Set(_mapper.Map<CurrencyDto>(currency));
}
}