Commit Graph

6 Commits

Author SHA1 Message Date
Anatolii Grynchuk ee4c988a0d refactor: replace local dal abstractions with hrynco-ef packages
Remove duplicate IEntity, Entity, ITransaction, IUnitOfWork, EfRepository,
EfUnitOfWork, EfTransactionAdapter — now consumed from HrynCo.DAL.Abstract
and HrynCo.DAL.EF packages (1.0.1).

Ref: IT-0
2026-05-05 20:39:06 +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
Anatolii Grynchuk 088eab0428 refactor: rename NotificationUnitOfWork to UnitOfWork
Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-01 23:34:45 +03:00
Anatolii Grynchuk ce1ef1fea6 refactor: rename NotificationEfRepository to EfRepository
Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-01 23:34:11 +03:00
Anatolii Grynchuk c2a4f3b9d7 fix: inherit EF entities from Entity base class
- TemplateEntity, ProviderEntity, ProviderUsageEntity now inherit Entity (from DAL.Abstract)
- Removes duplicated Id, Created, Updated properties from each entity

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-01 23:27:38 +03:00
Anatolii Grynchuk 4f573da374 feat: add repository layer with IUnitOfWork and fixed EF base
- ITransaction, IUnitOfWork in DAL.Abstract
- EfTransactionAdapter, EfUnitOfWork<TDbContext>, NotificationUnitOfWork in DAL.EF
- NotificationEfRepository<TEntity>: async-only base, fixed Exists (AnyAsync),
  fixed batch Add (AddRangeAsync), single SaveChangesAsync per operation
- TemplateRepository, ProviderRepository, ProviderUsageRepository
- ProviderUsageRepository.IncrementAsync uses atomic PostgreSQL upsert
- ProviderRepository deserializes settings polymorphically via ProviderType discriminator

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-01 23:18:41 +03:00