How mrkaran007/hrms-enterprise works
HRMS Enterprise is an ASP.NET Core API for employee and department administration, transfers, and JWT-based access control. Its principal workflow is an HTTP request through a controller to a business service, then repositories and a unit of work for persistence; employee transfers additionally record history within a transaction. Authentication and resource authorization form a distinct access-control branch. The README documents capabilities beyond the sampled code; those branches are included, while edges not visible in excerpts or explicit documentation are omitted.
Main entry points: HRMSDbContext.cs EF data context · EmployeeService.cs Employee rules · AuthService.cs Authentication rules · EmployeeController.cs Employee endpoints
Components 20
HTTP API
- Employee endpoints
HRMS.API/Controllers/EmployeeController.cs - Department endpoints
HRMS.API/Controllers/DepartmentController.cs - Authentication endpoints
HRMS.API/Controllers/AuthController.cs - Error handling
HRMS.API/Middleware/ExceptionHandlingMiddleware.cs
HR Operations
- Employee rules
HRMS.API/Services/Employee/EmployeeService.cs - Department rules
HRMS.API/Services/Department/DepartmentService.cs - Transfer history
HRMS.API/Repositories/TransferHistory/TransferHistoryRepository.cs - Employee DTOs
HRMS.API/DTOs/Employee - Department DTOs
HRMS.API/DTOs/Department
Identity & Access
- Authentication rules
HRMS.API/Services/Auth/AuthService.cs - JWT issuance
HRMS.API/Services/Auth/JwtService.cs - Employee access policy
HRMS.API/Authorization/EmployeeAccessHandler.cs
Persistence
- Employee repository
HRMS.API/Repositories/Employee/EmployeeRepository.cs - Department repository
HRMS.API/Repositories/Department/DepartmentRepository.cs - User repository
HRMS.API/Repositories/User/UserRepository.cs - Unit of work
HRMS.API/Repositories/UnitOfWork.cs - EF data context
HRMS.API/Data/HRMSDbContext.cs - HR entities
HRMS.API/Models/Employee.cs
Other components
- API caller
- SQL Server
Connections 28
- API caller → Employee endpoints: sends requests
README.md - API caller → Department endpoints: sends requests
README.md - API caller → Authentication endpoints: sends requests
README.md - Employee endpoints → Employee rules: calls
HRMS.API/Controllers/EmployeeController.cs - Department endpoints → Department rules: calls
HRMS.API/Controllers/DepartmentController.cs - Authentication endpoints → Authentication rules: calls
HRMS.API/Controllers/AuthController.cs - Employee rules → Employee repository: queries and updates
HRMS.API/Services/Employee/EmployeeService.cs - Employee rules → Department repository: checks departments
HRMS.API/Services/Employee/EmployeeService.cs - Employee rules → Transfer history: records and reads
HRMS.API/Services/Employee/EmployeeService.cs - Employee rules → Unit of work: saves transaction
HRMS.API/Services/Employee/EmployeeService.cs - Department rules → Department repository: manages departments
HRMS.API/Services/Department/DepartmentService.cs - Department rules → Employee repository: checks assignments
HRMS.API/Services/Department/DepartmentService.cs - Department rules → Unit of work: saves changes
HRMS.API/Services/Department/DepartmentService.cs - Authentication rules → User repository: checks and stores users
HRMS.API/Services/Auth/AuthService.cs - Authentication rules → Employee repository: validates employee link
HRMS.API/Services/Auth/AuthService.cs - Authentication rules → Unit of work: saves account
HRMS.API/Services/Auth/AuthService.cs - Authentication rules → JWT issuance: requests token
HRMS.API/Services/Auth/AuthService.cs - Employee repository → EF data context: queries data
HRMS.API/Repositories/Employee/EmployeeRepository.cs - Department repository → EF data context: queries data
HRMS.API/Repositories/Department/DepartmentRepository.cs - User repository → EF data context: queries data
HRMS.API/Repositories/User/UserRepository.cs - Transfer history → EF data context: queries data
HRMS.API/Repositories/TransferHistory/TransferHistoryRepository.cs - Unit of work → EF data context: saves changes
HRMS.API/Repositories/UnitOfWork.cs - EF data context → SQL Server: persists entities
README.md - EF data context → HR entities: maps relationships
HRMS.API/Data/HRMSDbContext.cs - Employee endpoints → Employee access policy: uses resource policy
README.md - Error handling → API caller: returns JSON errors
README.md - Employee endpoints → Employee DTOs: accepts and returns
HRMS.API/Controllers/EmployeeController.cs - Department endpoints → Department DTOs: accepts requests
HRMS.API/Controllers/DepartmentController.cs