Layer Dependencies and Domain Model
Summary
Recruitment follows explicit API, Application, Domain, Infrastructure, and Messaging boundaries. The Onboarding aggregate owns extracted lifecycle transitions while external readiness remains outside that aggregate.
Audience
Backend developers, QA engineers, and solution architects.
Layer dependencies
The extracted service uses folder-level dependency separation rather than separate layer projects. Domain declares repositories and raises events. Application orchestrates aggregates through ports. Infrastructure implements persistence and remote gateways. API maps requests to application services. The monolith exit implementation does not follow this command/repository layering; its controller uses the shared monolith DbContext and services directly.
Domain model
Canonical, supporting, and external concepts
| Classification | Concepts |
|---|---|
| Canonical extracted aggregates | Recruitment Candidate, Offer, Onboarding; Employee in Employee Service |
| Canonical monolith records | CandidateOnboarding compatibility record; ExitRequest |
| Supporting entities | stage history, offer letter/revision/approval, Recruitment audit/timeline, ExitRequestAuditLog, OnboardingTask |
| External references | Employee identifiers, user/labor identifiers, department, designation, manager, document reference, Workflow instance |
There is no canonical Offboarding aggregate in the extracted services. ExitRequest is an anemic monolith model whose transition rules live in the controller. OnboardingTask is independent of both Recruitment Onboarding and CandidateOnboarding.
Requires confirmation
- Whether checklist and clearance concepts should become domain-owned aggregates.
- The authoritative lifecycle relationship between extracted onboarding and monolith exit records.
- Which external readiness signals should be represented inside Recruitment.
Source References
microservices/src/recruitment-service/Domain/Recruitment/Candidate.csmicroservices/src/recruitment-service/Domain/Recruitment/Offer.csmicroservices/src/recruitment-service/Domain/Recruitment/Onboarding.csmicroservices/src/recruitment-service/Domain/Repositories.csmicroservices/src/employee-service/Domain/Employees/Employee.csModels/CandidateOnboarding.csModels/ExitRequest.csModels/ExitRequestAuditLog.csModels/OnboardingTask.cs
Related Articles
See Also
Keywords
- Layer dependencies
- Onboarding aggregate
- Domain boundary
Revision Information
- Status: Draft
- Last reviewed: 2026-07-20
- Review cycle: Quarterly