-
-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved LogIncident feature to own LogIncident endpoint
- Loading branch information
1 parent
b8ff999
commit af61453
Showing
4 changed files
with
28 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/LoggingIncidents/LogIncidentEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using JasperFx.Core; | ||
using Wolverine.Http; | ||
using Wolverine.Marten; | ||
|
||
namespace Helpdesk.Api.Incidents.LoggingIncidents; | ||
|
||
public static class LogIncidentEndpoint | ||
{ | ||
[WolverinePost("/api/customers/{customerId:guid}/incidents")] | ||
public static (CreationResponse, IStartStream) LogIncident( | ||
Guid customerId, | ||
LogIncidentRequest request, | ||
DateTimeOffset now | ||
) | ||
{ | ||
var (contact, description) = request; | ||
var incidentId = CombGuidIdGeneration.NewGuid(); | ||
|
||
var @event = new IncidentLogged(incidentId, customerId, contact, description, customerId, now); | ||
|
||
return ( | ||
new CreationResponse($"/api/incidents/{incidentId}"), | ||
new StartStream<Incident>(incidentId, @event) | ||
); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
Sample/Helpdesk.Wolverine/Helpdesk.Api/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters