diff --git a/README.md b/README.md index 4bef3c5..657e1f3 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ dotnet new trax-server -n MyApp --ConnectionString "Host=db.example.com;Port=543 The template creates an ASP.NET Core project with: -- `AddTrax` configured with `AddEffects` (Postgres, step logging, step progress), `AddMediator`, and `AddScheduler` +- `AddTrax` configured with `AddEffects` (Postgres, junction logging, junction progress), `AddMediator`, and `AddScheduler` - `AddTraxDashboard` for the control room - `AddScheduler` with a sample `HelloWorldTrain` departing every 20 seconds - A `Trains/` directory with an example train, cargo type, interface, and stop @@ -51,7 +51,7 @@ The sample includes: - **HelloWorldTrain** — a simple scheduled train that logs a greeting every 20 seconds - **ExtractImportTrain** — a multi-stop ETL train with 10 parallel manifests departing every 5 minutes - **TransformLoadTrain** — a connected departure that runs after extract arrives -- **DataQualityCheckTrain** — a dormant train waiting in the yard, activated from a step when anomalies are detected +- **DataQualityCheckTrain** — a dormant train waiting in the yard, activated from a junction when anomalies are detected - Journey log cleanup configuration for the HelloWorld train ### Flowthru Spaceflights @@ -62,7 +62,7 @@ A data pipeline sample using the [Flowthru](https://github.com/chaoticgoodcomput | Package | Purpose | |---------|---------| -| [Trax.Core](https://www.nuget.org/packages/Trax.Core/) | The locomotive — `Train`, steps, railway programming | +| [Trax.Core](https://www.nuget.org/packages/Trax.Core/) | The locomotive — `Train`, junctions, railway programming | | [Trax.Effect](https://www.nuget.org/packages/Trax.Effect/) | `ServiceTrain` with journey logging and station services | | [Trax.Mediator](https://www.nuget.org/packages/Trax.Mediator/) | Dispatch station — route cargo to the right train via `TrainBus` | | [Trax.Scheduler](https://www.nuget.org/packages/Trax.Scheduler/) | Timetables — recurring trains with retries and dead-lettering | diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/CreateChatRoomTrain.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/CreateChatRoomTrain.cs index c94eeef..466dc67 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/CreateChatRoomTrain.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/CreateChatRoomTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ChatService.Trains.CreateChatRoom.Steps; +using Trax.Samples.ChatService.Trains.CreateChatRoom.Junctions; namespace Trax.Samples.ChatService.Trains.CreateChatRoom; @@ -13,5 +13,5 @@ public class CreateChatRoomTrain { protected override async Task> RunInternal( CreateChatRoomInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Steps/PersistRoomStep.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Junctions/PersistRoomJunction.cs similarity index 83% rename from samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Steps/PersistRoomStep.cs rename to samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Junctions/PersistRoomJunction.cs index 5b3f74a..d910a45 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Steps/PersistRoomStep.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Junctions/PersistRoomJunction.cs @@ -1,12 +1,12 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; using Trax.Samples.ChatService.Data; using Trax.Samples.ChatService.Data.Entities; -namespace Trax.Samples.ChatService.Trains.CreateChatRoom.Steps; +namespace Trax.Samples.ChatService.Trains.CreateChatRoom.Junctions; -public class PersistRoomStep(ChatDbContext db, ILogger logger) - : Step +public class PersistRoomJunction(ChatDbContext db, ILogger logger) + : Junction { public override async Task Run(CreateChatRoomInput input) { diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Steps/ValidateInputStep.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Junctions/ValidateInputJunction.cs similarity index 75% rename from samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Steps/ValidateInputStep.cs rename to samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Junctions/ValidateInputJunction.cs index 05ce294..987ba02 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Steps/ValidateInputStep.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/CreateChatRoom/Junctions/ValidateInputJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.ChatService.Trains.CreateChatRoom.Steps; +namespace Trax.Samples.ChatService.Trains.CreateChatRoom.Junctions; -public class ValidateInputStep(ILogger logger) - : Step +public class ValidateInputJunction(ILogger logger) + : Junction { public override Task Run(CreateChatRoomInput input) { diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/GetChatHistoryTrain.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/GetChatHistoryTrain.cs index 939751f..0acf8a8 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/GetChatHistoryTrain.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/GetChatHistoryTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ChatService.Trains.GetChatHistory.Steps; +using Trax.Samples.ChatService.Trains.GetChatHistory.Junctions; namespace Trax.Samples.ChatService.Trains.GetChatHistory; @@ -12,5 +12,5 @@ public class GetChatHistoryTrain { protected override async Task> RunInternal( GetChatHistoryInput input - ) => Activate(input).Chain().Resolve(); + ) => Activate(input).Chain().Resolve(); } diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/Steps/FetchMessagesStep.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/Junctions/FetchMessagesJunction.cs similarity index 84% rename from samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/Steps/FetchMessagesStep.cs rename to samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/Junctions/FetchMessagesJunction.cs index 7219f3e..2fcb317 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/Steps/FetchMessagesStep.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatHistory/Junctions/FetchMessagesJunction.cs @@ -1,12 +1,12 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; using Trax.Samples.ChatService.Data; -namespace Trax.Samples.ChatService.Trains.GetChatHistory.Steps; +namespace Trax.Samples.ChatService.Trains.GetChatHistory.Junctions; -public class FetchMessagesStep(ChatDbContext db, ILogger logger) - : Step +public class FetchMessagesJunction(ChatDbContext db, ILogger logger) + : Junction { public override async Task Run(GetChatHistoryInput input) { diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/GetChatRoomsTrain.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/GetChatRoomsTrain.cs index 059ec78..8755570 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/GetChatRoomsTrain.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/GetChatRoomsTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ChatService.Trains.GetChatRooms.Steps; +using Trax.Samples.ChatService.Trains.GetChatRooms.Junctions; namespace Trax.Samples.ChatService.Trains.GetChatRooms; @@ -12,5 +12,5 @@ public class GetChatRoomsTrain { protected override async Task> RunInternal( GetChatRoomsInput input - ) => Activate(input).Chain().Resolve(); + ) => Activate(input).Chain().Resolve(); } diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/Steps/FetchRoomsStep.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/Junctions/FetchRoomsJunction.cs similarity index 83% rename from samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/Steps/FetchRoomsStep.cs rename to samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/Junctions/FetchRoomsJunction.cs index b22220a..334b1c0 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/Steps/FetchRoomsStep.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/GetChatRooms/Junctions/FetchRoomsJunction.cs @@ -1,12 +1,12 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; using Trax.Samples.ChatService.Data; -namespace Trax.Samples.ChatService.Trains.GetChatRooms.Steps; +namespace Trax.Samples.ChatService.Trains.GetChatRooms.Junctions; -public class FetchRoomsStep(ChatDbContext db, ILogger logger) - : Step +public class FetchRoomsJunction(ChatDbContext db, ILogger logger) + : Junction { public override async Task Run(GetChatRoomsInput input) { diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/JoinChatRoomTrain.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/JoinChatRoomTrain.cs index 284e613..73b2c33 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/JoinChatRoomTrain.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/JoinChatRoomTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ChatService.Trains.JoinChatRoom.Steps; +using Trax.Samples.ChatService.Trains.JoinChatRoom.Junctions; namespace Trax.Samples.ChatService.Trains.JoinChatRoom; @@ -13,5 +13,5 @@ public class JoinChatRoomTrain { protected override async Task> RunInternal( JoinChatRoomInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Steps/AddParticipantStep.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Junctions/AddParticipantJunction.cs similarity index 80% rename from samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Steps/AddParticipantStep.cs rename to samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Junctions/AddParticipantJunction.cs index bf2176e..85d00a9 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Steps/AddParticipantStep.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Junctions/AddParticipantJunction.cs @@ -1,12 +1,12 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; using Trax.Samples.ChatService.Data; using Trax.Samples.ChatService.Data.Entities; -namespace Trax.Samples.ChatService.Trains.JoinChatRoom.Steps; +namespace Trax.Samples.ChatService.Trains.JoinChatRoom.Junctions; -public class AddParticipantStep(ChatDbContext db, ILogger logger) - : Step +public class AddParticipantJunction(ChatDbContext db, ILogger logger) + : Junction { public override async Task Run(JoinChatRoomInput input) { diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Steps/ValidateJoinStep.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Junctions/ValidateJoinJunction.cs similarity index 80% rename from samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Steps/ValidateJoinStep.cs rename to samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Junctions/ValidateJoinJunction.cs index 9ca0042..8fd8cbf 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Steps/ValidateJoinStep.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/JoinChatRoom/Junctions/ValidateJoinJunction.cs @@ -1,12 +1,12 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; using Trax.Samples.ChatService.Data; -namespace Trax.Samples.ChatService.Trains.JoinChatRoom.Steps; +namespace Trax.Samples.ChatService.Trains.JoinChatRoom.Junctions; -public class ValidateJoinStep(ChatDbContext db, ILogger logger) - : Step +public class ValidateJoinJunction(ChatDbContext db, ILogger logger) + : Junction { public override async Task Run(JoinChatRoomInput input) { diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/Steps/UpdateLastReadStep.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/Junctions/UpdateLastReadJunction.cs similarity index 78% rename from samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/Steps/UpdateLastReadStep.cs rename to samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/Junctions/UpdateLastReadJunction.cs index eaa11bc..231b436 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/Steps/UpdateLastReadStep.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/Junctions/UpdateLastReadJunction.cs @@ -1,13 +1,13 @@ using LanguageExt; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; using Trax.Samples.ChatService.Data; -namespace Trax.Samples.ChatService.Trains.MarkChatAsRead.Steps; +namespace Trax.Samples.ChatService.Trains.MarkChatAsRead.Junctions; -public class UpdateLastReadStep(ChatDbContext db, ILogger logger) - : Step +public class UpdateLastReadJunction(ChatDbContext db, ILogger logger) + : Junction { public override async Task Run(MarkChatAsReadInput input) { diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/MarkChatAsReadTrain.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/MarkChatAsReadTrain.cs index 853ae61..65be8c1 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/MarkChatAsReadTrain.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/MarkChatAsRead/MarkChatAsReadTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ChatService.Trains.MarkChatAsRead.Steps; +using Trax.Samples.ChatService.Trains.MarkChatAsRead.Junctions; namespace Trax.Samples.ChatService.Trains.MarkChatAsRead; @@ -9,5 +9,5 @@ namespace Trax.Samples.ChatService.Trains.MarkChatAsRead; public class MarkChatAsReadTrain : ServiceTrain, IMarkChatAsReadTrain { protected override async Task> RunInternal(MarkChatAsReadInput input) => - Activate(input).Chain().Resolve(); + Activate(input).Chain().Resolve(); } diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Steps/PersistMessageStep.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Junctions/PersistMessageJunction.cs similarity index 85% rename from samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Steps/PersistMessageStep.cs rename to samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Junctions/PersistMessageJunction.cs index b0474f0..207fa65 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Steps/PersistMessageStep.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Junctions/PersistMessageJunction.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; using Trax.Samples.ChatService.Data; using Trax.Samples.ChatService.Data.Entities; -namespace Trax.Samples.ChatService.Trains.SendMessage.Steps; +namespace Trax.Samples.ChatService.Trains.SendMessage.Junctions; -public class PersistMessageStep(ChatDbContext db, ILogger logger) - : Step +public class PersistMessageJunction(ChatDbContext db, ILogger logger) + : Junction { public override async Task Run(SendMessageInput input) { diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Steps/ValidateSenderStep.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Junctions/ValidateSenderJunction.cs similarity index 78% rename from samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Steps/ValidateSenderStep.cs rename to samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Junctions/ValidateSenderJunction.cs index ab39d0b..14832f0 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Steps/ValidateSenderStep.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/Junctions/ValidateSenderJunction.cs @@ -1,12 +1,12 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; using Trax.Samples.ChatService.Data; -namespace Trax.Samples.ChatService.Trains.SendMessage.Steps; +namespace Trax.Samples.ChatService.Trains.SendMessage.Junctions; -public class ValidateSenderStep(ChatDbContext db, ILogger logger) - : Step +public class ValidateSenderJunction(ChatDbContext db, ILogger logger) + : Junction { public override async Task Run(SendMessageInput input) { diff --git a/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/SendMessageTrain.cs b/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/SendMessageTrain.cs index e500fe8..bd97b65 100644 --- a/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/SendMessageTrain.cs +++ b/samples/ChatService/Trax.Samples.ChatService/Trains/SendMessage/SendMessageTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ChatService.Trains.SendMessage.Steps; +using Trax.Samples.ChatService.Trains.SendMessage.Junctions; namespace Trax.Samples.ChatService.Trains.SendMessage; @@ -11,5 +11,5 @@ public class SendMessageTrain : ServiceTrain> RunInternal( SendMessageInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights.Scheduler/Program.cs b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights.Scheduler/Program.cs index 16aafdf..110fc99 100644 --- a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights.Scheduler/Program.cs +++ b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights.Scheduler/Program.cs @@ -22,9 +22,9 @@ using Trax.Effect.Data.Extensions; using Trax.Effect.Data.Postgres.Extensions; using Trax.Effect.Extensions; +using Trax.Effect.JunctionProvider.Progress.Extensions; using Trax.Effect.Provider.Json.Extensions; using Trax.Effect.Provider.Parameter.Extensions; -using Trax.Effect.StepProvider.Progress.Extensions; using Trax.Mediator.Extensions; using Trax.Samples.Flowthru.Spaceflights; using Trax.Samples.Flowthru.Spaceflights.Trains.DataProcessing; @@ -78,7 +78,7 @@ .AddDataContextLogging() .AddJson() .SaveTrainParameters() - .AddStepProgress() + .AddJunctionProgress() ) .AddMediator(typeof(ManifestNames).Assembly) .AddScheduler(scheduler => diff --git a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights.Scheduler/Trax.Samples.Flowthru.Spaceflights.Scheduler.csproj b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights.Scheduler/Trax.Samples.Flowthru.Spaceflights.Scheduler.csproj index d9c2f60..f775d4d 100644 --- a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights.Scheduler/Trax.Samples.Flowthru.Spaceflights.Scheduler.csproj +++ b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights.Scheduler/Trax.Samples.Flowthru.Spaceflights.Scheduler.csproj @@ -17,7 +17,7 @@ - + diff --git a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/DataProcessingTrain.cs b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/DataProcessingTrain.cs index f8890a2..59f266d 100644 --- a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/DataProcessingTrain.cs +++ b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/DataProcessingTrain.cs @@ -1,6 +1,6 @@ using LanguageExt; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.Flowthru.Spaceflights.Trains.DataProcessing.Steps; +using Trax.Samples.Flowthru.Spaceflights.Trains.DataProcessing.Junctions; namespace Trax.Samples.Flowthru.Spaceflights.Trains.DataProcessing; @@ -14,5 +14,5 @@ public class DataProcessingTrain { protected override async Task> RunInternal( DataProcessingPipelineInput input - ) => Activate(input).Chain().Resolve(); + ) => Activate(input).Chain().Resolve(); } diff --git a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/Steps/ExecuteDataProcessingStep.cs b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/Junctions/ExecuteDataProcessingJunction.cs similarity index 89% rename from samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/Steps/ExecuteDataProcessingStep.cs rename to samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/Junctions/ExecuteDataProcessingJunction.cs index ea7f4e5..0ad67ad 100644 --- a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/Steps/ExecuteDataProcessingStep.cs +++ b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataProcessing/Junctions/ExecuteDataProcessingJunction.cs @@ -2,9 +2,9 @@ using Flowthru.Services; using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.Flowthru.Spaceflights.Trains.DataProcessing.Steps; +namespace Trax.Samples.Flowthru.Spaceflights.Trains.DataProcessing.Junctions; /// /// Executes the flowthru DataProcessing pipeline. @@ -12,10 +12,10 @@ namespace Trax.Samples.Flowthru.Spaceflights.Trains.DataProcessing.Steps; /// /// Pipeline logic by @Spelkington — https://github.com/chaoticgoodcomputing/flowthru /// -public class ExecuteDataProcessingStep( +public class ExecuteDataProcessingJunction( IFlowthruService flowthruService, - ILogger logger -) : Step + ILogger logger +) : Junction { public override async Task Run(DataProcessingPipelineInput input) { diff --git a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/DataScienceTrain.cs b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/DataScienceTrain.cs index 631fbdb..c7269aa 100644 --- a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/DataScienceTrain.cs +++ b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/DataScienceTrain.cs @@ -1,6 +1,6 @@ using LanguageExt; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.Flowthru.Spaceflights.Trains.DataScience.Steps; +using Trax.Samples.Flowthru.Spaceflights.Trains.DataScience.Junctions; namespace Trax.Samples.Flowthru.Spaceflights.Trains.DataScience; @@ -12,5 +12,5 @@ public class DataScienceTrain : ServiceTrain, ID { protected override async Task> RunInternal( DataSciencePipelineInput input - ) => Activate(input).Chain().Resolve(); + ) => Activate(input).Chain().Resolve(); } diff --git a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/Steps/ExecuteDataScienceStep.cs b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/Junctions/ExecuteDataScienceJunction.cs similarity index 90% rename from samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/Steps/ExecuteDataScienceStep.cs rename to samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/Junctions/ExecuteDataScienceJunction.cs index 6771592..8e5b9a8 100644 --- a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/Steps/ExecuteDataScienceStep.cs +++ b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/DataScience/Junctions/ExecuteDataScienceJunction.cs @@ -2,9 +2,9 @@ using Flowthru.Services; using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.Flowthru.Spaceflights.Trains.DataScience.Steps; +namespace Trax.Samples.Flowthru.Spaceflights.Trains.DataScience.Junctions; /// /// Executes the flowthru DataScience pipeline. @@ -12,10 +12,10 @@ namespace Trax.Samples.Flowthru.Spaceflights.Trains.DataScience.Steps; /// /// Pipeline logic by @Spelkington — https://github.com/chaoticgoodcomputing/flowthru /// -public class ExecuteDataScienceStep( +public class ExecuteDataScienceJunction( IFlowthruService flowthruService, - ILogger logger -) : Step + ILogger logger +) : Junction { public override async Task Run(DataSciencePipelineInput input) { diff --git a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/Steps/ExecuteReportingStep.cs b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/Junctions/ExecuteReportingJunction.cs similarity index 86% rename from samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/Steps/ExecuteReportingStep.cs rename to samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/Junctions/ExecuteReportingJunction.cs index 3800e50..3584258 100644 --- a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/Steps/ExecuteReportingStep.cs +++ b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/Junctions/ExecuteReportingJunction.cs @@ -2,9 +2,9 @@ using Flowthru.Services; using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.Flowthru.Spaceflights.Trains.Reporting.Steps; +namespace Trax.Samples.Flowthru.Spaceflights.Trains.Reporting.Junctions; /// /// Executes the flowthru Reporting pipeline. @@ -12,10 +12,10 @@ namespace Trax.Samples.Flowthru.Spaceflights.Trains.Reporting.Steps; /// /// Pipeline logic by @Spelkington — https://github.com/chaoticgoodcomputing/flowthru /// -public class ExecuteReportingStep( +public class ExecuteReportingJunction( IFlowthruService flowthruService, - ILogger logger -) : Step + ILogger logger +) : Junction { public override async Task Run(ReportingPipelineInput input) { diff --git a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/ReportingTrain.cs b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/ReportingTrain.cs index 171e56c..2281338 100644 --- a/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/ReportingTrain.cs +++ b/samples/DataPipeline/Trax.Samples.Flowthru.Spaceflights/Trains/Reporting/ReportingTrain.cs @@ -1,6 +1,6 @@ using LanguageExt; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.Flowthru.Spaceflights.Trains.Reporting.Steps; +using Trax.Samples.Flowthru.Spaceflights.Trains.Reporting.Junctions; namespace Trax.Samples.Flowthru.Spaceflights.Trains.Reporting; @@ -12,5 +12,5 @@ public class ReportingTrain : ServiceTrain, IRepor { protected override async Task> RunInternal( ReportingPipelineInput input - ) => Activate(input).Chain().Resolve(); + ) => Activate(input).Chain().Resolve(); } diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub.Hub/Program.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub.Hub/Program.cs index db992fc..671aa47 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub.Hub/Program.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub.Hub/Program.cs @@ -52,10 +52,10 @@ using Trax.Effect.Data.Extensions; using Trax.Effect.Data.Postgres.Extensions; using Trax.Effect.Extensions; +using Trax.Effect.JunctionProvider.Progress.Extensions; using Trax.Effect.Models.Manifest; using Trax.Effect.Provider.Json.Extensions; using Trax.Effect.Provider.Parameter.Extensions; -using Trax.Effect.StepProvider.Progress.Extensions; using Trax.Mediator.Extensions; using Trax.Samples.EnergyHub; using Trax.Samples.EnergyHub.Trains.BatteryStorage.ManageBatteryStorage; @@ -87,7 +87,7 @@ .AddDataContextLogging() .AddJson() .SaveTrainParameters() - .AddStepProgress() + .AddJunctionProgress() .UseBroadcaster(b => b.UseRabbitMq(rabbitMqConnectionString)) ) .AddMediator(typeof(ManifestNames).Assembly) diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub.Hub/Trax.Samples.EnergyHub.Hub.csproj b/samples/DistributedWorkers/Trax.Samples.EnergyHub.Hub/Trax.Samples.EnergyHub.Hub.csproj index 0d5a76a..6a5dc8c 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub.Hub/Trax.Samples.EnergyHub.Hub.csproj +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub.Hub/Trax.Samples.EnergyHub.Hub.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub.Worker/Program.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub.Worker/Program.cs index ce6fafc..cebf473 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub.Worker/Program.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub.Worker/Program.cs @@ -26,9 +26,9 @@ using Trax.Effect.Broadcaster.RabbitMQ.Extensions; using Trax.Effect.Data.Postgres.Extensions; using Trax.Effect.Extensions; +using Trax.Effect.JunctionProvider.Progress.Extensions; using Trax.Effect.Provider.Json.Extensions; using Trax.Effect.Provider.Parameter.Extensions; -using Trax.Effect.StepProvider.Progress.Extensions; using Trax.Mediator.Extensions; using Trax.Samples.EnergyHub; using Trax.Scheduler.Extensions; @@ -56,7 +56,7 @@ .UsePostgres(connectionString) .AddJson() .SaveTrainParameters() - .AddStepProgress() + .AddJunctionProgress() .UseBroadcaster(b => b.UseRabbitMq(rabbitMqConnectionString)) ) .AddMediator(typeof(ManifestNames).Assembly) diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub.Worker/Trax.Samples.EnergyHub.Worker.csproj b/samples/DistributedWorkers/Trax.Samples.EnergyHub.Worker/Trax.Samples.EnergyHub.Worker.csproj index 158da86..de684e1 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub.Worker/Trax.Samples.EnergyHub.Worker.csproj +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub.Worker/Trax.Samples.EnergyHub.Worker.csproj @@ -14,7 +14,7 @@ - + diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Steps/OptimizeChargeLevelStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Junctions/OptimizeChargeLevelJunction.cs similarity index 83% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Steps/OptimizeChargeLevelStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Junctions/OptimizeChargeLevelJunction.cs index d24ee82..af4ce61 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Steps/OptimizeChargeLevelStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Junctions/OptimizeChargeLevelJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.BatteryStorage.ManageBatteryStorage.Steps; +namespace Trax.Samples.EnergyHub.Trains.BatteryStorage.ManageBatteryStorage.Junctions; -public class OptimizeChargeLevelStep(ILogger logger) - : Step +public class OptimizeChargeLevelJunction(ILogger logger) + : Junction { public override async Task Run(ManageBatteryStorageInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Steps/ReadBatteryStateStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Junctions/ReadBatteryStateJunction.cs similarity index 76% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Steps/ReadBatteryStateStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Junctions/ReadBatteryStateJunction.cs index ec5c32e..57d3348 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Steps/ReadBatteryStateStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/Junctions/ReadBatteryStateJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.BatteryStorage.ManageBatteryStorage.Steps; +namespace Trax.Samples.EnergyHub.Trains.BatteryStorage.ManageBatteryStorage.Junctions; -public class ReadBatteryStateStep(ILogger logger) - : Step +public class ReadBatteryStateJunction(ILogger logger) + : Junction { public override async Task Run(ManageBatteryStorageInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/ManageBatteryStorageTrain.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/ManageBatteryStorageTrain.cs index c043e50..6e03cda 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/ManageBatteryStorageTrain.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/BatteryStorage/ManageBatteryStorage/ManageBatteryStorageTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.EnergyHub.Trains.BatteryStorage.ManageBatteryStorage.Steps; +using Trax.Samples.EnergyHub.Trains.BatteryStorage.ManageBatteryStorage.Junctions; namespace Trax.Samples.EnergyHub.Trains.BatteryStorage.ManageBatteryStorage; @@ -18,5 +18,9 @@ public class ManageBatteryStorageTrain { protected override async Task> RunInternal( ManageBatteryStorageInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => + Activate(input) + .Chain() + .Chain() + .Resolve(); } diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Steps/CalculateBillingStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Junctions/CalculateBillingJunction.cs similarity index 81% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Steps/CalculateBillingStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Junctions/CalculateBillingJunction.cs index b62ac5e..e9aaee1 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Steps/CalculateBillingStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Junctions/CalculateBillingJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.ChargingSessions.ProcessChargingSession.Steps; +namespace Trax.Samples.EnergyHub.Trains.ChargingSessions.ProcessChargingSession.Junctions; -public class CalculateBillingStep(ILogger logger) - : Step +public class CalculateBillingJunction(ILogger logger) + : Junction { public override async Task Run(ProcessChargingSessionInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Steps/CollectSessionDataStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Junctions/CollectSessionDataJunction.cs similarity index 74% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Steps/CollectSessionDataStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Junctions/CollectSessionDataJunction.cs index de7b8ff..f75bcda 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Steps/CollectSessionDataStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/Junctions/CollectSessionDataJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.ChargingSessions.ProcessChargingSession.Steps; +namespace Trax.Samples.EnergyHub.Trains.ChargingSessions.ProcessChargingSession.Junctions; -public class CollectSessionDataStep(ILogger logger) - : Step +public class CollectSessionDataJunction(ILogger logger) + : Junction { public override async Task Run(ProcessChargingSessionInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/ProcessChargingSessionTrain.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/ProcessChargingSessionTrain.cs index d03821d..bfad5cb 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/ProcessChargingSessionTrain.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/ChargingSessions/ProcessChargingSession/ProcessChargingSessionTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.EnergyHub.Trains.ChargingSessions.ProcessChargingSession.Steps; +using Trax.Samples.EnergyHub.Trains.ChargingSessions.ProcessChargingSession.Junctions; namespace Trax.Samples.EnergyHub.Trains.ChargingSessions.ProcessChargingSession; @@ -18,5 +18,9 @@ public class ProcessChargingSessionTrain { protected override async Task> RunInternal( ProcessChargingSessionInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => + Activate(input) + .Chain() + .Chain() + .Resolve(); } diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Steps/CalculateExcessStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Junctions/CalculateExcessJunction.cs similarity index 75% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Steps/CalculateExcessStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Junctions/CalculateExcessJunction.cs index ee11400..a950665 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Steps/CalculateExcessStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Junctions/CalculateExcessJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.GridTrading.TradeGridEnergy.Steps; +namespace Trax.Samples.EnergyHub.Trains.GridTrading.TradeGridEnergy.Junctions; -public class CalculateExcessStep(ILogger logger) - : Step +public class CalculateExcessJunction(ILogger logger) + : Junction { public override async Task Run(TradeGridEnergyInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Steps/SubmitToUbossStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Junctions/SubmitToUbossJunction.cs similarity index 84% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Steps/SubmitToUbossStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Junctions/SubmitToUbossJunction.cs index 6f291d3..e8d8ed3 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Steps/SubmitToUbossStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/Junctions/SubmitToUbossJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.GridTrading.TradeGridEnergy.Steps; +namespace Trax.Samples.EnergyHub.Trains.GridTrading.TradeGridEnergy.Junctions; -public class SubmitToUbossStep(ILogger logger) - : Step +public class SubmitToUbossJunction(ILogger logger) + : Junction { public override async Task Run(TradeGridEnergyInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/TradeGridEnergyTrain.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/TradeGridEnergyTrain.cs index d9db90d..98e7922 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/TradeGridEnergyTrain.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/GridTrading/TradeGridEnergy/TradeGridEnergyTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.EnergyHub.Trains.GridTrading.TradeGridEnergy.Steps; +using Trax.Samples.EnergyHub.Trains.GridTrading.TradeGridEnergy.Junctions; namespace Trax.Samples.EnergyHub.Trains.GridTrading.TradeGridEnergy; @@ -22,5 +22,5 @@ public class TradeGridEnergyTrain { protected override async Task> RunInternal( TradeGridEnergyInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Steps/ApplyDistributionStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Junctions/ApplyDistributionJunction.cs similarity index 78% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Steps/ApplyDistributionStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Junctions/ApplyDistributionJunction.cs index 74a9006..ec61bce 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Steps/ApplyDistributionStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Junctions/ApplyDistributionJunction.cs @@ -1,11 +1,11 @@ using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.Microgrid.OptimizeMicrogrid.Steps; +namespace Trax.Samples.EnergyHub.Trains.Microgrid.OptimizeMicrogrid.Junctions; -public class ApplyDistributionStep(ILogger logger) - : Step +public class ApplyDistributionJunction(ILogger logger) + : Junction { public override async Task Run(OptimizeMicrogridInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Steps/GatherEnergyMetricsStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Junctions/GatherEnergyMetricsJunction.cs similarity index 75% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Steps/GatherEnergyMetricsStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Junctions/GatherEnergyMetricsJunction.cs index 2f16114..5f9bc25 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Steps/GatherEnergyMetricsStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/Junctions/GatherEnergyMetricsJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.Microgrid.OptimizeMicrogrid.Steps; +namespace Trax.Samples.EnergyHub.Trains.Microgrid.OptimizeMicrogrid.Junctions; -public class GatherEnergyMetricsStep(ILogger logger) - : Step +public class GatherEnergyMetricsJunction(ILogger logger) + : Junction { public override async Task Run(OptimizeMicrogridInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/OptimizeMicrogridTrain.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/OptimizeMicrogridTrain.cs index be1a010..e8e6862 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/OptimizeMicrogridTrain.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Microgrid/OptimizeMicrogrid/OptimizeMicrogridTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.EnergyHub.Trains.Microgrid.OptimizeMicrogrid.Steps; +using Trax.Samples.EnergyHub.Trains.Microgrid.OptimizeMicrogrid.Junctions; namespace Trax.Samples.EnergyHub.Trains.Microgrid.OptimizeMicrogrid; @@ -21,5 +21,9 @@ public class OptimizeMicrogridTrain { protected override async Task> RunInternal( OptimizeMicrogridInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => + Activate(input) + .Chain() + .Chain() + .Resolve(); } diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Steps/CalculateOutputStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Junctions/CalculateOutputJunction.cs similarity index 80% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Steps/CalculateOutputStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Junctions/CalculateOutputJunction.cs index 449d788..bf81555 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Steps/CalculateOutputStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Junctions/CalculateOutputJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.SolarProduction.MonitorSolarProduction.Steps; +namespace Trax.Samples.EnergyHub.Trains.SolarProduction.MonitorSolarProduction.Junctions; -public class CalculateOutputStep(ILogger logger) - : Step +public class CalculateOutputJunction(ILogger logger) + : Junction { public override async Task Run(MonitorSolarProductionInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Steps/ReadSolarSensorsStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Junctions/ReadSolarSensorsJunction.cs similarity index 74% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Steps/ReadSolarSensorsStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Junctions/ReadSolarSensorsJunction.cs index 7c6a75a..8088424 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Steps/ReadSolarSensorsStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/Junctions/ReadSolarSensorsJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.SolarProduction.MonitorSolarProduction.Steps; +namespace Trax.Samples.EnergyHub.Trains.SolarProduction.MonitorSolarProduction.Junctions; -public class ReadSolarSensorsStep(ILogger logger) - : Step +public class ReadSolarSensorsJunction(ILogger logger) + : Junction { public override async Task Run(MonitorSolarProductionInput input) { diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/MonitorSolarProductionTrain.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/MonitorSolarProductionTrain.cs index b3f4a5f..ea87e9f 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/MonitorSolarProductionTrain.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/SolarProduction/MonitorSolarProduction/MonitorSolarProductionTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.EnergyHub.Trains.SolarProduction.MonitorSolarProduction.Steps; +using Trax.Samples.EnergyHub.Trains.SolarProduction.MonitorSolarProduction.Junctions; namespace Trax.Samples.EnergyHub.Trains.SolarProduction.MonitorSolarProduction; @@ -17,5 +17,9 @@ public class MonitorSolarProductionTrain { protected override async Task> RunInternal( MonitorSolarProductionInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => + Activate(input) + .Chain() + .Chain() + .Resolve(); } diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/GenerateSustainabilityReportTrain.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/GenerateSustainabilityReportTrain.cs index 3c3860a..3868918 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/GenerateSustainabilityReportTrain.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/GenerateSustainabilityReportTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.EnergyHub.Trains.Sustainability.GenerateSustainabilityReport.Steps; +using Trax.Samples.EnergyHub.Trains.Sustainability.GenerateSustainabilityReport.Junctions; namespace Trax.Samples.EnergyHub.Trains.Sustainability.GenerateSustainabilityReport; @@ -19,5 +19,5 @@ public class GenerateSustainabilityReportTrain protected override async Task< Either > RunInternal(GenerateSustainabilityReportInput input) => - Activate(input).Chain().Chain().Resolve(); + Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Steps/AggregateMetricsStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Junctions/AggregateMetricsJunction.cs similarity index 74% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Steps/AggregateMetricsStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Junctions/AggregateMetricsJunction.cs index 2979f8e..d708e18 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Steps/AggregateMetricsStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Junctions/AggregateMetricsJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.Sustainability.GenerateSustainabilityReport.Steps; +namespace Trax.Samples.EnergyHub.Trains.Sustainability.GenerateSustainabilityReport.Junctions; -public class AggregateMetricsStep(ILogger logger) - : Step +public class AggregateMetricsJunction(ILogger logger) + : Junction { public override async Task Run( GenerateSustainabilityReportInput input diff --git a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Steps/PublishReportStep.cs b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Junctions/PublishReportJunction.cs similarity index 79% rename from samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Steps/PublishReportStep.cs rename to samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Junctions/PublishReportJunction.cs index 3a11ed1..888283e 100644 --- a/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Steps/PublishReportStep.cs +++ b/samples/DistributedWorkers/Trax.Samples.EnergyHub/Trains/Sustainability/GenerateSustainabilityReport/Junctions/PublishReportJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.EnergyHub.Trains.Sustainability.GenerateSustainabilityReport.Steps; +namespace Trax.Samples.EnergyHub.Trains.Sustainability.GenerateSustainabilityReport.Junctions; -public class PublishReportStep(ILogger logger) - : Step +public class PublishReportJunction(ILogger logger) + : Junction { public override async Task Run( GenerateSustainabilityReportInput input diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield.Api/Program.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield.Api/Program.cs index d358ed7..8884864 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield.Api/Program.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield.Api/Program.cs @@ -54,9 +54,9 @@ using Trax.Effect.Data.Extensions; using Trax.Effect.Data.Postgres.Extensions; using Trax.Effect.Extensions; +using Trax.Effect.JunctionProvider.Progress.Extensions; using Trax.Effect.Provider.Json.Extensions; using Trax.Effect.Provider.Parameter.Extensions; -using Trax.Effect.StepProvider.Progress.Extensions; using Trax.Mediator.Extensions; using Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent; using Trax.Samples.ContentShield.Trains.Notices.SendViolationNotice; diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield.Api/Trax.Samples.ContentShield.Api.csproj b/samples/EphemeralWorkers/Trax.Samples.ContentShield.Api/Trax.Samples.ContentShield.Api.csproj index 08e1d37..36bb52c 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield.Api/Trax.Samples.ContentShield.Api.csproj +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield.Api/Trax.Samples.ContentShield.Api.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/Steps/FetchModerationResultStep.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/Junctions/FetchModerationResultJunction.cs similarity index 79% rename from samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/Steps/FetchModerationResultStep.cs rename to samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/Junctions/FetchModerationResultJunction.cs index f881296..cca18fd 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/Steps/FetchModerationResultStep.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/Junctions/FetchModerationResultJunction.cs @@ -1,14 +1,14 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.ContentShield.Trains.ContentReview.LookupModerationResult.Steps; +namespace Trax.Samples.ContentShield.Trains.ContentReview.LookupModerationResult.Junctions; /// /// Fetches a moderation result from the database. Returns a simulated result /// for demonstration purposes. /// -public class FetchModerationResultStep(ILogger logger) - : Step +public class FetchModerationResultJunction(ILogger logger) + : Junction { public override async Task Run(LookupModerationResultInput input) { diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/LookupModerationResultTrain.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/LookupModerationResultTrain.cs index f5b0d7f..049493f 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/LookupModerationResultTrain.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/LookupModerationResult/LookupModerationResultTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ContentShield.Trains.ContentReview.LookupModerationResult.Steps; +using Trax.Samples.ContentShield.Trains.ContentReview.LookupModerationResult.Junctions; namespace Trax.Samples.ContentShield.Trains.ContentReview.LookupModerationResult; @@ -17,5 +17,5 @@ public class LookupModerationResultTrain { protected override async Task> RunInternal( LookupModerationResultInput input - ) => Activate(input).Chain().Resolve(); + ) => Activate(input).Chain().Resolve(); } diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Steps/ClassifyContentStep.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Junctions/ClassifyContentJunction.cs similarity index 81% rename from samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Steps/ClassifyContentStep.cs rename to samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Junctions/ClassifyContentJunction.cs index b41a458..1e61ee9 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Steps/ClassifyContentStep.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Junctions/ClassifyContentJunction.cs @@ -1,14 +1,14 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent.Steps; +namespace Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent.Junctions; /// /// Classifies content into a category (safe, spam, hate-speech, violence, etc.) /// using a simulated ML model. /// -public class ClassifyContentStep(ILogger logger) - : Step +public class ClassifyContentJunction(ILogger logger) + : Junction { public override async Task Run(ReviewContentInput input) { diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Steps/FlagContentStep.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Junctions/FlagContentJunction.cs similarity index 89% rename from samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Steps/FlagContentStep.cs rename to samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Junctions/FlagContentJunction.cs index 069e412..dbe289a 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Steps/FlagContentStep.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Junctions/FlagContentJunction.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent.Steps; +namespace Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent.Junctions; /// /// Evaluates the threat score and flags content that exceeds the threshold. /// -public class FlagContentStep(ILogger logger) - : Step +public class FlagContentJunction(ILogger logger) + : Junction { public override async Task Run(ReviewContentInput input) { diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Steps/ScoreContentStep.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Junctions/ScoreContentJunction.cs similarity index 81% rename from samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Steps/ScoreContentStep.cs rename to samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Junctions/ScoreContentJunction.cs index 20f81d0..8914fc5 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Steps/ScoreContentStep.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/Junctions/ScoreContentJunction.cs @@ -1,14 +1,14 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent.Steps; +namespace Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent.Junctions; /// /// Assigns a threat score (0.0–1.0) to the content based on classification signals. /// Scores above 0.7 trigger flagging in the next step. /// -public class ScoreContentStep(ILogger logger) - : Step +public class ScoreContentJunction(ILogger logger) + : Junction { public override async Task Run(ReviewContentInput input) { diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/ReviewContentTrain.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/ReviewContentTrain.cs index de9c444..0276334 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/ReviewContentTrain.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/ContentReview/ReviewContent/ReviewContentTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent.Steps; +using Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent.Junctions; namespace Trax.Samples.ContentShield.Trains.ContentReview.ReviewContent; @@ -23,8 +23,8 @@ protected override async Task> RunInterna ReviewContentInput input ) => Activate(input) - .Chain() - .Chain() - .Chain() + .Chain() + .Chain() + .Chain() .Resolve(); } diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Steps/ComposeNoticeStep.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Junctions/ComposeNoticeJunction.cs similarity index 80% rename from samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Steps/ComposeNoticeStep.cs rename to samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Junctions/ComposeNoticeJunction.cs index caaa71f..dcd7240 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Steps/ComposeNoticeStep.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Junctions/ComposeNoticeJunction.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.ContentShield.Trains.Notices.SendViolationNotice.Steps; +namespace Trax.Samples.ContentShield.Trains.Notices.SendViolationNotice.Junctions; /// /// Composes a violation notice from a template based on the violation type. /// -public class ComposeNoticeStep(ILogger logger) - : Step +public class ComposeNoticeJunction(ILogger logger) + : Junction { public override async Task Run(SendViolationNoticeInput input) { diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Steps/DeliverNoticeStep.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Junctions/DeliverNoticeJunction.cs similarity index 81% rename from samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Steps/DeliverNoticeStep.cs rename to samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Junctions/DeliverNoticeJunction.cs index 57574aa..8807c6a 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Steps/DeliverNoticeStep.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/Junctions/DeliverNoticeJunction.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.ContentShield.Trains.Notices.SendViolationNotice.Steps; +namespace Trax.Samples.ContentShield.Trains.Notices.SendViolationNotice.Junctions; /// /// Delivers the composed violation notice via email and push notification. /// -public class DeliverNoticeStep(ILogger logger) - : Step +public class DeliverNoticeJunction(ILogger logger) + : Junction { public override async Task Run(SendViolationNoticeInput input) { diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/SendViolationNoticeTrain.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/SendViolationNoticeTrain.cs index 18fd883..6c58e4e 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/SendViolationNoticeTrain.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Notices/SendViolationNotice/SendViolationNoticeTrain.cs @@ -1,13 +1,13 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ContentShield.Trains.Notices.SendViolationNotice.Steps; +using Trax.Samples.ContentShield.Trains.Notices.SendViolationNotice.Junctions; namespace Trax.Samples.ContentShield.Trains.Notices.SendViolationNotice; /// /// Sends a violation notice to the content owner. Dormant dependent — activated -/// by FlagContentStep when content is flagged. Composes the notice from a template +/// by FlagContentJunction when content is flagged. Composes the notice from a template /// and delivers it via email/push notification. /// /// Dispatched to the ephemeral Runner via HTTP (UseRemoteWorkers). @@ -24,5 +24,5 @@ public class SendViolationNoticeTrain { protected override async Task> RunInternal( SendViolationNoticeInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/GenerateModerationReportTrain.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/GenerateModerationReportTrain.cs index 99da240..4f03c14 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/GenerateModerationReportTrain.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/GenerateModerationReportTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.ContentShield.Trains.Reports.GenerateModerationReport.Steps; +using Trax.Samples.ContentShield.Trains.Reports.GenerateModerationReport.Junctions; namespace Trax.Samples.ContentShield.Trains.Reports.GenerateModerationReport; @@ -18,5 +18,5 @@ public class GenerateModerationReportTrain { protected override async Task> RunInternal( GenerateModerationReportInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Steps/AggregateMetricsStep.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Junctions/AggregateMetricsJunction.cs similarity index 75% rename from samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Steps/AggregateMetricsStep.cs rename to samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Junctions/AggregateMetricsJunction.cs index 97981ff..587e8f7 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Steps/AggregateMetricsStep.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Junctions/AggregateMetricsJunction.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.ContentShield.Trains.Reports.GenerateModerationReport.Steps; +namespace Trax.Samples.ContentShield.Trains.Reports.GenerateModerationReport.Junctions; /// /// Aggregates moderation metrics from the database for the requested period. /// -public class AggregateMetricsStep(ILogger logger) - : Step +public class AggregateMetricsJunction(ILogger logger) + : Junction { public override async Task Run( GenerateModerationReportInput input diff --git a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Steps/FormatReportStep.cs b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Junctions/FormatReportJunction.cs similarity index 77% rename from samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Steps/FormatReportStep.cs rename to samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Junctions/FormatReportJunction.cs index 03fe3f8..37f6385 100644 --- a/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Steps/FormatReportStep.cs +++ b/samples/EphemeralWorkers/Trax.Samples.ContentShield/Trains/Reports/GenerateModerationReport/Junctions/FormatReportJunction.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.ContentShield.Trains.Reports.GenerateModerationReport.Steps; +namespace Trax.Samples.ContentShield.Trains.Reports.GenerateModerationReport.Junctions; /// /// Formats the aggregated metrics into a structured report output. /// -public class FormatReportStep(ILogger logger) - : Step +public class FormatReportJunction(ILogger logger) + : Junction { public override async Task Run( GenerateModerationReportInput input diff --git a/samples/LocalWorkers/Trax.Samples.GameServer.Api/Program.cs b/samples/LocalWorkers/Trax.Samples.GameServer.Api/Program.cs index aba81ce..f6e9a76 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer.Api/Program.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer.Api/Program.cs @@ -42,7 +42,7 @@ // # Subscribe to real-time train lifecycle events (use Banana Cake Pop IDE): // # subscription { onTrainStarted { metadataId trainName trainState timestamp } } // # subscription { onTrainCompleted { metadataId trainName trainState timestamp } } -// # subscription { onTrainFailed { metadataId trainName failureStep failureReason } } +// # subscription { onTrainFailed { metadataId trainName failureJunction failureReason } } // // # Health check (no auth required) // curl http://localhost:5200/trax/health @@ -68,6 +68,12 @@ builder.Services.AddLogging(logging => logging.AddConsole()); +// ── CORS — allow the Trax website (local dev) to connect ────────────── +builder.Services.AddCors(options => +{ + options.AddDefaultPolicy(policy => policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); +}); + // ── Authentication — fake API key for demonstration ────────────────────── builder .Services.AddAuthentication(ApiKeyDefaults.AuthenticationScheme) @@ -108,6 +114,7 @@ // X-Api-Key header on page load. Per-train auth via [TraxAuthorize] still // protects individual operations. For production, use cookie-based auth // or a separate IDE path. +app.UseCors(); app.UseAuthentication(); app.UseAuthorization(); app.UseTraxGraphQL(); diff --git a/samples/LocalWorkers/Trax.Samples.GameServer.Scheduler/Program.cs b/samples/LocalWorkers/Trax.Samples.GameServer.Scheduler/Program.cs index 7a2e112..d56256d 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer.Scheduler/Program.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer.Scheduler/Program.cs @@ -21,10 +21,10 @@ using Trax.Effect.Data.Postgres.Extensions; using Trax.Effect.Enums; using Trax.Effect.Extensions; +using Trax.Effect.JunctionProvider.Progress.Extensions; using Trax.Effect.Models.Manifest; using Trax.Effect.Provider.Json.Extensions; using Trax.Effect.Provider.Parameter.Extensions; -using Trax.Effect.StepProvider.Progress.Extensions; using Trax.Mediator.Extensions; using Trax.Samples.GameServer; using Trax.Samples.GameServer.Trains.Leaderboard.GenerateSeasonReport; @@ -55,7 +55,7 @@ .AddDataContextLogging() .AddJson() .SaveTrainParameters() - .AddStepProgress() + .AddJunctionProgress() ) .AddMediator(typeof(ManifestNames).Assembly) .AddScheduler(scheduler => @@ -111,7 +111,7 @@ // 4. BATCH SCHEDULING + DORMANT DEPENDENTS // ScheduleMany creates one ProcessMatchResult per region. // IncludeMany creates dormant DetectCheatPattern dependents — - // they only fire when CheckForAnomaliesStep activates them. + // they only fire when CheckForAnomaliesJunction activates them. // // process-match-{region} (every 5 min, priority 24, max 5 concurrent) // └── detect-cheat-{region} (Dormant — activated on anomalies) diff --git a/samples/LocalWorkers/Trax.Samples.GameServer.Scheduler/Trax.Samples.GameServer.Scheduler.csproj b/samples/LocalWorkers/Trax.Samples.GameServer.Scheduler/Trax.Samples.GameServer.Scheduler.csproj index 9f576f8..dd5c593 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer.Scheduler/Trax.Samples.GameServer.Scheduler.csproj +++ b/samples/LocalWorkers/Trax.Samples.GameServer.Scheduler/Trax.Samples.GameServer.Scheduler.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/GenerateSeasonReportTrain.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/GenerateSeasonReportTrain.cs index 2812838..02a2c0d 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/GenerateSeasonReportTrain.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/GenerateSeasonReportTrain.cs @@ -1,6 +1,6 @@ using LanguageExt; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.GameServer.Trains.Leaderboard.GenerateSeasonReport.Steps; +using Trax.Samples.GameServer.Trains.Leaderboard.GenerateSeasonReport.Junctions; namespace Trax.Samples.GameServer.Trains.Leaderboard.GenerateSeasonReport; @@ -14,5 +14,5 @@ public class GenerateSeasonReportTrain { protected override async Task> RunInternal( GenerateSeasonReportInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Steps/CompileStatsStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Junctions/CompileStatsJunction.cs similarity index 73% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Steps/CompileStatsStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Junctions/CompileStatsJunction.cs index ded10ab..6b84c1f 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Steps/CompileStatsStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Junctions/CompileStatsJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Leaderboard.GenerateSeasonReport.Steps; +namespace Trax.Samples.GameServer.Trains.Leaderboard.GenerateSeasonReport.Junctions; -public class CompileStatsStep(ILogger logger) - : Step +public class CompileStatsJunction(ILogger logger) + : Junction { public override async Task Run(GenerateSeasonReportInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Steps/FormatReportStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Junctions/FormatReportJunction.cs similarity index 81% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Steps/FormatReportStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Junctions/FormatReportJunction.cs index 91b14d4..b2d3da3 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Steps/FormatReportStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/GenerateSeasonReport/Junctions/FormatReportJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Leaderboard.GenerateSeasonReport.Steps; +namespace Trax.Samples.GameServer.Trains.Leaderboard.GenerateSeasonReport.Junctions; -public class FormatReportStep(ILogger logger) - : Step +public class FormatReportJunction(ILogger logger) + : Junction { public override async Task Run(GenerateSeasonReportInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Steps/AggregateScoresStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Junctions/AggregateScoresJunction.cs similarity index 73% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Steps/AggregateScoresStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Junctions/AggregateScoresJunction.cs index 2d7ed9c..c15c040 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Steps/AggregateScoresStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Junctions/AggregateScoresJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Leaderboard.RecalculateLeaderboard.Steps; +namespace Trax.Samples.GameServer.Trains.Leaderboard.RecalculateLeaderboard.Junctions; -public class AggregateScoresStep(ILogger logger) - : Step +public class AggregateScoresJunction(ILogger logger) + : Junction { public override async Task Run(RecalculateLeaderboardInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Steps/RankPlayersStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Junctions/RankPlayersJunction.cs similarity index 80% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Steps/RankPlayersStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Junctions/RankPlayersJunction.cs index bb00514..610b7ce 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Steps/RankPlayersStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/Junctions/RankPlayersJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Leaderboard.RecalculateLeaderboard.Steps; +namespace Trax.Samples.GameServer.Trains.Leaderboard.RecalculateLeaderboard.Junctions; -public class RankPlayersStep(ILogger logger) - : Step +public class RankPlayersJunction(ILogger logger) + : Junction { public override async Task Run(RecalculateLeaderboardInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/RecalculateLeaderboardTrain.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/RecalculateLeaderboardTrain.cs index 4054f79..a055ce1 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/RecalculateLeaderboardTrain.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Leaderboard/RecalculateLeaderboard/RecalculateLeaderboardTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.GameServer.Trains.Leaderboard.RecalculateLeaderboard.Steps; +using Trax.Samples.GameServer.Trains.Leaderboard.RecalculateLeaderboard.Junctions; namespace Trax.Samples.GameServer.Trains.Leaderboard.RecalculateLeaderboard; @@ -17,5 +17,5 @@ public class RecalculateLeaderboardTrain { protected override async Task> RunInternal( RecalculateLeaderboardInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/CorruptedDataRepairTrain.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/CorruptedDataRepairTrain.cs index 8ca8da9..9c5f4c5 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/CorruptedDataRepairTrain.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/CorruptedDataRepairTrain.cs @@ -1,6 +1,6 @@ using LanguageExt; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.GameServer.Trains.Maintenance.CorruptedDataRepair.Steps; +using Trax.Samples.GameServer.Trains.Maintenance.CorruptedDataRepair.Junctions; namespace Trax.Samples.GameServer.Trains.Maintenance.CorruptedDataRepair; @@ -15,5 +15,5 @@ public class CorruptedDataRepairTrain { protected override async Task> RunInternal( CorruptedDataRepairInput input - ) => Activate(input).Chain().Resolve(); + ) => Activate(input).Chain().Resolve(); } diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/Steps/AttemptRepairStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/Junctions/AttemptRepairJunction.cs similarity index 84% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/Steps/AttemptRepairStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/Junctions/AttemptRepairJunction.cs index 876e1aa..a207658 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/Steps/AttemptRepairStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Maintenance/CorruptedDataRepair/Junctions/AttemptRepairJunction.cs @@ -1,15 +1,15 @@ using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Maintenance.CorruptedDataRepair.Steps; +namespace Trax.Samples.GameServer.Trains.Maintenance.CorruptedDataRepair.Junctions; /// /// Always throws — simulates a corrupted data repair that can't be completed automatically. /// This provides a realistic failure with a meaningful stack trace for the dead letter detail page. /// -public class AttemptRepairStep(ILogger logger) - : Step +public class AttemptRepairJunction(ILogger logger) + : Junction { public override async Task Run(CorruptedDataRepairInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/DetectCheatPatternTrain.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/DetectCheatPatternTrain.cs index 5731584..d9efb2c 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/DetectCheatPatternTrain.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/DetectCheatPatternTrain.cs @@ -1,13 +1,13 @@ using LanguageExt; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.GameServer.Trains.Matches.DetectCheatPattern.Steps; +using Trax.Samples.GameServer.Trains.Matches.DetectCheatPattern.Junctions; namespace Trax.Samples.GameServer.Trains.Matches.DetectCheatPattern; /// /// Dormant dependent train — only fires when anomalies are detected during match processing. /// Declared in the scheduler topology but never auto-fires; activated at runtime -/// via IDormantDependentContext in CheckForAnomaliesStep. +/// via IDormantDependentContext in CheckForAnomaliesJunction. /// public class DetectCheatPatternTrain : ServiceTrain, @@ -15,5 +15,5 @@ public class DetectCheatPatternTrain { protected override async Task> RunInternal( DetectCheatPatternInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Steps/AnalyzePatternStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Junctions/AnalyzePatternJunction.cs similarity index 77% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Steps/AnalyzePatternStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Junctions/AnalyzePatternJunction.cs index 9d5e643..dcc4873 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Steps/AnalyzePatternStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Junctions/AnalyzePatternJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Matches.DetectCheatPattern.Steps; +namespace Trax.Samples.GameServer.Trains.Matches.DetectCheatPattern.Junctions; -public class AnalyzePatternStep(ILogger logger) - : Step +public class AnalyzePatternJunction(ILogger logger) + : Junction { public override async Task Run(DetectCheatPatternInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Steps/FlagPlayerStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Junctions/FlagPlayerJunction.cs similarity index 81% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Steps/FlagPlayerStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Junctions/FlagPlayerJunction.cs index 103dbbe..c4c164d 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Steps/FlagPlayerStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/DetectCheatPattern/Junctions/FlagPlayerJunction.cs @@ -1,10 +1,11 @@ using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Matches.DetectCheatPattern.Steps; +namespace Trax.Samples.GameServer.Trains.Matches.DetectCheatPattern.Junctions; -public class FlagPlayerStep(ILogger logger) : Step +public class FlagPlayerJunction(ILogger logger) + : Junction { public override async Task Run(DetectCheatPatternInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Steps/CheckForAnomaliesStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Junctions/CheckForAnomaliesJunction.cs similarity index 92% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Steps/CheckForAnomaliesStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Junctions/CheckForAnomaliesJunction.cs index c875894..afcd836 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Steps/CheckForAnomaliesStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Junctions/CheckForAnomaliesJunction.cs @@ -1,20 +1,20 @@ using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; using Trax.Samples.GameServer.Trains.Matches.DetectCheatPattern; using Trax.Scheduler.Services.DormantDependentContext; -namespace Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult.Steps; +namespace Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult.Junctions; /// /// Checks for suspicious patterns in match results. /// When anomalies are detected, activates the dormant DetectCheatPattern train /// via IDormantDependentContext — demonstrating runtime-activated dependents. /// -public class CheckForAnomaliesStep( +public class CheckForAnomaliesJunction( IDormantDependentContext dormants, - ILogger logger -) : Step + ILogger logger +) : Junction { public override async Task Run(ProcessMatchResultInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Steps/UpdatePlayerStatsStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Junctions/UpdatePlayerStatsJunction.cs similarity index 76% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Steps/UpdatePlayerStatsStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Junctions/UpdatePlayerStatsJunction.cs index e7a82a6..8f6242c 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Steps/UpdatePlayerStatsStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Junctions/UpdatePlayerStatsJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult.Steps; +namespace Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult.Junctions; -public class UpdatePlayerStatsStep(ILogger logger) - : Step +public class UpdatePlayerStatsJunction(ILogger logger) + : Junction { public override async Task Run(ProcessMatchResultInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Steps/ValidateMatchStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Junctions/ValidateMatchJunction.cs similarity index 79% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Steps/ValidateMatchStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Junctions/ValidateMatchJunction.cs index ea34453..7b840c8 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Steps/ValidateMatchStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/Junctions/ValidateMatchJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult.Steps; +namespace Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult.Junctions; -public class ValidateMatchStep(ILogger logger) - : Step +public class ValidateMatchJunction(ILogger logger) + : Junction { public override async Task Run(ProcessMatchResultInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/ProcessMatchResultTrain.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/ProcessMatchResultTrain.cs index 702b166..8ddf7dc 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/ProcessMatchResultTrain.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Matches/ProcessMatchResult/ProcessMatchResultTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult.Steps; +using Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult.Junctions; namespace Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult; @@ -9,10 +9,10 @@ namespace Trax.Samples.GameServer.Trains.Matches.ProcessMatchResult; /// Multi-step match result processor. Can be queued from the API via GraphQL /// or run on a recurring schedule by the scheduler for batch reprocessing. /// -/// Steps: ValidateMatch → UpdatePlayerStats → CheckForAnomalies +/// Junctions: ValidateMatch → UpdatePlayerStats → CheckForAnomalies /// /// Returns a typed ProcessMatchResultOutput with match processing summary. -/// When anomalies are detected, CheckForAnomaliesStep activates the dormant +/// When anomalies are detected, CheckForAnomaliesJunction activates the dormant /// DetectCheatPattern dependent train via IDormantDependentContext. /// [TraxMutation(Description = "Processes a completed match result")] @@ -25,8 +25,8 @@ protected override async Task> RunIn ProcessMatchResultInput input ) => Activate(input) - .Chain() - .Chain() - .Chain() + .Chain() + .Chain() + .Chain() .Resolve(); } diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/BanPlayerTrain.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/BanPlayerTrain.cs index a1201d8..2e9aef4 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/BanPlayerTrain.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/BanPlayerTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.GameServer.Trains.Players.BanPlayer.Steps; +using Trax.Samples.GameServer.Trains.Players.BanPlayer.Junctions; namespace Trax.Samples.GameServer.Trains.Players.BanPlayer; @@ -14,5 +14,5 @@ namespace Trax.Samples.GameServer.Trains.Players.BanPlayer; public class BanPlayerTrain : ServiceTrain, IBanPlayerTrain { protected override async Task> RunInternal(BanPlayerInput input) => - Activate(input).Chain().Resolve(); + Activate(input).Chain().Resolve(); } diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/Steps/ApplyBanStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/Junctions/ApplyBanJunction.cs similarity index 72% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/Steps/ApplyBanStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/Junctions/ApplyBanJunction.cs index 6c3fb7f..e6d8d9e 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/Steps/ApplyBanStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/BanPlayer/Junctions/ApplyBanJunction.cs @@ -1,10 +1,10 @@ using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Players.BanPlayer.Steps; +namespace Trax.Samples.GameServer.Trains.Players.BanPlayer.Junctions; -public class ApplyBanStep(ILogger logger) : Step +public class ApplyBanJunction(ILogger logger) : Junction { public override async Task Run(BanPlayerInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/CleanupInactivePlayersTrain.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/CleanupInactivePlayersTrain.cs index 41e6a35..6bb0a02 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/CleanupInactivePlayersTrain.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/CleanupInactivePlayersTrain.cs @@ -1,6 +1,6 @@ using LanguageExt; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.GameServer.Trains.Players.CleanupInactivePlayers.Steps; +using Trax.Samples.GameServer.Trains.Players.CleanupInactivePlayers.Junctions; namespace Trax.Samples.GameServer.Trains.Players.CleanupInactivePlayers; @@ -14,5 +14,6 @@ public class CleanupInactivePlayersTrain { protected override async Task> RunInternal( CleanupInactivePlayersInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => + Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Steps/ArchivePlayersStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Junctions/ArchivePlayersJunction.cs similarity index 72% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Steps/ArchivePlayersStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Junctions/ArchivePlayersJunction.cs index bcc7305..e8806c5 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Steps/ArchivePlayersStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Junctions/ArchivePlayersJunction.cs @@ -1,11 +1,11 @@ using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Players.CleanupInactivePlayers.Steps; +namespace Trax.Samples.GameServer.Trains.Players.CleanupInactivePlayers.Junctions; -public class ArchivePlayersStep(ILogger logger) - : Step +public class ArchivePlayersJunction(ILogger logger) + : Junction { public override async Task Run(CleanupInactivePlayersInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Steps/IdentifyInactiveStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Junctions/IdentifyInactiveJunction.cs similarity index 71% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Steps/IdentifyInactiveStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Junctions/IdentifyInactiveJunction.cs index c34e22f..4dcc06a 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Steps/IdentifyInactiveStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/CleanupInactivePlayers/Junctions/IdentifyInactiveJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Players.CleanupInactivePlayers.Steps; +namespace Trax.Samples.GameServer.Trains.Players.CleanupInactivePlayers.Junctions; -public class IdentifyInactiveStep(ILogger logger) - : Step +public class IdentifyInactiveJunction(ILogger logger) + : Junction { public override async Task Run(CleanupInactivePlayersInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/Steps/FetchPlayerStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/Junctions/FetchPlayerJunction.cs similarity index 78% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/Steps/FetchPlayerStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/Junctions/FetchPlayerJunction.cs index 94287a3..bdc3eb1 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/Steps/FetchPlayerStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/Junctions/FetchPlayerJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Players.LookupPlayer.Steps; +namespace Trax.Samples.GameServer.Trains.Players.LookupPlayer.Junctions; -public class FetchPlayerStep(ILogger logger) - : Step +public class FetchPlayerJunction(ILogger logger) + : Junction { public override async Task Run(LookupPlayerInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/LookupPlayerTrain.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/LookupPlayerTrain.cs index e6aac63..a1ab79d 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/LookupPlayerTrain.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Players/LookupPlayer/LookupPlayerTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.GameServer.Trains.Players.LookupPlayer.Steps; +using Trax.Samples.GameServer.Trains.Players.LookupPlayer.Junctions; namespace Trax.Samples.GameServer.Trains.Players.LookupPlayer; @@ -15,5 +15,5 @@ public class LookupPlayerTrain : ServiceTrain, { protected override async Task> RunInternal( LookupPlayerInput input - ) => Activate(input).Chain().Resolve(); + ) => Activate(input).Chain().Resolve(); } diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/DistributeDailyRewardsTrain.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/DistributeDailyRewardsTrain.cs index 81bea44..abd2968 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/DistributeDailyRewardsTrain.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/DistributeDailyRewardsTrain.cs @@ -1,6 +1,6 @@ using LanguageExt; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.GameServer.Trains.Rewards.DistributeDailyRewards.Steps; +using Trax.Samples.GameServer.Trains.Rewards.DistributeDailyRewards.Junctions; namespace Trax.Samples.GameServer.Trains.Rewards.DistributeDailyRewards; @@ -14,5 +14,5 @@ public class DistributeDailyRewardsTrain { protected override async Task> RunInternal( DistributeDailyRewardsInput input - ) => Activate(input).Chain().Chain().Resolve(); + ) => Activate(input).Chain().Chain().Resolve(); } diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Steps/CalculateRewardsStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Junctions/CalculateRewardsJunction.cs similarity index 73% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Steps/CalculateRewardsStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Junctions/CalculateRewardsJunction.cs index a633c5d..35e587d 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Steps/CalculateRewardsStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Junctions/CalculateRewardsJunction.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Rewards.DistributeDailyRewards.Steps; +namespace Trax.Samples.GameServer.Trains.Rewards.DistributeDailyRewards.Junctions; -public class CalculateRewardsStep(ILogger logger) - : Step +public class CalculateRewardsJunction(ILogger logger) + : Junction { public override async Task Run(DistributeDailyRewardsInput input) { diff --git a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Steps/CreditPlayersStep.cs b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Junctions/CreditPlayersJunction.cs similarity index 76% rename from samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Steps/CreditPlayersStep.cs rename to samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Junctions/CreditPlayersJunction.cs index 63cc571..d10b0f0 100644 --- a/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Steps/CreditPlayersStep.cs +++ b/samples/LocalWorkers/Trax.Samples.GameServer/Trains/Rewards/DistributeDailyRewards/Junctions/CreditPlayersJunction.cs @@ -1,11 +1,11 @@ using LanguageExt; using Microsoft.Extensions.Logging; -using Trax.Core.Step; +using Trax.Core.Junction; -namespace Trax.Samples.GameServer.Trains.Rewards.DistributeDailyRewards.Steps; +namespace Trax.Samples.GameServer.Trains.Rewards.DistributeDailyRewards.Junctions; -public class CreditPlayersStep(ILogger logger) - : Step +public class CreditPlayersJunction(ILogger logger) + : Junction { public override async Task Run(DistributeDailyRewardsInput input) { diff --git a/templates/content/Trax.Samples.Api/Trains/HelloWorld/HelloWorldTrain.cs b/templates/content/Trax.Samples.Api/Trains/HelloWorld/HelloWorldTrain.cs index cdf8c1e..cab5314 100644 --- a/templates/content/Trax.Samples.Api/Trains/HelloWorld/HelloWorldTrain.cs +++ b/templates/content/Trax.Samples.Api/Trains/HelloWorld/HelloWorldTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.Api.Trains.HelloWorld.Steps; +using Trax.Samples.Api.Trains.HelloWorld.Junctions; namespace Trax.Samples.Api.Trains.HelloWorld; @@ -13,5 +13,5 @@ namespace Trax.Samples.Api.Trains.HelloWorld; public class HelloWorldTrain : ServiceTrain, IHelloWorldTrain { protected override async Task> RunInternal(HelloWorldInput input) => - Activate(input).Chain().Resolve(); + Activate(input).Chain().Resolve(); } diff --git a/templates/content/Trax.Samples.Api/Trains/HelloWorld/Steps/LogGreetingStep.cs b/templates/content/Trax.Samples.Api/Trains/HelloWorld/Junctions/LogGreetingJunction.cs similarity index 75% rename from templates/content/Trax.Samples.Api/Trains/HelloWorld/Steps/LogGreetingStep.cs rename to templates/content/Trax.Samples.Api/Trains/HelloWorld/Junctions/LogGreetingJunction.cs index 07d49bd..7d5b382 100644 --- a/templates/content/Trax.Samples.Api/Trains/HelloWorld/Steps/LogGreetingStep.cs +++ b/templates/content/Trax.Samples.Api/Trains/HelloWorld/Junctions/LogGreetingJunction.cs @@ -1,9 +1,10 @@ using LanguageExt; using Trax.Core.Models; -namespace Trax.Samples.Api.Trains.HelloWorld.Steps; +namespace Trax.Samples.Api.Trains.HelloWorld.Junctions; -public class LogGreetingStep(ILogger logger) : Step +public class LogGreetingJunction(ILogger logger) + : Junction { public override async Task Run(HelloWorldInput input) { diff --git a/templates/content/Trax.Samples.Api/Trains/Lookup/Steps/FetchDataStep.cs b/templates/content/Trax.Samples.Api/Trains/Lookup/Junctions/FetchDataJunction.cs similarity index 72% rename from templates/content/Trax.Samples.Api/Trains/Lookup/Steps/FetchDataStep.cs rename to templates/content/Trax.Samples.Api/Trains/Lookup/Junctions/FetchDataJunction.cs index e1c64f1..b144220 100644 --- a/templates/content/Trax.Samples.Api/Trains/Lookup/Steps/FetchDataStep.cs +++ b/templates/content/Trax.Samples.Api/Trains/Lookup/Junctions/FetchDataJunction.cs @@ -1,8 +1,9 @@ using Trax.Core.Models; -namespace Trax.Samples.Api.Trains.Lookup.Steps; +namespace Trax.Samples.Api.Trains.Lookup.Junctions; -public class FetchDataStep(ILogger logger) : Step +public class FetchDataJunction(ILogger logger) + : Junction { public override async Task Run(LookupInput input) { diff --git a/templates/content/Trax.Samples.Api/Trains/Lookup/LookupTrain.cs b/templates/content/Trax.Samples.Api/Trains/Lookup/LookupTrain.cs index 07137d8..53cbe32 100644 --- a/templates/content/Trax.Samples.Api/Trains/Lookup/LookupTrain.cs +++ b/templates/content/Trax.Samples.Api/Trains/Lookup/LookupTrain.cs @@ -1,7 +1,7 @@ using LanguageExt; using Trax.Effect.Attributes; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.Api.Trains.Lookup.Steps; +using Trax.Samples.Api.Trains.Lookup.Junctions; namespace Trax.Samples.Api.Trains.Lookup; @@ -13,5 +13,5 @@ namespace Trax.Samples.Api.Trains.Lookup; public class LookupTrain : ServiceTrain, ILookupTrain { protected override async Task> RunInternal(LookupInput input) => - Activate(input).Chain().Resolve(); + Activate(input).Chain().Resolve(); } diff --git a/templates/content/Trax.Samples.Scheduler/Program.cs b/templates/content/Trax.Samples.Scheduler/Program.cs index a8349f1..cbd4c70 100644 --- a/templates/content/Trax.Samples.Scheduler/Program.cs +++ b/templates/content/Trax.Samples.Scheduler/Program.cs @@ -15,9 +15,9 @@ using Trax.Dashboard.Extensions; using Trax.Effect.Data.Postgres.Extensions; using Trax.Effect.Extensions; +using Trax.Effect.JunctionProvider.Progress.Extensions; using Trax.Effect.Provider.Json.Extensions; using Trax.Effect.Provider.Parameter.Extensions; -using Trax.Effect.StepProvider.Progress.Extensions; using Trax.Mediator.Extensions; using Trax.Samples.Scheduler.Trains.HelloWorld; using Trax.Scheduler.Extensions; @@ -37,7 +37,11 @@ // ── Register Trax Effect + Scheduler ──────────────────────────────────── builder.Services.AddTrax(trax => trax.AddEffects(effects => - effects.UsePostgres(connectionString).AddJson().SaveTrainParameters().AddStepProgress() + effects + .UsePostgres(connectionString) + .AddJson() + .SaveTrainParameters() + .AddJunctionProgress() ) .AddMediator(typeof(Program).Assembly) .AddScheduler(scheduler => diff --git a/templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/HelloWorldTrain.cs b/templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/HelloWorldTrain.cs index 01a4517..dc15e16 100644 --- a/templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/HelloWorldTrain.cs +++ b/templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/HelloWorldTrain.cs @@ -1,6 +1,6 @@ using LanguageExt; using Trax.Effect.Services.ServiceTrain; -using Trax.Samples.Scheduler.Trains.HelloWorld.Steps; +using Trax.Samples.Scheduler.Trains.HelloWorld.Junctions; namespace Trax.Samples.Scheduler.Trains.HelloWorld; @@ -10,5 +10,5 @@ namespace Trax.Samples.Scheduler.Trains.HelloWorld; public class HelloWorldTrain : ServiceTrain, IHelloWorldTrain { protected override async Task> RunInternal(HelloWorldInput input) => - Activate(input).Chain().Resolve(); + Activate(input).Chain().Resolve(); } diff --git a/templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/Steps/LogGreetingStep.cs b/templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/Junctions/LogGreetingJunction.cs similarity index 75% rename from templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/Steps/LogGreetingStep.cs rename to templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/Junctions/LogGreetingJunction.cs index 468c53f..4a05f2e 100644 --- a/templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/Steps/LogGreetingStep.cs +++ b/templates/content/Trax.Samples.Scheduler/Trains/HelloWorld/Junctions/LogGreetingJunction.cs @@ -1,9 +1,10 @@ using LanguageExt; using Trax.Core.Models; -namespace Trax.Samples.Scheduler.Trains.HelloWorld.Steps; +namespace Trax.Samples.Scheduler.Trains.HelloWorld.Junctions; -public class LogGreetingStep(ILogger logger) : Step +public class LogGreetingJunction(ILogger logger) + : Junction { public override async Task Run(HelloWorldInput input) { diff --git a/templates/content/Trax.Samples.Scheduler/Trax.Samples.Scheduler.csproj b/templates/content/Trax.Samples.Scheduler/Trax.Samples.Scheduler.csproj index 2b85c15..bb46387 100644 --- a/templates/content/Trax.Samples.Scheduler/Trax.Samples.Scheduler.csproj +++ b/templates/content/Trax.Samples.Scheduler/Trax.Samples.Scheduler.csproj @@ -12,7 +12,7 @@ - + diff --git a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/CreateChatRoomTests.cs b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/CreateChatRoomTests.cs index b2de146..80daf8c 100644 --- a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/CreateChatRoomTests.cs +++ b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/CreateChatRoomTests.cs @@ -3,19 +3,19 @@ using Trax.Samples.ChatService.Data.Entities; using Trax.Samples.ChatService.Tests.Fixtures; using Trax.Samples.ChatService.Trains.CreateChatRoom; -using Trax.Samples.ChatService.Trains.CreateChatRoom.Steps; +using Trax.Samples.ChatService.Trains.CreateChatRoom.Junctions; namespace Trax.Samples.ChatService.Tests.IntegrationTests; [TestFixture] public class CreateChatRoomTests { - #region ValidateInputStep + #region ValidateInputJunction [Test] public void ValidateInput_EmptyName_Throws() { - var step = new ValidateInputStep(NullLogger.Instance); + var junction = new ValidateInputJunction(NullLogger.Instance); var input = new CreateChatRoomInput { Name = "", @@ -23,7 +23,7 @@ public void ValidateInput_EmptyName_Throws() DisplayName = "Alice", }; - var act = () => step.Run(input); + var act = () => junction.Run(input); act.Should().ThrowAsync().WithMessage("*name*"); } @@ -31,7 +31,7 @@ public void ValidateInput_EmptyName_Throws() [Test] public void ValidateInput_EmptyUserId_Throws() { - var step = new ValidateInputStep(NullLogger.Instance); + var junction = new ValidateInputJunction(NullLogger.Instance); var input = new CreateChatRoomInput { Name = "General", @@ -39,7 +39,7 @@ public void ValidateInput_EmptyUserId_Throws() DisplayName = "Alice", }; - var act = () => step.Run(input); + var act = () => junction.Run(input); act.Should().ThrowAsync().WithMessage("*User ID*"); } @@ -47,7 +47,7 @@ public void ValidateInput_EmptyUserId_Throws() [Test] public async Task ValidateInput_ValidInput_ReturnsInput() { - var step = new ValidateInputStep(NullLogger.Instance); + var junction = new ValidateInputJunction(NullLogger.Instance); var input = new CreateChatRoomInput { Name = "General", @@ -55,20 +55,20 @@ public async Task ValidateInput_ValidInput_ReturnsInput() DisplayName = "Alice", }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Should().Be(input); } #endregion - #region PersistRoomStep + #region PersistRoomJunction [Test] public async Task PersistRoom_CreatesRoomAndParticipant() { using var db = ChatDbContextFixture.Create(); - var step = new PersistRoomStep(db, NullLogger.Instance); + var junction = new PersistRoomJunction(db, NullLogger.Instance); var input = new CreateChatRoomInput { Name = "General", @@ -76,7 +76,7 @@ public async Task PersistRoom_CreatesRoomAndParticipant() DisplayName = "Alice", }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Name.Should().Be("General"); result.ChatRoomId.Should().NotBeEmpty(); diff --git a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/GetChatHistoryTests.cs b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/GetChatHistoryTests.cs index c3172f5..f4928cd 100644 --- a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/GetChatHistoryTests.cs +++ b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/GetChatHistoryTests.cs @@ -4,14 +4,14 @@ using Trax.Samples.ChatService.Data.Entities; using Trax.Samples.ChatService.Tests.Fixtures; using Trax.Samples.ChatService.Trains.GetChatHistory; -using Trax.Samples.ChatService.Trains.GetChatHistory.Steps; +using Trax.Samples.ChatService.Trains.GetChatHistory.Junctions; namespace Trax.Samples.ChatService.Tests.IntegrationTests; [TestFixture] public class GetChatHistoryTests { - #region FetchMessagesStep + #region FetchMessagesJunction [Test] public async Task FetchMessages_ReturnsMessagesInChronologicalOrder() @@ -19,10 +19,10 @@ public async Task FetchMessages_ReturnsMessagesInChronologicalOrder() using var db = ChatDbContextFixture.Create(); var roomId = await SeedRoomWithMessages(db, 5); - var step = new FetchMessagesStep(db, NullLogger.Instance); + var junction = new FetchMessagesJunction(db, NullLogger.Instance); var input = new GetChatHistoryInput { ChatRoomId = roomId, Take = 50 }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Messages.Should().HaveCount(5); result.Messages.Should().BeInAscendingOrder(m => m.SentAt); @@ -34,10 +34,10 @@ public async Task FetchMessages_RespectsPageSize() using var db = ChatDbContextFixture.Create(); var roomId = await SeedRoomWithMessages(db, 10); - var step = new FetchMessagesStep(db, NullLogger.Instance); + var junction = new FetchMessagesJunction(db, NullLogger.Instance); var input = new GetChatHistoryInput { ChatRoomId = roomId, Take = 3 }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Messages.Should().HaveCount(3); } @@ -49,7 +49,7 @@ public async Task FetchMessages_BeforeFilter_ReturnsOlderMessages() var baseTime = new DateTime(2026, 1, 1, 12, 0, 0, DateTimeKind.Utc); var roomId = await SeedRoomWithTimedMessages(db, baseTime, 5); - var step = new FetchMessagesStep(db, NullLogger.Instance); + var junction = new FetchMessagesJunction(db, NullLogger.Instance); var input = new GetChatHistoryInput { ChatRoomId = roomId, @@ -57,7 +57,7 @@ public async Task FetchMessages_BeforeFilter_ReturnsOlderMessages() Before = baseTime.AddMinutes(3), }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Messages.Should().HaveCount(3); result @@ -79,10 +79,10 @@ public async Task FetchMessages_EmptyRoom_ReturnsEmpty() db.ChatRooms.Add(room); await db.SaveChangesAsync(); - var step = new FetchMessagesStep(db, NullLogger.Instance); + var junction = new FetchMessagesJunction(db, NullLogger.Instance); var input = new GetChatHistoryInput { ChatRoomId = room.Id, Take = 50 }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Messages.Should().BeEmpty(); } @@ -94,10 +94,10 @@ public async Task FetchMessages_DifferentRoom_DoesNotCrossContaminate() var roomId1 = await SeedRoomWithMessages(db, 3); var roomId2 = await SeedRoomWithMessages(db, 5); - var step = new FetchMessagesStep(db, NullLogger.Instance); + var junction = new FetchMessagesJunction(db, NullLogger.Instance); var input = new GetChatHistoryInput { ChatRoomId = roomId1, Take = 50 }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Messages.Should().HaveCount(3); } diff --git a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/GetChatRoomsTests.cs b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/GetChatRoomsTests.cs index 247ea4b..23452d3 100644 --- a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/GetChatRoomsTests.cs +++ b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/GetChatRoomsTests.cs @@ -4,14 +4,14 @@ using Trax.Samples.ChatService.Data.Entities; using Trax.Samples.ChatService.Tests.Fixtures; using Trax.Samples.ChatService.Trains.GetChatRooms; -using Trax.Samples.ChatService.Trains.GetChatRooms.Steps; +using Trax.Samples.ChatService.Trains.GetChatRooms.Junctions; namespace Trax.Samples.ChatService.Tests.IntegrationTests; [TestFixture] public class GetChatRoomsTests { - #region FetchRoomsStep + #region FetchRoomsJunction [Test] public async Task FetchRooms_ReturnsOnlyRoomsUserIsIn() @@ -20,10 +20,10 @@ public async Task FetchRooms_ReturnsOnlyRoomsUserIsIn() var aliceRoomId = await SeedRoomWithParticipant(db, "alice", "Room A"); await SeedRoomWithParticipant(db, "bob", "Room B"); - var step = new FetchRoomsStep(db, NullLogger.Instance); + var junction = new FetchRoomsJunction(db, NullLogger.Instance); var input = new GetChatRoomsInput { UserId = "alice" }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Rooms.Should().ContainSingle(); result.Rooms[0].Id.Should().Be(aliceRoomId); @@ -47,10 +47,10 @@ public async Task FetchRooms_IncludesParticipantCount() ); await db.SaveChangesAsync(); - var step = new FetchRoomsStep(db, NullLogger.Instance); + var junction = new FetchRoomsJunction(db, NullLogger.Instance); var input = new GetChatRoomsInput { UserId = "alice" }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Rooms.Should().ContainSingle(); result.Rooms[0].ParticipantCount.Should().Be(2); @@ -61,10 +61,10 @@ public async Task FetchRooms_NoRooms_ReturnsEmpty() { using var db = ChatDbContextFixture.Create(); - var step = new FetchRoomsStep(db, NullLogger.Instance); + var junction = new FetchRoomsJunction(db, NullLogger.Instance); var input = new GetChatRoomsInput { UserId = "nobody" }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Rooms.Should().BeEmpty(); } diff --git a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/JoinChatRoomTests.cs b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/JoinChatRoomTests.cs index 9375327..65731cf 100644 --- a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/JoinChatRoomTests.cs +++ b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/JoinChatRoomTests.cs @@ -4,20 +4,20 @@ using Trax.Samples.ChatService.Data.Entities; using Trax.Samples.ChatService.Tests.Fixtures; using Trax.Samples.ChatService.Trains.JoinChatRoom; -using Trax.Samples.ChatService.Trains.JoinChatRoom.Steps; +using Trax.Samples.ChatService.Trains.JoinChatRoom.Junctions; namespace Trax.Samples.ChatService.Tests.IntegrationTests; [TestFixture] public class JoinChatRoomTests { - #region ValidateJoinStep + #region ValidateJoinJunction [Test] public void ValidateJoin_RoomDoesNotExist_Throws() { using var db = ChatDbContextFixture.Create(); - var step = new ValidateJoinStep(db, NullLogger.Instance); + var junction = new ValidateJoinJunction(db, NullLogger.Instance); var input = new JoinChatRoomInput { ChatRoomId = Guid.NewGuid(), @@ -25,7 +25,7 @@ public void ValidateJoin_RoomDoesNotExist_Throws() DisplayName = "Alice", }; - var act = () => step.Run(input); + var act = () => junction.Run(input); act.Should().ThrowAsync().WithMessage("*does not exist*"); } @@ -48,7 +48,7 @@ public async Task ValidateJoin_AlreadyParticipant_Throws() ); await db.SaveChangesAsync(); - var step = new ValidateJoinStep(db, NullLogger.Instance); + var junction = new ValidateJoinJunction(db, NullLogger.Instance); var input = new JoinChatRoomInput { ChatRoomId = roomId, @@ -56,7 +56,7 @@ public async Task ValidateJoin_AlreadyParticipant_Throws() DisplayName = "Alice", }; - var act = () => step.Run(input); + var act = () => junction.Run(input); await act.Should() .ThrowAsync() @@ -69,7 +69,7 @@ public async Task ValidateJoin_ValidNewParticipant_ReturnsInput() using var db = ChatDbContextFixture.Create(); var roomId = await SeedRoom(db, "alice"); - var step = new ValidateJoinStep(db, NullLogger.Instance); + var junction = new ValidateJoinJunction(db, NullLogger.Instance); var input = new JoinChatRoomInput { ChatRoomId = roomId, @@ -77,14 +77,14 @@ public async Task ValidateJoin_ValidNewParticipant_ReturnsInput() DisplayName = "Bob", }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Should().Be(input); } #endregion - #region AddParticipantStep + #region AddParticipantJunction [Test] public async Task AddParticipant_PersistsParticipant() @@ -92,7 +92,7 @@ public async Task AddParticipant_PersistsParticipant() using var db = ChatDbContextFixture.Create(); var roomId = await SeedRoom(db, "alice"); - var step = new AddParticipantStep(db, NullLogger.Instance); + var junction = new AddParticipantJunction(db, NullLogger.Instance); var input = new JoinChatRoomInput { ChatRoomId = roomId, @@ -100,7 +100,7 @@ public async Task AddParticipant_PersistsParticipant() DisplayName = "Bob", }; - var result = await step.Run(input); + var result = await junction.Run(input); result.ChatRoomId.Should().Be(roomId); result.UserId.Should().Be("bob"); diff --git a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/MarkChatAsReadTests.cs b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/MarkChatAsReadTests.cs index 90f8b78..594165e 100644 --- a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/MarkChatAsReadTests.cs +++ b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/MarkChatAsReadTests.cs @@ -4,14 +4,14 @@ using Trax.Samples.ChatService.Data.Entities; using Trax.Samples.ChatService.Tests.Fixtures; using Trax.Samples.ChatService.Trains.MarkChatAsRead; -using Trax.Samples.ChatService.Trains.MarkChatAsRead.Steps; +using Trax.Samples.ChatService.Trains.MarkChatAsRead.Junctions; namespace Trax.Samples.ChatService.Tests.IntegrationTests; [TestFixture] public class MarkChatAsReadTests { - #region UpdateLastReadStep + #region UpdateLastReadJunction [Test] public async Task UpdateLastRead_SetsLastReadAt() @@ -19,10 +19,10 @@ public async Task UpdateLastRead_SetsLastReadAt() using var db = ChatDbContextFixture.Create(); var roomId = await SeedRoomWithParticipant(db, "alice"); - var step = new UpdateLastReadStep(db, NullLogger.Instance); + var junction = new UpdateLastReadJunction(db, NullLogger.Instance); var input = new MarkChatAsReadInput { ChatRoomId = roomId, UserId = "alice" }; - await step.Run(input); + await junction.Run(input); var participant = db.ChatParticipants.First(p => p.ChatRoomId == roomId && p.UserId == "alice" @@ -35,10 +35,10 @@ public async Task UpdateLastRead_SetsLastReadAt() public void UpdateLastRead_UserNotParticipant_Throws() { using var db = ChatDbContextFixture.Create(); - var step = new UpdateLastReadStep(db, NullLogger.Instance); + var junction = new UpdateLastReadJunction(db, NullLogger.Instance); var input = new MarkChatAsReadInput { ChatRoomId = Guid.NewGuid(), UserId = "nobody" }; - var act = () => step.Run(input); + var act = () => junction.Run(input); act.Should().ThrowAsync().WithMessage("*not a participant*"); } diff --git a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/SendMessageTests.cs b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/SendMessageTests.cs index b91b564..878776c 100644 --- a/tests/Trax.Samples.ChatService.Tests/IntegrationTests/SendMessageTests.cs +++ b/tests/Trax.Samples.ChatService.Tests/IntegrationTests/SendMessageTests.cs @@ -3,14 +3,14 @@ using Trax.Samples.ChatService.Data.Entities; using Trax.Samples.ChatService.Tests.Fixtures; using Trax.Samples.ChatService.Trains.SendMessage; -using Trax.Samples.ChatService.Trains.SendMessage.Steps; +using Trax.Samples.ChatService.Trains.SendMessage.Junctions; namespace Trax.Samples.ChatService.Tests.IntegrationTests; [TestFixture] public class SendMessageTests { - #region ValidateSenderStep + #region ValidateSenderJunction [Test] public async Task ValidateSender_UserIsParticipant_ReturnsInput() @@ -18,7 +18,7 @@ public async Task ValidateSender_UserIsParticipant_ReturnsInput() using var db = ChatDbContextFixture.Create(); var roomId = await SeedRoomWithParticipant(db, "alice", "Alice"); - var step = new ValidateSenderStep(db, NullLogger.Instance); + var junction = new ValidateSenderJunction(db, NullLogger.Instance); var input = new SendMessageInput { ChatRoomId = roomId, @@ -26,7 +26,7 @@ public async Task ValidateSender_UserIsParticipant_ReturnsInput() Content = "Hello!", }; - var result = await step.Run(input); + var result = await junction.Run(input); result.Should().Be(input); } @@ -35,7 +35,7 @@ public async Task ValidateSender_UserIsParticipant_ReturnsInput() public void ValidateSender_UserNotParticipant_Throws() { using var db = ChatDbContextFixture.Create(); - var step = new ValidateSenderStep(db, NullLogger.Instance); + var junction = new ValidateSenderJunction(db, NullLogger.Instance); var input = new SendMessageInput { ChatRoomId = Guid.NewGuid(), @@ -43,7 +43,7 @@ public void ValidateSender_UserNotParticipant_Throws() Content = "Hello!", }; - var act = () => step.Run(input); + var act = () => junction.Run(input); act.Should().ThrowAsync().WithMessage("*not a participant*"); } @@ -52,7 +52,7 @@ public void ValidateSender_UserNotParticipant_Throws() public void ValidateSender_EmptyContent_Throws() { using var db = ChatDbContextFixture.Create(); - var step = new ValidateSenderStep(db, NullLogger.Instance); + var junction = new ValidateSenderJunction(db, NullLogger.Instance); var input = new SendMessageInput { ChatRoomId = Guid.NewGuid(), @@ -60,14 +60,14 @@ public void ValidateSender_EmptyContent_Throws() Content = "", }; - var act = () => step.Run(input); + var act = () => junction.Run(input); act.Should().ThrowAsync().WithMessage("*empty*"); } #endregion - #region PersistMessageStep + #region PersistMessageJunction [Test] public async Task PersistMessage_SavesMessageAndUpdatesLastRead() @@ -75,7 +75,7 @@ public async Task PersistMessage_SavesMessageAndUpdatesLastRead() using var db = ChatDbContextFixture.Create(); var roomId = await SeedRoomWithParticipant(db, "alice", "Alice"); - var step = new PersistMessageStep(db, NullLogger.Instance); + var junction = new PersistMessageJunction(db, NullLogger.Instance); var input = new SendMessageInput { ChatRoomId = roomId, @@ -83,7 +83,7 @@ public async Task PersistMessage_SavesMessageAndUpdatesLastRead() Content = "Test message", }; - var result = await step.Run(input); + var result = await junction.Run(input); result.MessageId.Should().NotBeEmpty(); result.ChatRoomId.Should().Be(roomId);