How verf1x/directoty-service works
DirectoryService is an HTTP CRUD service for shared organizational reference data: departments, positions and locations. Internal systems submit requests to the API; controllers dispatch commands and queries, application handlers validate and coordinate domain changes, and repositories persist or retrieve records in PostgreSQL. Department workflows include hierarchical parent changes and department–location associations, while location and department queries support searching, sorting and pagination. The tree and README establish the broader CRUD capabilities; sampled source confirms controller dispatch, transactional hierarchy updates and PostgreSQL access. Unsampled handler and position wiring is represented only at the module level.
Main entry points: Departments Department workflows · Locations Location workflows · DirectoryServiceDbContext.cs EF Core context · LocationsController.cs Locations API
Components 18
HTTP API
- Departments API
backend/DirectoryService/src/DirectoryService.Presentation/Controllers/DepartmentsController.cs - Locations API
backend/DirectoryService/src/DirectoryService.Presentation/Controllers/LocationsController.cs - Positions API
backend/DirectoryService/src/DirectoryService.Presentation/Controllers/PositionsController.cs
Application workflows
- Department workflows
backend/DirectoryService/src/DirectoryService.Application/Departments - Location workflows
backend/DirectoryService/src/DirectoryService.Application/Locations - Position workflows
backend/DirectoryService/src/DirectoryService.Application/Positions - Request validation
backend/DirectoryService/src/DirectoryService.Application/Validation - Transaction manager
backend/DirectoryService/src/DirectoryService.Application/Database/ITransactionManager.cs
Directory domain
- Departments
backend/DirectoryService/src/DirectoryService.Domain/Departments/Department.cs - Locations
backend/DirectoryService/src/DirectoryService.Domain/Locations/Location.cs - Positions
backend/DirectoryService/src/DirectoryService.Domain/Positions/Position.cs - Department associations
backend/DirectoryService/src/DirectoryService.Domain/DepartmentLocations/DepartmentLocation.cs
PostgreSQL persistence
- Departments repository
backend/DirectoryService/src/DirectoryService.Infrastructure.Postgres/Departments/DepartmentsRepository.cs - Locations repository
backend/DirectoryService/src/DirectoryService.Infrastructure.Postgres/Locations/LocationsRepository.cs - Positions repository
backend/DirectoryService/src/DirectoryService.Infrastructure.Postgres/Positions/PositionsRepository.cs - EF Core context
backend/DirectoryService/src/DirectoryService.Infrastructure.Postgres/DirectoryServiceDbContext.cs
Other components
- Internal services
- PostgreSQL
Connections 21
- Internal services → Departments API: sends requests
- Internal services → Locations API: sends requests
- Internal services → Positions API: sends requests
- Departments API → Department workflows: dispatches commands
- Locations API → Location workflows: dispatches queries
- Locations API → Location workflows: dispatches commands
- Positions API → Position workflows: dispatches commands
- Department workflows → Request validation: validates requests
- Location workflows → Request validation: validates requests
- Position workflows → Request validation: validates requests
- Department workflows → Departments repository: uses repository
- Location workflows → Locations repository: uses repository
- Position workflows → Positions repository: uses repository
- Department workflows → Transaction manager: manages transactions
- Departments repository → EF Core context: queries and saves
- Locations repository → EF Core context: saves records
- Positions repository → EF Core context: persists records
- Departments repository → PostgreSQL: queries hierarchy
- Locations repository → PostgreSQL: checks records
- EF Core context → PostgreSQL: reads and writes
- Departments → Department associations: links locations