diff --git a/SchengenVisaApi/ApplicationLayer/Services/AuthServices/RegisterService/Exceptions/UserAlreadyExistsException.cs b/SchengenVisaApi/ApplicationLayer/Services/AuthServices/RegisterService/Exceptions/UserAlreadyExistsException.cs deleted file mode 100644 index b67668b..0000000 --- a/SchengenVisaApi/ApplicationLayer/Services/AuthServices/RegisterService/Exceptions/UserAlreadyExistsException.cs +++ /dev/null @@ -1,7 +0,0 @@ -using ApplicationLayer.GeneralExceptions; -using ApplicationLayer.Services.AuthServices.Requests; - -namespace ApplicationLayer.Services.AuthServices.RegisterService.Exceptions -{ - public class UserAlreadyExistsException(RegisterRequest request) : AlreadyExistsException($"User with email '{request.AuthData.Email}' already exists"); -} diff --git a/SchengenVisaApi/ApplicationLayer/Services/GeneralExceptions/EntityUsedInDatabaseException.cs b/SchengenVisaApi/ApplicationLayer/Services/GeneralExceptions/EntityUsedInDatabaseException.cs deleted file mode 100644 index 74c0a55..0000000 --- a/SchengenVisaApi/ApplicationLayer/Services/GeneralExceptions/EntityUsedInDatabaseException.cs +++ /dev/null @@ -1,7 +0,0 @@ -using ApplicationLayer.GeneralExceptions; - -namespace ApplicationLayer.Services.GeneralExceptions -{ - /// Exception to throw when can't complete some action on entity(delete or something) because it's needed for other entities - public class EntityUsedInDatabaseException(string message) : ApiException(message); -} diff --git a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Handlers/VisaApplicationRequestsHandler.cs b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Handlers/VisaApplicationRequestsHandler.cs index f2dba9a..a44b8b3 100644 --- a/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Handlers/VisaApplicationRequestsHandler.cs +++ b/SchengenVisaApi/ApplicationLayer/Services/VisaApplications/Handlers/VisaApplicationRequestsHandler.cs @@ -79,11 +79,9 @@ public class VisaApplicationRequestsHandler( var application = await applications.GetByIdAsync(applicationId, cancellationToken); if (application.Status != ApplicationStatus.Pending) { - //todo refactor exceptions throw new ApplicationAlreadyProcessedException(); } - //todo handle exception or not ApplicationStatus statusToSet = status switch { AuthorityRequestStatuses.Approved => ApplicationStatus.Approved,