6.7 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository shape
HRM.UI is the API/host project of a much larger multi-project HR/payroll system ("CEL.HRM.5"). It is not a standalone git repo — the .git directory lives one level up at e:\HRMGIT\, alongside sibling projects this project depends on via ProjectReference:
HRM.BO— business object / model classes (namespaces likeHRM.BO,HRM.BO.Basic,HRM.BO.Fund,Payroll.BO)HRM.DA— data access + business service implementations (namespaces likeHRM.DA.Service,HRM.DA.Service.Tax,HRM.DA.Service.Fund.*)HRM.Report— reporting projectEase.Core— shared low-level framework (Ease.Core.DataAccess, referenced asEase.NetCoreNuGet package)
Other siblings not referenced by this project directly: Erecruitment.UI, HRM.AttendanceAutoProcess, HRM.MailNotificationProcess, IntegrationSuite, DatabaseComparison.
Because git operates from the parent directory, git status/git log/git diff run from within HRM.UI will reflect changes across all sibling projects, not just this one — be careful when staging/committing to only include files actually relevant to the task.
There is also a nested, separately-buildable project at Controllers\MobileAPI\HRMobileAPI.csproj (legacy .NET Framework-style mobile API), included in HRM.UI.sln.
Two apps in one repo
- Backend: ASP.NET Core 10 Web API (
HRM.UI.csproj,Startup.cs,Program.cs) — controllers only, business logic lives inHRM.DA/HRM.BO. - Frontend: Angular 19 SPA under
ClientApp/(project namebabylon), hosted viaMicrosoft.AspNetCore.SpaServices.AngularCliin dev (spa.UseAngularCliServer(npmScript: "start")).
Common commands
Backend (run from repo root, e:\HRMGIT\HRM.UI):
dotnet build HRM.UI.csproj
dotnet run --project HRM.UI.csproj
The API listens on https://localhost:44374 in dev (see Properties/launchSettings.json); this exact URL is also hardcoded as the Angular dev fallback base URL (ClientApp/src/app/app.api.service.ts).
Frontend (run from ClientApp/):
npm start # ng serve, http://localhost:4200
npm run build # ng build -> dist/babylon
npm test # ng test (Karma/Jasmine)
npm run lint # ng lint
To run a single spec file, use Angular CLI's karma pass-through, e.g. ng test --include='**/some.component.spec.ts'.
Normal full-stack dev loop is dotnet run from HRM.UI (it proxies to the Angular CLI dev server automatically in Development); running ng serve standalone in ClientApp/ is useful for faster Angular-only iteration but API calls need the backend running separately on 44374.
Backend architecture
- Controllers (
Controllers/) are organized by domain area (Employee,Payroll,Leave,Attendance,Recruitment,Tax,Training,FundAdmin,Ess,Ess-Fund,GrievanceManagement,LearningManagement,Workflow,Claim,Final-Settlement,LongServiceAward,SearchTools,DataIntegration,Mobile/MobileAPI,Report, etc.). Controllers are thin: they take manyIXxxServiceinterfaces via constructor injection and delegate to them — almost no business logic lives here. - All service interfaces/implementations (e.g.
IEmployeeService,ILeaveService,ITaxParameterService, ~250+ of them) are registered in one place:Configurations/DI/ServiceCollectionExtensions.cs→ConfigureBusinessServices(services), called fromStartup.ConfigureServices. When adding a new service, register it there. Implementations live in the externalHRM.DAproject, not in this repo. - AutoMapper was removed in the .NET 10 upgrade (vulnerable, unused) — map by hand.
- Auth: JWT bearer (
AddJwtBearer), key fromAppSettings.SecretviaEase.Core.Utility.JwtSigningKey.FromSecret(config sectionAppSettings), most controllers carry[Authorize]. - API versioning is configured (
Asp.Versioning,AddApiVersioning().AddMvc(), URL-segment based) though most controllers use a single implicit v1. - CORS policy
"CORSPolicy"currently restricts tohttp://localhost:4200. - RDLC report templates live under
RDLC/*.rdlcand are rendered viaReportViewerCore.NETCore; report logic is inHRM.Report. - AI/OpenAI integration:
Microsoft.SemanticKernel+OpenAIpackages,OpenAIServicesingleton configured inStartup.csfromOpenAI:ApiKey/OpenAI:Modelconfig, controller inControllers/OpenAIController, Angular modulehrmopen-ai. - Config comes from
appsettings.json/appsettings.Development.json(AppSettings,EmailSettings,EmployeeApiInfo,AdminPendingJob,MobileAppSettings,FundInfo,OpenAIsections).
Frontend architecture (ClientApp/src/app)
- Feature areas are separate lazy-loaded Angular modules, registered in
app.routes.tsunderAuthGuard-protected paths (e.g.payroll,leave,attendance,recruitment,core-hr,fund-admin,ess,ess-fund,ess-payroll,talent-management,final-settlement,training-new,claim,grievance-management,survey,organization-management,payment-approval,LMS,hrmopen-ai, etc.). Each has its own<name>.module.tsunderClientApp/src/app/<name>/. - Shared cross-cutting code lives in
_guards/,_models/,_services/,_picker/,picker/,dynamic-picker/,custom-components/,form-builder/,helper/,SharedIconModule/. app.api.service.ts(ApiService) is the single HTTP wrapper every feature module uses (httpGet,httpPost,httpPostFile,httpDownloadFile, etc.). It derives the API base URL from the page's<base href>in production, or falls back tohttps://localhost:44374/apiin local dev. Auth token is a staticApiService.AuthenticationToken, sent as a Bearer header.- UI kit is a mix of PrimeNG (
primeng,@primeng/themes,primeflex,primeicons) and Kendo UI Angular (@progress/kendo-angular-*, licensed viakendo-ui-license.txt/telerik-license.txt) plus Bootstrap 5. Charts use bothng-apexcharts/apexchartsandchart.js. Expect both PrimeNG and Kendo components/patterns depending on which module you're in — check the surrounding module for the convention already in use rather than assuming one library. - SSO/Azure AD is wired via
@azure/msal-angular+@azure/msal-browser(SSO.Config.ts).
Notes
data/allowancedata.json,data/data.jsonand files underDocuments/,EMPPHOTO/,LOGO/,RDLC/*.pngare runtime data/assets, not source to edit casually.ClientApp/distandbin/objare build output — never hand-edit.- Large parts of
Startup.cs(Swagger, AutoMapper config block, SPA static files) are commented out; check current behavior against the live code, not the comments, before assuming a feature (e.g. Swagger) is active.