This commit is contained in:
Mohaimen Hasan 2026-11-25 17:07:30 +06:00
parent 4e0b827859
commit 58ccd13a12
16 changed files with 217 additions and 11 deletions

View File

@ -61,7 +61,9 @@ but several specifics are stale — prefer *this* file wherever the two disagree
at `e:\HRMGIT\` alongside a sibling `IntegrationSuite` project (this checkout is a single at `e:\HRMGIT\` alongside a sibling `IntegrationSuite` project (this checkout is a single
self-contained repo and no `IntegrationSuite` exists), lists `npm run lint` as a working command (it self-contained repo and no `IntegrationSuite` exists), lists `npm run lint` as a working command (it
is broken — see below), describes `Ease.Core` as "referenced as the `Ease.NetCore` NuGet package" is broken — see below), describes `Ease.Core` as "referenced as the `Ease.NetCore` NuGet package"
(the live one is the project in this repo), and counts "~250+" services (there are ~450 service classes, ~310 of them DI-registered). (the live one is the project in this repo), and counts "~250+" services (there are ~450 service classes, ~310 of them DI-registered), describes the UI
kit as a PrimeNG/Kendo/Bootstrap mix (PrimeNG and Bootstrap are gone), and gives an absolute
`https://localhost:44374/api` dev base URL (it is the relative `/api`, see *Frontend*).
## Build & run ## Build & run
@ -106,7 +108,7 @@ npm test # ng test (Karma, entry src/test.ts)
Both SPAs `ng serve` on 4200, so only one of the two can run at a time. Both SPAs `ng serve` on 4200, so only one of the two can run at a time.
- `npm run lint` is **broken**: `angular.json` still points at the `@angular-devkit/build-angular:tslint` - `npm run lint` is **broken**: `angular.json` still points at the `@angular-devkit/build-angular:tslint`
builder (with a `tslint.json`), which no longer exists in Angular 19. The `@angular-eslint/*` and `eslint` 9 devDependencies are builder (with a `tslint.json`), which is not installed. `@angular-eslint/builder` and `eslint` 9 are
installed, but there is no ESLint config file and no `@angular-eslint/builder:lint` target yet, so installed, but there is no ESLint config file and no `@angular-eslint/builder:lint` target yet, so
wiring ESLint up means adding both. wiring ESLint up means adding both.
- `npm test` works, but coverage is nominal — 18 `.spec.ts` files across the whole app. Single spec: - `npm test` works, but coverage is nominal — 18 `.spec.ts` files across the whole app. Single spec:
@ -117,8 +119,9 @@ Both SPAs `ng serve` on 4200, so only one of the two can run at a time.
[`deploy.ps1`](deploy.ps1) does the whole thing: bumps `HRM.UI/ClientApp/src/version.json` [`deploy.ps1`](deploy.ps1) does the whole thing: bumps `HRM.UI/ClientApp/src/version.json`
(`YYYYMMDD-NN`, counter auto-increments per day), runs `ng build --configuration production (`YYYYMMDD-NN`, counter auto-increments per day), runs `ng build --configuration production
--base-href <baseHref>`, `dotnet publish` for `win-x64`, copies `dist/babylon` into the publish --base-href <baseHref>`, `dotnet publish` for `win-x64` into `<outputFolder>_<version>`, copies
folder's `wwwroot`, and writes an Angular `web.config` (SPA rewrites + no-cache for `dist/babylon` into its `wwwroot` and the whole `HRM.UI/RDLC` folder into its `RDLC` (publish alone copies
only the RDLC files the csproj lists), and writes an Angular `web.config` (SPA rewrites + no-cache for
`index.html`/`version.json`). Edit `$baseHref`/`$outputFolder` at the top per client/environment `index.html`/`version.json`). Edit `$baseHref`/`$outputFolder` at the top per client/environment
before running. `VersionCheckService` (`ClientApp/src/app/version-check.service.ts`) polls before running. `VersionCheckService` (`ClientApp/src/app/version-check.service.ts`) polls
`version.json` every 5 minutes and prompts a reload when the server version changes — keep the `version.json` every 5 minutes and prompts a reload when the server version changes — keep the
@ -243,6 +246,29 @@ Every Excel interface in the app is served by the one
[DataUploadController](HRM.UI/Controllers/CommonInterface/DataUploadController.cs) (`api/dataUpload`) [DataUploadController](HRM.UI/Controllers/CommonInterface/DataUploadController.cs) (`api/dataUpload`)
— do not add a separate controller for a new uploader. — do not add a separate controller for a new uploader.
The older regular uploads (employee basic, life cycle, allowance, fund data, …; screen
`/common-interface/data-upload/:id`) all post to `regularExcelInterface`, and
`RegularDataUploadService.UploadData` switches on `EnumRegularDataUpload`. Their expected columns are declared
in `DataUploadColumnDefinationService` (file `BasicDataUploadProcessService.cs`), so a new column needs both:
declare it there and read it in the matching `Import…` method.
### Large lists: virtual paging
A list or report that can return many rows uses `<app-virtual-grid>` + `VirtualPagingDA.GetPage`: SQL Server
pages, searches, sorts and counts, and Export to Excel is streamed from the server. Follow the 4 steps in
[HRM.DA/DA/VirtualPaging/README.md](HRM.DA/DA/VirtualPaging/README.md) (worked examples: Discontinue Employee
Details, Employee Detail Information). Needs SQL Server 2016+.
### PF percentage is per employee
`SalaryCalculator.Process` calls `PFNEW()`, which takes the PF % from `Employee.PFPercentage`, not from
`SystemInformation` as the old `PF()` does (`PF()` is now used only by `ProcessLTA`). A Live PF member with no
percentage gets a PF of 0. The value is set through a life-cycle event (`EmpLifeCycle.PFPercentage`, copied to
`Employee` by `HREmployeeDA.UpdatePFPercentage`) or the employee / life-cycle uploads; the Logic key
`confirmation` / `autopfmembership` decides whether a confirmation also makes the employee a PF member.
**No `_DB_Changes.sql` adds these two columns**: without `EmpLifeCycle.PFPercentage` every life-cycle
insert/update fails, and without `Employee.PFPercentage` setting the percentage fails.
### Employee Bulk Upload ### Employee Bulk Upload
The whole information of many employees in one spreadsheet — one row per employee, carrying that The whole information of many employees in one spreadsheet — one row per employee, carrying that
@ -438,16 +464,16 @@ calendar's Users dropdown once came back silently empty for exactly this reason.
column: use the pattern in `CalendarItemDA.UserEmailExpression`, which checks `COL_LENGTH` once per process column: use the pattern in `CalendarItemDA.UserEmailExpression`, which checks `COL_LENGTH` once per process
and builds `COALESCE(EmailAddress, Email)` from whichever columns exist. Server-side SQL errors that the UI and builds `COALESCE(EmailAddress, Email)` from whichever columns exist. Server-side SQL errors that the UI
swallows land in `HRM.UI/Log/Error.log` (`ExceptionLog`), the first place to look. swallows land in `HRM.UI/Log/Error.log` (`ExceptionLog`), the first place to look.
Two places don't follow that pattern yet. `UserDA.Insert` writes only `Email`, so creating a user fails on a Two places don't follow that pattern yet. `UserDA.Insert` and `Update` write only `Email`, so saving a user fails on a
database that lacks it (the pending `UsersEmailColumn_DB_Changes.sql` adds it; its header wrongly says Insert database that lacks it (the pending `UsersEmailColumn_DB_Changes.sql` adds it; its header wrongly says Insert
writes both columns). `UserService.MapObject` writes both columns). `UserService.MapObject`
reads only `Email` (the `EmailAddress` line is commented out), so the user list's `email` is blank wherever reads only `Email` (the `EmailAddress` line is commented out), so the user list's `email` is blank wherever
addresses live in `EmailAddress`. addresses live in `EmailAddress`.
Gotcha in user approval: `UserDA.Approve` always sets `Status = Approved` (5), whatever the request was. So Gotcha in user approval: `UserDA.Approve` writes whatever `UserStatus` the client posts; the server works
"approving" an `Inactive_Not_Yet_Approve` (9) or `Inactive` (8) user **re-activates** them, and a deactivation nothing out. `users-list.component.ts` sends `Inactive` when approving a pending deactivation (status 9) and
can never actually be approved. The user list labels that action "Re-activate" for this reason; the fix `Approved` otherwise, and the "maker cannot approve their own change" check for users is only in that
belongs in the server. component too. (Its comment saying the server always sets Approved is out of date.)
### Authentication pages: maker-checker and audit log ### Authentication pages: maker-checker and audit log
@ -458,6 +484,24 @@ change is saved with an `EnumAuthStatus` (`HRM.BO/HRBasic/Enums.cs`) pending sta
`Approve` / `Reject`, `RoleService` for roles and permissions). Follow that state set for any new `Approve` / `Reject`, `RoleService` for roles and permissions). Follow that state set for any new
Authentication page rather than inventing a status column. Authentication page rather than inventing a status column.
**Super User IDs can be negative.** Test "has a user" / "was edited" as `!= 0`, never `> 0` (a role's maker is
`ModifiedBy` when it is not 0, else `CreatedBy`), in C# and in Angular alike. `AuthController.ValidateResetToken`
still checks `data.UserID <= 0`, so a reset link for a negative-ID Super User always reads as invalid.
### Login, OTP and forgot password
- **MFA** is on when `LDAPSettings.isMFA` is true (`MFATimer` = minutes); the code length and mail/SMS channel
are Logic keys under `mfa`. `login` then returns an `mfaSessionId`, and `verify-mfa` issues the token. The
challenge is held in **in-process memory**, so it does not survive a restart or a second server.
- `login`, `verify-mfa` and `resend-otp` are rate-limited per IP (`LoginPolicy` / `MfaPolicy` /
`ResendOtpPolicy` in `Startup`). The forgot-password endpoints are not.
- The OTP flow writes a trace to `C:\Log\OTP log <date>.txt`; `C:\Log` must exist on the server.
- **Forgot password** mails a link to `#/reset-password?token=…`. Nothing is stored: the token
(`HRM.UI/Helpers/PasswordResetTokenHelper.cs`) is AES-GCM encrypted with a key derived from
`AppSettings.Secret`, expires after `ForgotPasswordSettings.LinkExpiryMinutes`, and carries a fingerprint of
the current password, which makes it single-use. The link's base address is `EmailSettings.WebAddress`
(`http://localhost:4200/` in Development), so set that per deployment.
The **System Audit Log** page (`SystemAuditHistoryService`, `HRM.DA/DA/Users/SystemAuditHistoryDA.cs`) writes The **System Audit Log** page (`SystemAuditHistoryService`, `HRM.DA/DA/Users/SystemAuditHistoryDA.cs`) writes
nothing itself: it reads `Z_ROLE`, `Z_ROLEPERMISSION`, `Z_USERS`, `Z_USERROLE`, `Z_USERACCESSTYPE`, which nothing itself: it reads `Z_ROLE`, `Z_ROLEPERMISSION`, `Z_USERS`, `Z_USERROLE`, `Z_USERACCESSTYPE`, which
**database triggers** (`trRole`, `trRolePermission`, `trUsers`, `truserrole`, `trUserAccessType`) fill. Only **database triggers** (`trRole`, `trRolePermission`, `trUsers`, `truserrole`, `trUserAccessType`) fill. Only
@ -500,7 +544,9 @@ When behavior differs between clients, look for or add a Logic key rather than b
**This checkout is not that repo.** It is `HRM-10` (`origin` = `103.197.204.162:3025/CelHRTeam/HRM-10`), **This checkout is not that repo.** It is `HRM-10` (`origin` = `103.197.204.162:3025/CelHRTeam/HRM-10`),
a fresh import whose history starts at one squashed commit (`838b8d4` "first commit"). Since then it a fresh import whose history starts at one squashed commit (`838b8d4` "first commit"). Since then it
uses ordinary short-lived branches: `main` is the integration branch (PR target), with per-developer uses ordinary short-lived branches: `main` is the integration branch (PR target), with per-developer
branches (`dev_<name>`, `dev_<name>_<feature>`, `shamim`) merged back into it. branches (`dev_<name>`, `dev_<name>_<feature>`, `shamim`) merged back into it. Client branches have started here too:
`Brac_Master` (with `Brac_Master_<name>` developer branches) is ahead of `main`, so check which line a change
belongs to before choosing a PR target.
None of the older history exists here: every commit hash quoted elsewhere in this file (`c8588ce67`, None of the older history exists here: every commit hash quoted elsewhere in this file (`c8588ce67`,
`91369150c`, `ac179c03e`, `73f466cd0`, `bfd085e0e`) is from the original `CelHRTeam/cel.hrm` repo, and `91369150c`, `ac179c03e`, `73f466cd0`, `bfd085e0e`) is from the original `CelHRTeam/cel.hrm` repo, and
`git show`/`git log` recovery commands only work in a clone of that repo, not here. `git show`/`git log` recovery commands only work in a clone of that repo, not here.
@ -538,7 +584,7 @@ What actually drives the DB connection:
Other live sections: `AppSettings` (`Secret`, `DefaultDB`, `RDLCLocation`, `downloadFolder`, Other live sections: `AppSettings` (`Secret`, `DefaultDB`, `RDLCLocation`, `downloadFolder`,
attendance import settings), `EmailSettings`, `EmployeeApiInfo`, `AdminPendingJob`, attendance import settings), `EmailSettings`, `EmployeeApiInfo`, `AdminPendingJob`,
`MobileAppSettings`, `FundInfo`, `OpenAI`, `LDAPSettings`, `Calendar` (bound to `MobileAppSettings`, `FundInfo`, `OpenAI`, `LDAPSettings`, `ForgotPasswordSettings`, `Calendar` (bound to
`HRM.BO/Configuration/CalendarSettings.cs`), plus many payroll/fund GL-head keys. `HRM.BO/Configuration/CalendarSettings.cs`), plus many payroll/fund GL-head keys.
`Startup.cs` has large commented-out blocks — verify against live code before assuming a feature is `Startup.cs` has large commented-out blocks — verify against live code before assuming a feature is
@ -713,6 +759,7 @@ Four pieces decide where a page load actually lands, and they are easy to break
`/ess/landing-page`, `SuperUser` stays. So anything that lands on `''` ends up on a dashboard. `/ess/landing-page`, `SuperUser` stays. So anything that lands on `''` ends up on a dashboard.
- `AppMainComponent`'s constructor calls `authService.logout()` when the load is **not** a reload - `AppMainComponent`'s constructor calls `authService.logout()` when the load is **not** a reload
(`performance.navigation.type`), which is why opening a deep link in a fresh tab signs the user out. (`performance.navigation.type`), which is why opening a deep link in a fresh tab signs the user out.
The exception is `#/reset-password`: it logs out but stays on the page.
- `<app-login [hidden]="!isLoginForm()">` sits in - `<app-login [hidden]="!isLoginForm()">` sits in
[app.main.component.html](HRM.UI/ClientApp/src/app/app.main.component.html) — `[hidden]`, **not [app.main.component.html](HRM.UI/ClientApp/src/app/app.main.component.html) — `[hidden]`, **not
`*ngIf`**. So `LoginComponent`'s constructor runs once at bootstrap on *every* route, not just on `*ngIf`**. So `LoginComponent`'s constructor runs once at bootstrap on *every* route, not just on

View File

@ -145,6 +145,11 @@ export const routes: Routes = [
loadChildren: () => import('./payroll-ot/payroll-ot.module').then(m => m.PayrollOtModule) loadChildren: () => import('./payroll-ot/payroll-ot.module').then(m => m.PayrollOtModule)
}, },
{
path: 'payroll-lfa',
canActivate: [AuthGuard],
loadChildren: () => import('./payroll-lfa/payroll-lfa.module').then(m => m.PayrollLfaModule)
},
{ {
path: 'payroll-tax', path: 'payroll-tax',
canActivate: [AuthGuard], canActivate: [AuthGuard],

View File

@ -0,0 +1,8 @@
<app-loading-panel></app-loading-panel>
<div class="col-12">
<kendo-card style="width: 100%;">
<kendo-card-header style="font-size:22px; font-weight:400;" align="middle">LFA Bank Advice</kendo-card-header>
<kendo-card-body>
</kendo-card-body>
</kendo-card>
</div>

View File

@ -0,0 +1,19 @@
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { ApiService } from '../../app.api.service';
@Component({
selector: 'app-lfa-bank-advice',
templateUrl: './lfa-bank-advice.component.html',
styleUrls: ['./lfa-bank-advice.component.scss'],
changeDetection: ChangeDetectionStrategy.Eager,
standalone: false,
})
export class LfaBankAdviceComponent implements OnInit {
constructor(public apiService: ApiService) {
this.apiService.selectedMenuName = 'LFA Bank Advice';
}
ngOnInit() {
}
}

View File

@ -0,0 +1,8 @@
<app-loading-panel></app-loading-panel>
<div class="col-12">
<kendo-card style="width: 100%;">
<kendo-card-header style="font-size:22px; font-weight:400;" align="middle">LFA Payment Approval</kendo-card-header>
<kendo-card-body>
</kendo-card-body>
</kendo-card>
</div>

View File

@ -0,0 +1,19 @@
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { ApiService } from '../../app.api.service';
@Component({
selector: 'app-lfa-payment-approval',
templateUrl: './lfa-payment-approval.component.html',
styleUrls: ['./lfa-payment-approval.component.scss'],
changeDetection: ChangeDetectionStrategy.Eager,
standalone: false,
})
export class LfaPaymentApprovalComponent implements OnInit {
constructor(public apiService: ApiService) {
this.apiService.selectedMenuName = 'LFA Payment Approval';
}
ngOnInit() {
}
}

View File

@ -0,0 +1,8 @@
<app-loading-panel></app-loading-panel>
<div class="col-12">
<kendo-card style="width: 100%;">
<kendo-card-header style="font-size:22px; font-weight:400;" align="middle">LFA Payment Undo</kendo-card-header>
<kendo-card-body>
</kendo-card-body>
</kendo-card>
</div>

View File

@ -0,0 +1,19 @@
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { ApiService } from '../../app.api.service';
@Component({
selector: 'app-lfa-payment-undo',
templateUrl: './lfa-payment-undo.component.html',
styleUrls: ['./lfa-payment-undo.component.scss'],
changeDetection: ChangeDetectionStrategy.Eager,
standalone: false,
})
export class LfaPaymentUndoComponent implements OnInit {
constructor(public apiService: ApiService) {
this.apiService.selectedMenuName = 'LFA Payment Undo';
}
ngOnInit() {
}
}

View File

@ -0,0 +1,8 @@
<app-loading-panel></app-loading-panel>
<div class="col-12">
<kendo-card style="width: 100%;">
<kendo-card-header style="font-size:22px; font-weight:400;" align="middle">LFA Payment</kendo-card-header>
<kendo-card-body>
</kendo-card-body>
</kendo-card>
</div>

View File

@ -0,0 +1,19 @@
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { ApiService } from '../../app.api.service';
@Component({
selector: 'app-lfa-payment',
templateUrl: './lfa-payment.component.html',
styleUrls: ['./lfa-payment.component.scss'],
changeDetection: ChangeDetectionStrategy.Eager,
standalone: false,
})
export class LfaPaymentComponent implements OnInit {
constructor(public apiService: ApiService) {
this.apiService.selectedMenuName = 'LFA Payment';
}
ngOnInit() {
}
}

View File

@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from '../_guards/auth.guard';
import { LfaPaymentComponent } from './lfa-payment/lfa-payment.component';
import { LfaPaymentUndoComponent } from './lfa-payment-undo/lfa-payment-undo.component';
import { LfaPaymentApprovalComponent } from './lfa-payment-approval/lfa-payment-approval.component';
import { LfaBankAdviceComponent } from './lfa-bank-advice/lfa-bank-advice.component';
export const routes: Routes = [
{ path: 'lfa-payment', component: LfaPaymentComponent, canActivate: [AuthGuard] },
{ path: 'lfa-payment-undo', component: LfaPaymentUndoComponent, canActivate: [AuthGuard] },
{ path: 'lfa-payment-approval', component: LfaPaymentApprovalComponent, canActivate: [AuthGuard] },
{ path: 'lfa-bank-advice', component: LfaBankAdviceComponent, canActivate: [AuthGuard] }
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class PayrollLfaRoutingModule { }

View File

@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CardModule } from '@progress/kendo-angular-layout';
import { PayrollLfaRoutingModule } from './payroll-lfa-routing.module';
import { LoadingPanelModule } from '../hrm-loding panel/loading-panel.module';
import { LfaPaymentComponent } from './lfa-payment/lfa-payment.component';
import { LfaPaymentUndoComponent } from './lfa-payment-undo/lfa-payment-undo.component';
import { LfaPaymentApprovalComponent } from './lfa-payment-approval/lfa-payment-approval.component';
import { LfaBankAdviceComponent } from './lfa-bank-advice/lfa-bank-advice.component';
@NgModule({
declarations: [
LfaPaymentComponent,
LfaPaymentUndoComponent,
LfaPaymentApprovalComponent,
LfaBankAdviceComponent
],
imports: [
CommonModule,
PayrollLfaRoutingModule,
LoadingPanelModule,
CardModule
]
})
export class PayrollLfaModule { }