Skip to main content

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

ClassificationConcepts
Canonical extracted aggregatesRecruitment Candidate, Offer, Onboarding; Employee in Employee Service
Canonical monolith recordsCandidateOnboarding compatibility record; ExitRequest
Supporting entitiesstage history, offer letter/revision/approval, Recruitment audit/timeline, ExitRequestAuditLog, OnboardingTask
External referencesEmployee 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.cs
  • microservices/src/recruitment-service/Domain/Recruitment/Offer.cs
  • microservices/src/recruitment-service/Domain/Recruitment/Onboarding.cs
  • microservices/src/recruitment-service/Domain/Repositories.cs
  • microservices/src/employee-service/Domain/Employees/Employee.cs
  • Models/CandidateOnboarding.cs
  • Models/ExitRequest.cs
  • Models/ExitRequestAuditLog.cs
  • Models/OnboardingTask.cs

See Also

Keywords

  • Layer dependencies
  • Onboarding aggregate
  • Domain boundary

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-20
  • Review cycle: Quarterly