Employee Infrastructure Layer
Summary
Infrastructure implements Employee application/domain ports with EF Core, PostgreSQL, request tenant context, audit persistence, search, and outbox storage. It contains no confirmed external HTTP client and registers no Employee-specific hosted worker.
Audience
- Backend developers and QA engineers
- DevOps engineers and solution architects
Reference Content
Confirmed adapters
EmployeeDbContext: persistence boundary, tenant filters, model mapping, save interception, and domain-event-to-contract translation.- Repository implementations for Employee, Department, Designation, and Timeline.
UnitOfWork: commits the EF Core context.AuditWriter: creates tenant/actor-attributed audit records in the current unit of work.HttpTenantContext: reads current tenant, platform scope, and actor context from the request environment.EmployeeOutboxMessageStore: provides shared-kernel outbox processor access to pending records and processing state.PostgresEmployeeSearchProvider: composes tenant-filtered, no-tracking search queries with filters, sorting, projection, and paging.- Design-time context factory and development seeding support.
Persistence and transactions
Command handlers mutate tracked aggregates, append audit information, and commit through one context. The context translates queued domain events into outbox records before saving, allowing business changes, audit, and outbox creation to participate in the same persistence operation.
External integrations and storage
No typed external HTTP client is registered in Employee Service. Cross-service integration is based on authenticated gateway traffic and shared messaging contracts. Employee document information is reference metadata; no external binary-storage adapter is implemented here.
Background workers
Messaging services and an outbox processor are registered through the shared kernel, but Employee Service does not register a hosted relay or background worker that invokes the processor. How pending Employee outbox records are drained Requires confirmation.
Source References
microservices/src/employee-service/Infrastructure/EmployeeDbContext.csmicroservices/src/employee-service/Infrastructure/Persistence.csmicroservices/src/employee-service/Infrastructure/PostgresEmployeeSearchProvider.csmicroservices/src/employee-service/Infrastructure/DevelopmentSeeder.csmicroservices/src/employee-service/Program.cs
Related Articles
See Also
Keywords
- Infrastructure adapters
- Tenant-aware persistence
- Outbox foundation
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly