3 Commits

Author SHA1 Message Date
Anatolii Grynchuk 92be035f51 feat: replace manual Stopwatch with IProfiler in TransactionBehavior
- Add HrynCo.Common to Services project
- TransactionBehavior now uses IProfiler.MeasureExecutionAsync:
  MeasureExecutionAsync -> ExecuteInTransactionAsync -> next() -> SaveChangesAsync
- Profiler logs Start/End with duration + memory delta via Serilog PerformanceLog context
- Register IProfiler as singleton in ServiceCollectionExtensions (uses Log.Logger)

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 01:15:10 +03:00
Anatolii Grynchuk 101bb908bd feat: add Serilog with Console and Seq sinks, log TransactionBehavior
- Add Serilog.AspNetCore + Sinks.Console + Sinks.Seq to Api
- Add Serilog.Extensions.Hosting + Sinks.Console + Sinks.Seq to Worker
- Add Microsoft.Extensions.Logging.Abstractions to Services
- TransactionBehavior logs handler name, elapsed time, and errors

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 00:21:25 +03:00
Anatolii Grynchuk 6dcc911fc2 refactor: rename domain types and introduce TransactionBehavior pattern
- Rename Template -> EmailTemplate, Provider -> EmailChannel,
  ProviderSettings -> EmailChannelSettings, ProviderType -> EmailChannelType,
  ProviderUsage -> EmailChannelUsage throughout all layers
- Add Undefined = 0 to EmailChannelType enum for safe default handling
- Remove SaveChangesAsync from EfRepository methods — repositories now only stage changes
- Add SaveChangesAsync to IUnitOfWork and EfUnitOfWork
- Add TransactionBehavior MediatR pipeline: wraps every handler in a transaction,
  saves and commits on success, rolls back on exception
- Add MediatR package reference to Services project

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 00:16:47 +03:00