fix: поправил комменты и сообщения у логгера
This commit is contained in:
@@ -51,7 +51,7 @@ internal class ClerkBusinessLogicContract(
|
||||
|
||||
public void InsertClerk(ClerkDataModel clerkDataModel)
|
||||
{
|
||||
_logger.LogInformation($"Insert clerk: {JsonSerializer.Serialize(clerkDataModel)}");
|
||||
_logger.LogInformation("Insert storekeeper: {storekeeper}", JsonSerializer.Serialize(clerkDataModel));
|
||||
ArgumentNullException.ThrowIfNull(clerkDataModel);
|
||||
clerkDataModel.Validate();
|
||||
_clerkStorageContract.AddElement(clerkDataModel);
|
||||
|
||||
@@ -26,7 +26,7 @@ internal class ClientBusinessLogicContract(
|
||||
|
||||
public List<ClientDataModel> GetAllClients()
|
||||
{
|
||||
_logger.LogInformation("get all clerks");
|
||||
_logger.LogInformation("get all clients");
|
||||
return _clientStorageContract.GetList();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ internal class ClientBusinessLogicContract(
|
||||
|
||||
public ClientDataModel GetClientByData(string data)
|
||||
{
|
||||
_logger.LogInformation($"Get client by data: {data}");
|
||||
_logger.LogInformation("Get client by data: {data}", data);
|
||||
if (data.IsEmpty())
|
||||
{
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
|
||||
@@ -94,7 +94,7 @@ internal class ReplenishmentBusinessLogicContract(
|
||||
public void InsertReplenishment(ReplenishmentDataModel replenishmentataModel)
|
||||
{
|
||||
_logger.LogInformation(
|
||||
"Insert period: {period}",
|
||||
"Insert replenishment: {replenishment}",
|
||||
JsonSerializer.Serialize(replenishmentataModel)
|
||||
);
|
||||
ArgumentNullException.ThrowIfNull(replenishmentataModel);
|
||||
@@ -104,7 +104,7 @@ internal class ReplenishmentBusinessLogicContract(
|
||||
|
||||
public void UpdateReplenishment(ReplenishmentDataModel replenishmentataModel)
|
||||
{
|
||||
_logger.LogInformation("Update period: {period}", replenishmentataModel);
|
||||
_logger.LogInformation("Update replenishment: {replenishment}", replenishmentataModel);
|
||||
ArgumentNullException.ThrowIfNull(replenishmentataModel);
|
||||
replenishmentataModel.Validate();
|
||||
_replenishmentStorageContract.UpdElement(replenishmentataModel);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace BankContracts.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Ошибка для не найденного элемента в бизнес логике и контрактах
|
||||
/// Исключение для не найденного элемента в бизнес логике и контрактах
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
public class ElementNotFoundException(string message) : Exception(message) { }
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
namespace BankContracts.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Исключения для валидации дат
|
||||
/// </summary>
|
||||
/// <param name="from">начальная дата</param>
|
||||
/// <param name="to">конечная дата</param>
|
||||
public class IncorrectDatesException(DateTime from, DateTime to) : Exception($"date: {from} is older than {to}") { }
|
||||
|
||||
Reference in New Issue
Block a user