Skip to content

Ft/592415 - Update patterns and improve new funcionalities#1

Open
lreao wants to merge 11 commits intomainfrom
FT/592415
Open

Ft/592415 - Update patterns and improve new funcionalities#1
lreao wants to merge 11 commits intomainfrom
FT/592415

Conversation

@lreao
Copy link
Copy Markdown

@lreao lreao commented Mar 27, 2026

No description provided.

leonardo.albuquerque added 11 commits March 26, 2026 17:39
Add AWS/SQS/Redis option classes with Key constants, IJobHelper and
IBatchJobService contracts, IMessagePublisher and IIntegrationEvent
abstractions, BatchKey/BatchInfo/BatchProgressInfo/BatchMonitorResult
models, and ProcessAssetDataJobDto. FluentResults added as dependency.
Implement BaseJob with Start -> RunAsync -> Finally lifecycle using
FluentResults for business errors. Add thread-safe JobHelper with
ConcurrentDictionary for progress bars, batch progress tracking via
Redis, and async WhenAllEx. Register IJobHelper (Singleton) and
IBatchJobService (Scoped) in DI. Add Hangfire Pro, Console, and
Throttling package references.
…d commands

Add ProcessAssetJob (individual asset processing with batch progress
reporting in finally block) and ProcessAssetBatchJob (creates monitored
batch via IBatchJobService). Add AssetCreatedEvent, consumer that
bridges MassTransit to Hangfire, validator, CreateAssetCommand and
handler that publishes via IMessagePublisher.
…ss bar

Add BatchMonitorJob as a standalone polling job that monitors any batch
via Redis progress hash, displaying a Hangfire Console progress bar.
Add BatchJobService with StartMonitoredBatch (Action<object, string>
signature for batchKeyValue access in lambda), AttachToBatch, CancelBatch,
and GetBatchMonitorResult. Add BatchJobServiceExtensions for type-safe
batch job enqueueing with automatic job counting.
Add MessagePublisher implementing IMessagePublisher, MassTransit
configuration with Amazon SQS transport, and DI registration.
MassTransit pinned to 8.5.8 (v9+ requires license — TODO in csproj).
Add RedisExtension for StackExchange.Redis configuration using
RedisOption. Update Persistence and AntiCorruption csproj dependencies.
…guration

Rename src/Api to src/App. Add HangfireExtension with Hangfire Pro Redis
storage, .UseBatches(), .UseThrottling(), .UseConsole(), and dashboard
at /dashboard route. Add HangfireQueuesExtension for queue configuration.
Add Hangfire.Pro 3.0.4, Hangfire.Pro.Redis 3.3.1, and Hangfire.Throttling
1.4.3 package references.
Add ScalarExtension with Kepler theme, dark mode enabled via
.EnableDarkMode(), and documentation route at /documentation.
Swagger extension was removed in the previous commit.
Add VersioningExtension with UrlSegmentApiVersionReader, .AddMvc() in
chain, and DefaultApiVersion 2.0. Add JobsController with v1 (deprecated)
and v2 (current) endpoints, including GET /api/v2/jobs/batch/{batchId}/monitor
for querying real-time batch progress.
…solution file

Configure Program.cs with full pipeline (Hangfire, Scalar, Versioning,
MassTransit, Redis). Add Redis.Database=1 and AWS/SQS options to
appsettings.json. Update launchSettings.json with port 5015 and
launchUrl=dashboard. Update solution file for Api->App rename.
…atchMonitorJob

All tests use [Theory] with MemberData and TheoryData<T> static
properties — no objects created inside test methods. 48 test executions
covering job lifecycle, batch creation, progress monitoring, storage
errors, cancellation, and metadata key patterns. Uses xUnit 2.9.3,
NSubstitute 5.3.0, and FluentAssertions 8.3.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant