Browse Source

refactor

pull/79/head
Halil İbrahim Kalkan 5 years ago
parent
commit
2b07713b73
  1. 2
      src/EventHub.Domain.Shared/EventHubErrorCodes.cs
  2. 2
      src/EventHub.Domain/Events/EventManager.cs
  3. 2
      src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs

2
src/EventHub.Domain.Shared/EventHubErrorCodes.cs

@ -9,7 +9,7 @@
public const string CantRegisterOrUnregisterForAPastEvent = "EventHub:CantRegisterOrUnregisterForAPastEvent";
public const string NotAuthorizedToUpdateOrganizationProfile = "EventHub:NotAuthorizedToUpdateOrganizationProfile";
public const string CapacityOfEventFull = "EventHub:CapacityOfEventFull";
public const string CapacityCantBeLowerThanRegisteredUserCount = "EventHub:CapacityCantBeLowerThanRegisteredUserCount";
public const string CapacityCanNotBeLowerThanRegisteredUserCount = "EventHub:CapacityCantBeLowerThanRegisteredUserCount";
public const string NotAuthorizedToUpdateEvent = "EventHub:NotAuthorizedToUpdateEvent";
public const string CantChangeEventTiming = "EventHub:CantChangeEventTiming";
public const string SessionTimeShouldBeInTheEventTime = "EventHub:SessionTimeShouldBeInTheEventTime";

2
src/EventHub.Domain/Events/EventManager.cs

@ -53,7 +53,7 @@ namespace EventHub.Events
var registeredUserCount = await _eventRegistrationRepository.CountAsync(x => x.EventId == @event.Id);
if (capacity.Value < registeredUserCount)
{
throw new BusinessException(EventHubErrorCodes.CapacityCantBeLowerThanRegisteredUserCount);
throw new BusinessException(EventHubErrorCodes.CapacityCanNotBeLowerThanRegisteredUserCount);
}
}

2
src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs

@ -32,7 +32,7 @@ namespace EventHub.Events.Registrations
var registrationCount = await _eventRegistrationRepository.CountAsync(x => x.EventId == @event.Id);
if (@event.Capacity != null && registrationCount >= @event.Capacity)
if (@event.Capacity != null && registrationCount >= @event.Capacity)
{
throw new BusinessException(EventHubErrorCodes.CapacityOfEventFull)
.WithData("EventTitle", @event.Title);

Loading…
Cancel
Save