diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/CategoriseIncidentTests.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/CategoriseIncidentTests.cs index 249883cfb..2e8cb2c22 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/CategoriseIncidentTests.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/CategoriseIncidentTests.cs @@ -1,5 +1,6 @@ using Bogus; using Helpdesk.Api.Incidents; +using Helpdesk.Api.Incidents.Categorising; using Helpdesk.Api.Tests.Incidents.Fixtures; using Xunit; using static Ogooreck.API.ApiSpecification; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithAcknowledgedIncident.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithAcknowledgedIncident.cs index 257935674..2fff3608f 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithAcknowledgedIncident.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithAcknowledgedIncident.cs @@ -1,4 +1,4 @@ -using Helpdesk.Api.Incidents.GetIncidentDetails; +using Helpdesk.Api.Incidents.GettingDetails; using Ogooreck.API; using Xunit; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithLoggedIncident.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithLoggedIncident.cs index 73faac318..479fd97a1 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithLoggedIncident.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithLoggedIncident.cs @@ -1,4 +1,4 @@ -using Helpdesk.Api.Incidents.GetIncidentDetails; +using Helpdesk.Api.Incidents.GettingDetails; using Ogooreck.API; using Xunit; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithResolvedIncident.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithResolvedIncident.cs index 2a7406e05..db57c043c 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithResolvedIncident.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithResolvedIncident.cs @@ -1,4 +1,4 @@ -using Helpdesk.Api.Incidents.GetIncidentDetails; +using Helpdesk.Api.Incidents.GettingDetails; using Ogooreck.API; using Xunit; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/Scenarios.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/Scenarios.cs index d69e06f50..8d7676c0d 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/Scenarios.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/Scenarios.cs @@ -1,7 +1,9 @@ using Bogus; using Bogus.DataSets; using Helpdesk.Api.Incidents; -using Helpdesk.Api.Incidents.GetIncidentDetails; +using Helpdesk.Api.Incidents.GettingDetails; +using Helpdesk.Api.Incidents.Logging; +using Helpdesk.Api.Incidents.Resolving; using Ogooreck.API; using static Ogooreck.API.ApiSpecification; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs index 0c26a5bc1..260d87541 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs @@ -1,7 +1,8 @@ using Bogus; using Bogus.DataSets; using Helpdesk.Api.Incidents; -using Helpdesk.Api.Incidents.GetIncidentDetails; +using Helpdesk.Api.Incidents.GettingDetails; +using Helpdesk.Api.Incidents.Logging; using Xunit; using Ogooreck.API; using static Ogooreck.API.ApiSpecification; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/PrioritiseIncidentTests.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/PrioritiseIncidentTests.cs index cbec22cb9..23615e516 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/PrioritiseIncidentTests.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/PrioritiseIncidentTests.cs @@ -1,5 +1,6 @@ using Bogus; using Helpdesk.Api.Incidents; +using Helpdesk.Api.Incidents.Prioritising; using Helpdesk.Api.Tests.Incidents.Fixtures; using Xunit; using static Ogooreck.API.ApiSpecification; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/RecordAgentResponseToIncidentTests.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/RecordAgentResponseToIncidentTests.cs index 590bc8ab0..51a79dde6 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/RecordAgentResponseToIncidentTests.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/RecordAgentResponseToIncidentTests.cs @@ -1,7 +1,8 @@ using Bogus; using Bogus.DataSets; using Helpdesk.Api.Incidents; -using Helpdesk.Api.Incidents.GetIncidentDetails; +using Helpdesk.Api.Incidents.GettingDetails; +using Helpdesk.Api.Incidents.RecordingAgentResponse; using Helpdesk.Api.Tests.Incidents.Fixtures; using Xunit; using static Ogooreck.API.ApiSpecification; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/RecordCustomerResponseToIncidentTests.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/RecordCustomerResponseToIncidentTests.cs index bdf5ccee3..c5e58d21a 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/RecordCustomerResponseToIncidentTests.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/RecordCustomerResponseToIncidentTests.cs @@ -1,6 +1,7 @@ using Bogus.DataSets; using Helpdesk.Api.Incidents; -using Helpdesk.Api.Incidents.GetIncidentDetails; +using Helpdesk.Api.Incidents.GettingDetails; +using Helpdesk.Api.Incidents.RecordingCustomerResponse; using Helpdesk.Api.Tests.Incidents.Fixtures; using Xunit; using static Ogooreck.API.ApiSpecification; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/ResolveIncidentTests.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/ResolveIncidentTests.cs index efcc866a5..3d6bcfb32 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/ResolveIncidentTests.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/ResolveIncidentTests.cs @@ -1,5 +1,6 @@ using Bogus; using Helpdesk.Api.Incidents; +using Helpdesk.Api.Incidents.Resolving; using Helpdesk.Api.Tests.Incidents.Fixtures; using Xunit; using static Ogooreck.API.ApiSpecification; diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/AcknowledgingResolution/AcknowledgeResolution.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/AcknowledgingResolution/AcknowledgeResolution.cs new file mode 100644 index 000000000..8502291eb --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/AcknowledgingResolution/AcknowledgeResolution.cs @@ -0,0 +1,48 @@ +using Helpdesk.Api.Core.Http; +using Helpdesk.Api.Core.Marten; +using Marten; +using Wolverine.Http; +using static Microsoft.AspNetCore.Http.TypedResults; +using static Helpdesk.Api.Incidents.IncidentService; +using static Helpdesk.Api.Core.Http.ETagExtensions; +using static System.DateTimeOffset; + +namespace Helpdesk.Api.Incidents.AcknowledgingResolution; + +public static class AcknowledgeResolutionEndpoint +{ + [WolverinePost("/api/customers/{customerId:guid}/incidents/{incidentId:guid}/acknowledge")] + public static async Task AcknowledgeResolution + ( + IDocumentSession documentSession, + Guid incidentId, + Guid customerId, + [FromIfMatchHeader] string eTag, + CancellationToken ct + ) + { + await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), + state => Handle(state, new AcknowledgeResolution(incidentId, customerId, Now)), ct); + + return Ok(); + } + + public static ResolutionAcknowledgedByCustomer Handle( + Incident current, + AcknowledgeResolution command + ) + { + if (current.Status is not IncidentStatus.Resolved) + throw new InvalidOperationException("Only resolved incident can be acknowledged"); + + var (incidentId, acknowledgedBy, now) = command; + + return new ResolutionAcknowledgedByCustomer(incidentId, acknowledgedBy, now); + } +} + +public record AcknowledgeResolution( + Guid IncidentId, + Guid AcknowledgedBy, + DateTimeOffset Now +); diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/AssigningAgent/AssignAgent.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/AssigningAgent/AssignAgent.cs new file mode 100644 index 000000000..43f7f1ae2 --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/AssigningAgent/AssignAgent.cs @@ -0,0 +1,45 @@ +using Helpdesk.Api.Core.Http; +using Helpdesk.Api.Core.Marten; +using Marten; +using Wolverine.Http; +using static Microsoft.AspNetCore.Http.TypedResults; +using static Helpdesk.Api.Incidents.IncidentService; +using static Helpdesk.Api.Core.Http.ETagExtensions; +using static System.DateTimeOffset; + +namespace Helpdesk.Api.Incidents.AssigningAgent; + +public static class AssignAgentEndpoint +{ + [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/assign")] + public static async Task AssignAgent + ( + IDocumentSession documentSession, + Guid incidentId, + Guid agentId, + [FromIfMatchHeader] string eTag, + CancellationToken ct + ) + { + await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), + state => Handle(state, new AssignAgentToIncident(incidentId, agentId, Now)), ct); + + return Ok(); + } + + public static AgentAssignedToIncident Handle(Incident current, AssignAgentToIncident command) + { + if (current.Status == IncidentStatus.Closed) + throw new InvalidOperationException("Incident is already closed"); + + var (incidentId, agentId, now) = command; + + return new AgentAssignedToIncident(incidentId, agentId, now); + } +} + +public record AssignAgentToIncident( + Guid IncidentId, + Guid AgentId, + DateTimeOffset Now +); diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Categorise/CategoriseIncidentEndpoint.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Categorising/Categorise.cs similarity index 80% rename from Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Categorise/CategoriseIncidentEndpoint.cs rename to Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Categorising/Categorise.cs index 247424cc4..f9a4d014e 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Categorise/CategoriseIncidentEndpoint.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Categorising/Categorise.cs @@ -3,9 +3,9 @@ using Wolverine.Marten; using static Microsoft.AspNetCore.Http.TypedResults; -namespace Helpdesk.Api.Incidents.Categorise; +namespace Helpdesk.Api.Incidents.Categorising; -public static class CategoriseIncidentEndpoint +public static class CategoriseEndpoint { [AggregateHandler] [WolverinePost("api/agents/{agentId:guid}/incidents/{incidentId:guid}/category")] @@ -24,3 +24,8 @@ public static (IResult, Events) Post( return (Ok(), new Events { new IncidentCategorised(incidentId, request.Category, agentId, now) }); } } + +public record CategoriseIncidentRequest( + Guid IncidentId, + IncidentCategory Category +); diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Closing/Close.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Closing/Close.cs new file mode 100644 index 000000000..f99866146 --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Closing/Close.cs @@ -0,0 +1,51 @@ +using Helpdesk.Api.Core.Http; +using Helpdesk.Api.Core.Marten; +using Marten; +using Wolverine.Http; +using static Microsoft.AspNetCore.Http.TypedResults; +using static Helpdesk.Api.Incidents.IncidentService; +using static Helpdesk.Api.Core.Http.ETagExtensions; +using static System.DateTimeOffset; + +namespace Helpdesk.Api.Incidents.Closing; + +public static class CloseEndpoint +{ + [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/close")] + public static async Task CloseIncident + ( + IDocumentSession documentSession, + Guid incidentId, + Guid agentId, + [FromIfMatchHeader] string eTag, + CancellationToken ct + ) + { + await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), + state => Handle(state, new CloseIncident(incidentId, agentId, Now)), ct); + + return Ok(); + } + + public static IncidentClosed Handle( + Incident current, + CloseIncident command + ) + { + if (current.Status is not IncidentStatus.ResolutionAcknowledgedByCustomer) + throw new InvalidOperationException("Only incident with acknowledged resolution can be closed"); + + if (current.HasOutstandingResponseToCustomer) + throw new InvalidOperationException("Cannot close incident that has outstanding responses to customer"); + + var (incidentId, acknowledgedBy, now) = command; + + return new IncidentClosed(incidentId, acknowledgedBy, now); + } +} + +public record CloseIncident( + Guid IncidentId, + Guid ClosedBy, + DateTimeOffset Now +); diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidents/GetCustomerIncidents.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidents/GetCustomerIncidents.cs new file mode 100644 index 000000000..8773cfa9f --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidents/GetCustomerIncidents.cs @@ -0,0 +1,17 @@ +using Helpdesk.Api.Incidents.GettingShortInfo; +using Marten; +using Marten.Pagination; +using Microsoft.AspNetCore.Mvc; +using Wolverine.Http; + +namespace Helpdesk.Api.Incidents.GettingCustomerIncidents; + +public static class GetCustomerIncidentsEndpoints +{ + [WolverineGet("/api/customers/{customerId:guid}/incidents/")] + public static Task> GetCustomerIncidents + (IQuerySession querySession, [FromRoute] Guid customerId, [FromQuery] int? pageNumber, [FromQuery] int? pageSize, + CancellationToken ct) => + querySession.Query().Where(i => i.CustomerId == customerId) + .ToPagedListAsync(pageNumber ?? 1, pageSize ?? 10, ct); +} diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetIncidentShortInfo/IncidentShortInfo.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidents/IncidentShortInfo.cs similarity index 96% rename from Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetIncidentShortInfo/IncidentShortInfo.cs rename to Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidents/IncidentShortInfo.cs index d1a906359..0979a0376 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetIncidentShortInfo/IncidentShortInfo.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidents/IncidentShortInfo.cs @@ -1,6 +1,6 @@ using Marten.Events.Aggregation; -namespace Helpdesk.Api.Incidents.GetIncidentShortInfo; +namespace Helpdesk.Api.Incidents.GettingShortInfo; public record IncidentShortInfo( Guid Id, diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidentsSummary/GetCustomerIncidentsSummary.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidentsSummary/GetCustomerIncidentsSummary.cs new file mode 100644 index 000000000..65135b503 --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidentsSummary/GetCustomerIncidentsSummary.cs @@ -0,0 +1,23 @@ +using Marten; +using Microsoft.AspNetCore.Mvc; +using Wolverine.Http; + +namespace Helpdesk.Api.Incidents.GettingCustomerIncidentsSummary; + +public static class GetCustomerIncidentsSummaryEndpoint +{ + // That for some reason doesn't work for me + // [WolverineGet("/api/customers/{customerId:guid}/incidents/incidents-summary")] + // public static Task GetCustomerIncidentsSummary([FromRoute] Guid customerId, HttpContext context, + // IQuerySession querySession) => + // querySession.Json.WriteById(customerId, context); + + [WolverineGet("/api/customers/{customerId:guid}/incidents/incidents-summary")] + public static Task GetCustomerIncidentsSummary( + [FromRoute] Guid customerId, + IQuerySession querySession, + CancellationToken ct + ) => + querySession.LoadAsync(customerId, ct); + +} diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetCustomerIncidentsSummary/IncidentSummary.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidentsSummary/IncidentSummary.cs similarity index 97% rename from Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetCustomerIncidentsSummary/IncidentSummary.cs rename to Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidentsSummary/IncidentSummary.cs index 818cf2567..6880c5e3c 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetCustomerIncidentsSummary/IncidentSummary.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingCustomerIncidentsSummary/IncidentSummary.cs @@ -3,7 +3,7 @@ using Marten.Events.Aggregation; using Marten.Events.Projections; -namespace Helpdesk.Api.Incidents.GetCustomerIncidentsSummary; +namespace Helpdesk.Api.Incidents.GettingCustomerIncidentsSummary; public class CustomerIncidentsSummary { diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/GetIncidentDetails.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/GetIncidentDetails.cs new file mode 100644 index 000000000..9f7d70fcf --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/GetIncidentDetails.cs @@ -0,0 +1,18 @@ +using Marten; +using Microsoft.AspNetCore.Mvc; +using Wolverine.Http; + +namespace Helpdesk.Api.Incidents.GettingDetails; + +public static class GetDetailsEndpoints +{ + // That for some reason doesn't work for me + // [WolverineGet("/api/incidents/{incidentId:guid}")] + // public static Task GetIncidentById([FromRoute] Guid incidentId, IQuerySession querySession, HttpContext context) => + // querySession.Json.WriteById(incidentId, context); + + [WolverineGet("/api/incidents/{incidentId:guid}")] + public static Task GetDetails([FromRoute] Guid incidentId, IQuerySession querySession, + CancellationToken ct) => + querySession.LoadAsync(incidentId, ct); +} diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetIncidentDetails/IncidentDetails.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/IncidentDetails.cs similarity index 98% rename from Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetIncidentDetails/IncidentDetails.cs rename to Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/IncidentDetails.cs index 949cc4e2f..b9de7826f 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetIncidentDetails/IncidentDetails.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/IncidentDetails.cs @@ -1,6 +1,6 @@ using Marten.Events.Aggregation; -namespace Helpdesk.Api.Incidents.GetIncidentDetails; +namespace Helpdesk.Api.Incidents.GettingDetails; public record IncidentDetails( Guid Id, diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingHistory/GetHistory.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingHistory/GetHistory.cs new file mode 100644 index 000000000..1ce6685aa --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingHistory/GetHistory.cs @@ -0,0 +1,21 @@ +using Marten; +using Microsoft.AspNetCore.Mvc; +using Wolverine.Http; + +namespace Helpdesk.Api.Incidents.GettingHistory; + +public static class GetHistoryEndpoint +{ + //That for some reason doesn't work for me + // [WolverineGet("/api/incidents/{incidentId:guid}/history")] + // public static Task GetIncidentHistory([FromRoute]Guid incidentId, HttpContext context, IQuerySession querySession) => + // querySession.Query().Where(i => i.IncidentId == incidentId).WriteArray(context); + + [WolverineGet("/api/incidents/{incidentId:guid}/history")] + public static Task> GetHistory( + [FromRoute] Guid incidentId, + IQuerySession querySession, + CancellationToken ct + ) => + querySession.Query().Where(i => i.IncidentId == incidentId).ToListAsync(ct); +} diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetIncidentHistory/IncidentHistory.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingHistory/IncidentHistory.cs similarity index 98% rename from Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetIncidentHistory/IncidentHistory.cs rename to Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingHistory/IncidentHistory.cs index fbf243b53..7962392c6 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GetIncidentHistory/IncidentHistory.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingHistory/IncidentHistory.cs @@ -2,7 +2,7 @@ using Marten.Events.Projections; using Marten.Schema.Identity; -namespace Helpdesk.Api.Incidents.GetIncidentHistory; +namespace Helpdesk.Api.Incidents.GettingHistory; public record IncidentHistory( Guid Id, diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/IncidentGetEndpoints.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/IncidentGetEndpoints.cs deleted file mode 100644 index f4061f144..000000000 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/IncidentGetEndpoints.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Helpdesk.Api.Incidents.GetCustomerIncidentsSummary; -using Helpdesk.Api.Incidents.GetIncidentDetails; -using Helpdesk.Api.Incidents.GetIncidentHistory; -using Helpdesk.Api.Incidents.GetIncidentShortInfo; -using Marten; -using Marten.AspNetCore; -using Marten.Pagination; -using Microsoft.AspNetCore.Mvc; -using Wolverine.Http; - -namespace Helpdesk.Api.Incidents; - -public static class IncidentGetEndpoints -{ - // That for some reason doesn't work for me - // [WolverineGet("/api/incidents/{incidentId:guid}")] - // public static Task GetIncidentById([FromRoute] Guid incidentId, IQuerySession querySession, HttpContext context) => - // querySession.Json.WriteById(incidentId, context); - - [WolverineGet("/api/incidents/{incidentId:guid}")] - public static Task GetIncidentById([FromRoute] Guid incidentId, IQuerySession querySession, - CancellationToken ct) => - querySession.LoadAsync(incidentId, ct); - - //That for some reason doesn't work for me - // [WolverineGet("/api/incidents/{incidentId:guid}/history")] - // public static Task GetIncidentHistory([FromRoute]Guid incidentId, HttpContext context, IQuerySession querySession) => - // querySession.Query().Where(i => i.IncidentId == incidentId).WriteArray(context); - - [WolverineGet("/api/incidents/{incidentId:guid}/history")] - public static Task> GetIncidentHistory( - [FromRoute] Guid incidentId, - IQuerySession querySession, - CancellationToken ct - ) => - querySession.Query().Where(i => i.IncidentId == incidentId).ToListAsync(ct); - - // That for some reason doesn't work for me - // [WolverineGet("/api/customers/{customerId:guid}/incidents/incidents-summary")] - // public static Task GetCustomerIncidentsSummary([FromRoute] Guid customerId, HttpContext context, - // IQuerySession querySession) => - // querySession.Json.WriteById(customerId, context); - - [WolverineGet("/api/customers/{customerId:guid}/incidents/incidents-summary")] - public static Task GetCustomerIncidentsSummary( - [FromRoute] Guid customerId, - IQuerySession querySession, - CancellationToken ct - ) => - querySession.LoadAsync(customerId, ct); - - - [WolverineGet("/api/customers/{customerId:guid}/incidents/")] - public static Task> GetCustomerIncidents - (IQuerySession querySession, [FromRoute] Guid customerId, [FromQuery] int? pageNumber, [FromQuery] int? pageSize, - CancellationToken ct) => - querySession.Query().Where(i => i.CustomerId == customerId) - .ToPagedListAsync(pageNumber ?? 1, pageSize ?? 10, ct); - -} diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/IncidentService.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/IncidentService.cs deleted file mode 100644 index 32bbcbaa2..000000000 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/IncidentService.cs +++ /dev/null @@ -1,165 +0,0 @@ -namespace Helpdesk.Api.Incidents; - -public record LogIncident( - Guid IncidentId, - Guid CustomerId, - Contact Contact, - string Description, - Guid LoggedBy, - DateTimeOffset Now -); - -public record CategoriseIncident( - Guid IncidentId, - IncidentCategory Category, - Guid CategorisedBy, - DateTimeOffset Now -); - -public record PrioritiseIncident( - Guid IncidentId, - IncidentPriority Priority, - Guid PrioritisedBy, - DateTimeOffset Now -); - -public record AssignAgentToIncident( - Guid IncidentId, - Guid AgentId, - DateTimeOffset Now -); - -public record RecordAgentResponseToIncident( - Guid IncidentId, - IncidentResponse.FromAgent Response, - DateTimeOffset Now -); - -public record RecordCustomerResponseToIncident( - Guid IncidentId, - IncidentResponse.FromCustomer Response, - DateTimeOffset Now -); - -public record ResolveIncident( - Guid IncidentId, - ResolutionType Resolution, - Guid ResolvedBy, - DateTimeOffset Now -); - -public record AcknowledgeResolution( - Guid IncidentId, - Guid AcknowledgedBy, - DateTimeOffset Now -); - -public record CloseIncident( - Guid IncidentId, - Guid ClosedBy, - DateTimeOffset Now -); - -internal static class IncidentService -{ - public static IncidentCategorised Handle(Incident current, CategoriseIncident command) - { - if (current.Status == IncidentStatus.Closed) - throw new InvalidOperationException("Incident is already closed"); - - var (incidentId, incidentCategory, categorisedBy, now) = command; - - return new IncidentCategorised(incidentId, incidentCategory, categorisedBy, now); - } - - public static IncidentPrioritised Handle(Incident current, PrioritiseIncident command) - { - if (current.Status == IncidentStatus.Closed) - throw new InvalidOperationException("Incident is already closed"); - - var (incidentId, incidentPriority, prioritisedBy, now) = command; - - return new IncidentPrioritised(incidentId, incidentPriority, prioritisedBy, now); - } - - public static AgentAssignedToIncident Handle(Incident current, AssignAgentToIncident command) - { - if (current.Status == IncidentStatus.Closed) - throw new InvalidOperationException("Incident is already closed"); - - var (incidentId, agentId, now) = command; - - return new AgentAssignedToIncident(incidentId, agentId, now); - } - - public static AgentRespondedToIncident Handle( - Incident current, - RecordAgentResponseToIncident command - ) - { - if (current.Status == IncidentStatus.Closed) - throw new InvalidOperationException("Incident is already closed"); - - var (incidentId, response, now) = command; - - return new AgentRespondedToIncident(incidentId, response, now); - } - - public static CustomerRespondedToIncident Handle( - Incident current, - RecordCustomerResponseToIncident command - ) - { - if (current.Status == IncidentStatus.Closed) - throw new InvalidOperationException("Incident is already closed"); - - var (incidentId, response, now) = command; - - return new CustomerRespondedToIncident(incidentId, response, now); - } - - public static IncidentResolved Handle( - Incident current, - ResolveIncident command - ) - { - if (current.Status is IncidentStatus.Resolved or IncidentStatus.Closed) - throw new InvalidOperationException("Cannot resolve already resolved or closed incident"); - - if (current.HasOutstandingResponseToCustomer) - throw new InvalidOperationException("Cannot resolve incident that has outstanding responses to customer"); - - var (incidentId, resolution, resolvedBy, now) = command; - - return new IncidentResolved(incidentId, resolution, resolvedBy, now); - } - - public static ResolutionAcknowledgedByCustomer Handle( - Incident current, - AcknowledgeResolution command - ) - { - if (current.Status is not IncidentStatus.Resolved) - throw new InvalidOperationException("Only resolved incident can be acknowledged"); - - var (incidentId, acknowledgedBy, now) = command; - - return new ResolutionAcknowledgedByCustomer(incidentId, acknowledgedBy, now); - } - - public static IncidentClosed Handle( - Incident current, - CloseIncident command - ) - { - if (current.Status is not IncidentStatus.ResolutionAcknowledgedByCustomer) - throw new InvalidOperationException("Only incident with acknowledged resolution can be closed"); - - if (current.HasOutstandingResponseToCustomer) - throw new InvalidOperationException("Cannot close incident that has outstanding responses to customer"); - - var (incidentId, acknowledgedBy, now) = command; - - return new IncidentClosed(incidentId, acknowledgedBy, now); - } -} diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/IncidentsEndpoints.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/IncidentsEndpoints.cs deleted file mode 100644 index 581d90172..000000000 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/IncidentsEndpoints.cs +++ /dev/null @@ -1,164 +0,0 @@ -using Helpdesk.Api.Core.Http; -using Helpdesk.Api.Core.Marten; -using JasperFx.Core; -using Marten; -using Wolverine.Http; -using Wolverine.Marten; -using static Microsoft.AspNetCore.Http.TypedResults; -using static Helpdesk.Api.Incidents.IncidentService; -using static Helpdesk.Api.Core.Http.ETagExtensions; -using static System.DateTimeOffset; - -namespace Helpdesk.Api.Incidents; - -public static class IncidentsEndpoints -{ - [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/priority")] - public static async Task PrioritiseIncident - ( - IDocumentSession documentSession, - Guid incidentId, - Guid agentId, - [FromIfMatchHeader] string eTag, - PrioritiseIncidentRequest body, - CancellationToken ct - ) - { - await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), - state => Handle(state, new PrioritiseIncident(incidentId, body.Priority, agentId, Now)), ct); - - return Ok(); - } - - [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/assign")] - public static async Task AssignAgentToIncident - ( - IDocumentSession documentSession, - Guid incidentId, - Guid agentId, - [FromIfMatchHeader] string eTag, - CancellationToken ct - ) - { - await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), - state => Handle(state, new AssignAgentToIncident(incidentId, agentId, Now)), ct); - - return Ok(); - } - - [WolverinePost("/api/customers/{customerId:guid}/incidents/{incidentId:guid}/responses/")] - public static async Task RecordCustomerResponseToIncident - ( - IDocumentSession documentSession, - Guid incidentId, - Guid customerId, - [FromIfMatchHeader] string eTag, - RecordCustomerResponseToIncidentRequest body, - CancellationToken ct - ) - { - await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), - state => Handle(state, - new RecordCustomerResponseToIncident(incidentId, - new IncidentResponse.FromCustomer(customerId, body.Content), Now)), ct); - - return Ok(); - } - - [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/responses/")] - public static async Task RecordAgentResponseToIncident - ( - IDocumentSession documentSession, - [FromIfMatchHeader] string eTag, - Guid incidentId, - Guid agentId, - RecordAgentResponseToIncidentRequest body, - CancellationToken ct - ) - { - var (content, visibleToCustomer) = body; - - await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), - state => Handle(state, - new RecordAgentResponseToIncident(incidentId, - new IncidentResponse.FromAgent(agentId, content, visibleToCustomer), Now)), ct); - - return Ok(); - } - - [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/resolve")] - public static async Task ResolveIncident - ( - IDocumentSession documentSession, - Guid incidentId, - Guid agentId, - [FromIfMatchHeader] string eTag, - ResolveIncidentRequest body, - CancellationToken ct - ) - { - await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), - state => Handle(state, new ResolveIncident(incidentId, body.Resolution, agentId, Now)), ct); - - return Ok(); - } - - [WolverinePost("/api/customers/{customerId:guid}/incidents/{incidentId:guid}/acknowledge")] - public static async Task AcknowledgeResolution - ( - IDocumentSession documentSession, - Guid incidentId, - Guid customerId, - [FromIfMatchHeader] string eTag, - CancellationToken ct - ) - { - await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), - state => Handle(state, new AcknowledgeResolution(incidentId, customerId, Now)), ct); - - return Ok(); - } - - [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/close")] - public static async Task CloseIncident - ( - IDocumentSession documentSession, - Guid incidentId, - Guid agentId, - [FromIfMatchHeader] string eTag, - CancellationToken ct - ) - { - await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), - state => Handle(state, new CloseIncident(incidentId, agentId, Now)), ct); - - return Ok(); - } -} - -public record LogIncidentRequest( - Contact Contact, - string Description -); - -public record CategoriseIncidentRequest( - Guid IncidentId, - IncidentCategory Category -); - -public record PrioritiseIncidentRequest( - IncidentPriority Priority -); - -public record RecordCustomerResponseToIncidentRequest( - string Content -); - -public record RecordAgentResponseToIncidentRequest( - string Content, - bool VisibleToCustomer -); - -public record ResolveIncidentRequest( - ResolutionType Resolution -); diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Logging/LogIncidentEndpoint.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Logging/Log.cs similarity index 86% rename from Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Logging/LogIncidentEndpoint.cs rename to Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Logging/Log.cs index 2c4a9ee6d..163b62c48 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Logging/LogIncidentEndpoint.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Logging/Log.cs @@ -4,7 +4,7 @@ namespace Helpdesk.Api.Incidents.Logging; -public static class LogIncidentEndpoint +public static class LogEndpoint { [WolverinePost("/api/customers/{customerId:guid}/incidents")] public static (CreationResponse, IStartStream) LogIncident( @@ -23,5 +23,9 @@ DateTimeOffset now new StartStream(incidentId, @event) ); } - } + +public record LogIncidentRequest( + Contact Contact, + string Description +); diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Prioritising/Prioritise.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Prioritising/Prioritise.cs new file mode 100644 index 000000000..50c58c224 --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Prioritising/Prioritise.cs @@ -0,0 +1,52 @@ +using Helpdesk.Api.Core.Http; +using Helpdesk.Api.Core.Marten; +using Marten; +using Wolverine.Http; +using static Microsoft.AspNetCore.Http.TypedResults; +using static Helpdesk.Api.Incidents.IncidentService; +using static Helpdesk.Api.Core.Http.ETagExtensions; +using static System.DateTimeOffset; + +namespace Helpdesk.Api.Incidents.Prioritising; + +public static class PrioritiseEndpoint +{ + [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/priority")] + public static async Task Prioritise + ( + IDocumentSession documentSession, + Guid incidentId, + Guid agentId, + [FromIfMatchHeader] string eTag, + PrioritiseIncidentRequest body, + CancellationToken ct + ) + { + await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), + state => Handle(state, new PrioritiseIncident(incidentId, body.Priority, agentId, Now)), ct); + + return Ok(); + } + + public static IncidentPrioritised Handle(Incident current, PrioritiseIncident command) + { + if (current.Status == IncidentStatus.Closed) + throw new InvalidOperationException("Incident is already closed"); + + var (incidentId, incidentPriority, prioritisedBy, now) = command; + + return new IncidentPrioritised(incidentId, incidentPriority, prioritisedBy, now); + } +} + +public record PrioritiseIncidentRequest( + IncidentPriority Priority +); + + +public record PrioritiseIncident( + Guid IncidentId, + IncidentPriority Priority, + Guid PrioritisedBy, + DateTimeOffset Now +); diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/RecordingAgentResponse/RecordAgentResponse.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/RecordingAgentResponse/RecordAgentResponse.cs new file mode 100644 index 000000000..51adf1292 --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/RecordingAgentResponse/RecordAgentResponse.cs @@ -0,0 +1,58 @@ +using Helpdesk.Api.Core.Http; +using Helpdesk.Api.Core.Marten; +using Marten; +using Wolverine.Http; +using static Microsoft.AspNetCore.Http.TypedResults; +using static Helpdesk.Api.Incidents.IncidentService; +using static Helpdesk.Api.Core.Http.ETagExtensions; +using static System.DateTimeOffset; + +namespace Helpdesk.Api.Incidents.RecordingAgentResponse; + +public static class RecordAgentResponseEndpoint +{ + [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/responses/")] + public static async Task RecordAgentResponseToIncident + ( + IDocumentSession documentSession, + [FromIfMatchHeader] string eTag, + Guid incidentId, + Guid agentId, + RecordAgentResponseToIncidentRequest body, + CancellationToken ct + ) + { + var (content, visibleToCustomer) = body; + + await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), + state => Handle(state, + new RecordAgentResponseToIncident(incidentId, + new IncidentResponse.FromAgent(agentId, content, visibleToCustomer), Now)), ct); + + return Ok(); + } + + public static AgentRespondedToIncident Handle( + Incident current, + RecordAgentResponseToIncident command + ) + { + if (current.Status == IncidentStatus.Closed) + throw new InvalidOperationException("Incident is already closed"); + + var (incidentId, response, now) = command; + + return new AgentRespondedToIncident(incidentId, response, now); + } +} + +public record RecordAgentResponseToIncident( + Guid IncidentId, + IncidentResponse.FromAgent Response, + DateTimeOffset Now +); + +public record RecordAgentResponseToIncidentRequest( + string Content, + bool VisibleToCustomer +); diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/RecordingCustomerResponse/RecordCustomerResponse.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/RecordingCustomerResponse/RecordCustomerResponse.cs new file mode 100644 index 000000000..e14743d11 --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/RecordingCustomerResponse/RecordCustomerResponse.cs @@ -0,0 +1,56 @@ +using Helpdesk.Api.Core.Http; +using Helpdesk.Api.Core.Marten; +using Marten; +using Wolverine.Http; +using static Microsoft.AspNetCore.Http.TypedResults; +using static Helpdesk.Api.Incidents.IncidentService; +using static Helpdesk.Api.Core.Http.ETagExtensions; +using static System.DateTimeOffset; + +namespace Helpdesk.Api.Incidents.RecordingCustomerResponse; + +public static class RecordCustomerResponseEndpoint +{ + [WolverinePost("/api/customers/{customerId:guid}/incidents/{incidentId:guid}/responses/")] + public static async Task RecordCustomerResponse + ( + IDocumentSession documentSession, + Guid incidentId, + Guid customerId, + [FromIfMatchHeader] string eTag, + RecordCustomerResponseToIncidentRequest body, + CancellationToken ct + ) + { + await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), + state => Handle(state, + new RecordCustomerResponseToIncident(incidentId, + new IncidentResponse.FromCustomer(customerId, body.Content), Now)), ct); + + return Ok(); + } + + public static CustomerRespondedToIncident Handle( + Incident current, + RecordCustomerResponseToIncident command + ) + { + if (current.Status == IncidentStatus.Closed) + throw new InvalidOperationException("Incident is already closed"); + + var (incidentId, response, now) = command; + + return new CustomerRespondedToIncident(incidentId, response, now); + } +} + +public record RecordCustomerResponseToIncidentRequest( + string Content +); + +public record RecordCustomerResponseToIncident( + Guid IncidentId, + IncidentResponse.FromCustomer Response, + DateTimeOffset Now +); + diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Resolving/Resolve.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Resolving/Resolve.cs new file mode 100644 index 000000000..9d08fd68e --- /dev/null +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/Resolving/Resolve.cs @@ -0,0 +1,57 @@ +using Helpdesk.Api.Core.Http; +using Helpdesk.Api.Core.Marten; +using Marten; +using Wolverine.Http; +using static Microsoft.AspNetCore.Http.TypedResults; +using static Helpdesk.Api.Incidents.IncidentService; +using static Helpdesk.Api.Core.Http.ETagExtensions; +using static System.DateTimeOffset; + +namespace Helpdesk.Api.Incidents.Resolving; + +public static class ResolveEndpoint +{ + [WolverinePost("/api/agents/{agentId:guid}/incidents/{incidentId:guid}/resolve")] + public static async Task ResolveIncident + ( + IDocumentSession documentSession, + Guid incidentId, + Guid agentId, + [FromIfMatchHeader] string eTag, + ResolveIncidentRequest body, + CancellationToken ct + ) + { + await documentSession.GetAndUpdate(incidentId, ToExpectedVersion(eTag), + state => Handle(state, new ResolveIncident(incidentId, body.Resolution, agentId, Now)), ct); + + return Ok(); + } + + public static IncidentResolved Handle( + Incident current, + ResolveIncident command + ) + { + if (current.Status is IncidentStatus.Resolved or IncidentStatus.Closed) + throw new InvalidOperationException("Cannot resolve already resolved or closed incident"); + + if (current.HasOutstandingResponseToCustomer) + throw new InvalidOperationException("Cannot resolve incident that has outstanding responses to customer"); + + var (incidentId, resolution, resolvedBy, now) = command; + + return new IncidentResolved(incidentId, resolution, resolvedBy, now); + } +} + +public record ResolveIncidentRequest( + ResolutionType Resolution +); + +public record ResolveIncident( + Guid IncidentId, + ResolutionType Resolution, + Guid ResolvedBy, + DateTimeOffset Now +); diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Program.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Program.cs index e359caa1c..2527d4cdd 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Program.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Program.cs @@ -1,16 +1,18 @@ using System.Text.Json.Serialization; +using Helpdesk.Api; using Helpdesk.Api.Core.Kafka; using Helpdesk.Api.Core.SignalR; using Helpdesk.Api.Incidents; -using Helpdesk.Api.Incidents.GetCustomerIncidentsSummary; -using Helpdesk.Api.Incidents.GetIncidentDetails; -using Helpdesk.Api.Incidents.GetIncidentHistory; -using Helpdesk.Api.Incidents.GetIncidentShortInfo; +using Helpdesk.Api.Incidents.GettingCustomerIncidentsSummary; +using Helpdesk.Api.Incidents.GettingDetails; +using Helpdesk.Api.Incidents.GettingHistory; +using Helpdesk.Api.Incidents.GettingShortInfo; using JasperFx.CodeGeneration; using Marten; using Marten.Events.Daemon.Resiliency; using Marten.Events.Projections; using Marten.Services.Json; +using Microsoft.AspNetCore.Http.Json; using Microsoft.AspNetCore.SignalR; using Oakton; using Oakton.Resources; @@ -18,7 +20,6 @@ using Wolverine; using Wolverine.Http; using Wolverine.Marten; -using JsonOptions = Microsoft.AspNetCore.Http.Json.JsonOptions; var builder = WebApplication.CreateBuilder(args); @@ -101,10 +102,13 @@ return await app.RunOaktonCommands(args); -public class IncidentsHub: Hub +namespace Helpdesk.Api { -} + public class IncidentsHub: Hub + { + } -public partial class Program -{ + public partial class Program + { + } }