Skip to content

Commit

Permalink
rename event in public site
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalis committed Apr 27, 2021
1 parent f0ed2f8 commit a2b531e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public AppointmentController(IMessagePublisher messagePublisher)
[HttpGet("appointment/confirm/{id}")]
public ActionResult Confirm(Guid id)
{
var appEvent = new AppointmentConfirmedEvent(id);
var appEvent = new AppointmentConfirmLinkClickedIntegrationEvent(id);
_messagePublisher.Publish(appEvent);
return View();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace VetClinicPublic.Web.Interfaces
public interface IMessagePublisher
{
// for now we only need to publish one event type, so we're using its type specifically here.
void Publish(AppointmentConfirmedEvent eventToPublish);
void Publish(AppointmentConfirmLinkClickedIntegrationEvent eventToPublish);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace VetClinicPublic.Web.Models
{
public class AppointmentConfirmedEvent
{
public AppointmentConfirmedEvent(Guid appointmentId)
public class AppointmentConfirmLinkClickedIntegrationEvent
{
public AppointmentConfirmLinkClickedIntegrationEvent(Guid appointmentId)
{
this.Id = Guid.NewGuid();
DateTimeEventOccurred = DateTime.Now;
Expand All @@ -18,7 +18,7 @@ public string EventType
{
get
{
return "AppointmentConfirmedEvent";
return nameof(AppointmentConfirmLinkClickedIntegrationEvent);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ public Task<Unit> Handle(AppointmentDTO request,
return Task.FromResult(Unit.Value);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public RabbitMessagePublisher(IPooledObjectPolicy<IModel> objectPolicy)
_objectPool = new DefaultObjectPool<IModel>(objectPolicy, Environment.ProcessorCount * 2);
}

public void Publish(AppointmentConfirmedEvent eventToPublish)
public void Publish(AppointmentConfirmLinkClickedIntegrationEvent eventToPublish)
{
Guard.Against.Null(eventToPublish, nameof(eventToPublish));

Expand Down

0 comments on commit a2b531e

Please sign in to comment.