Skip to content

Module — HR

The system of record for every employee: personal / identity / family data, employment contracts that place a person in the org hierarchy and on a salary scale, e-signatures, and a document archive — plus the two operational sub-systems that feed Payroll: attendance (check-in/out, delay tracking, monthly summaries) and leave (entitlement calculation, balances, and a Manager → HR → GM approval workflow).

Source: NKO.Main/NKO.Main/Controllers/{HumanResource,Attendances,Document}Controller.cs, NKO.Main/NKO.Main/BAL/{BHumanResource,BLeave}.cs, NKO.Lib/NKO.Shared/BAL/AttenadancesHandler.cs, NKO.Lib/NKO.Shared/BAL/BArchiveFile.cs.

Purpose & scope

  • In scope: employee master data, ID documents, family / conflict-of-interest register, contracts and the compensation records HR maintains for Payroll, e-signatures, the per-employee document archive, the attendance calendar and monthly roll-up, and leave entitlement / balances / requests.
  • Out of scope: the pay run itself (Payroll), performance appraisal (Recruitment — the Evaluation* area), and group / permission administration (Administration).
  • Database: NKO_DB (core), context NKO_DBEntities1.

Key features

  • Employee master data — bilingual (EN/AR) names, contact, address, nationality, emergency contacts, bank / IBAN (AppUser + AppUserExtend); branch / sub-branch; draft vs. approved status; non-blocking conflict warnings for a duplicate ID number, e-mail or phone.
  • Identity documents — passport, Turkish ID, Syrian ID, residency permit, temp-protection ID, work permit (AppUserAttachment, typed by AppUserAttachmentType); cross-employee duplicate detection.
  • Family & conflict-of-interest register — dependants (AppUserFamily) and relatives already employed by NKO (AppUserRelative).
  • Contracts — position, department, level/step salary scale, project, direct vs. core, trial period, auto vs. manual leave accrual, contract dates; renew / refresh; PDF export.
  • Compensation records (maintained by HR, consumed by Payroll) — salary, allowances, deductions, charges, rewards, insurance, ex-gratia allowances.
  • E-signatures — the employee uploads, HR approves / rejects; an approved signature is a precondition for signing leave and procurement documents (BSign.HasSign).
  • Document archive — arbitrary typed file attachments per employee / contract / charge / leave.
  • Attendance — yearly grid, self check-in / out with an IP allow-list, a monthly delay table with PDF, a "missing attendance" list, and a reset check.
  • Leave — 16 leave types with per-type entitlement rules, seniority-based accrual, hourly & half-day handling, holiday/weekend-aware day counting, opening-balance adjustments, interference checks, a FullCalendar feed, and an e-signed multi-step approval (HR-only cancellation).
  • Employee reporting — a wide multi-facet filter/report over all HR data, Excel exports, the employee card.
  • Bulk import — employee / leave / loan data import.

Screens

Route = /{Controller}/{Action}; primary screens only (each has add / edit / delete partials under the same key). Full list in the HR API reference.

HumanResourceController — /HumanResource/*

Feature Route View Permission key
Employee list /HumanResource/Index HumanResource/Index.cshtml HumanResourceIndex
Draft employees /HumanResource/DraftEmployees DraftEmployees.cshtml HumanResourceDraftEmployees
Create employee (+ disabled login) /HumanResource/Create _Create.cshtml HumanResourceCreate
Create from a hired applicant /HumanResource/CreateEmployee (redirect) HumanResourceCreate
Edit personal / employment data /HumanResource/Edit/{id}, /HumanResource/EditEmp/{id} Edit.cshtml, EditEmp.cshtml HumanResourceEdit
Employee hub / details / card /HumanResource/Details/{id}, /HumanResource/EmployeeCard/{id} Details.cshtml, EmployeeCard.cshtml HumanResourceDetails, HumanResourceEmployeeCard
ID documents /HumanResource/IdInformation/{id} IdInformation.cshtml HumanResourceFamilyManagement
Family & conflict register /HumanResource/FamilyManagement/{id}, /HumanResource/Conflict/{id} FamilyManagement.cshtml, Conflict.cshtml HumanResourceFamilyManagement, HumanResourceConflict(Management)
Contract (position/dept/manager/scale) /HumanResource/Contract/{id}, /HumanResource/ManageContract, /HumanResource/RefreshContract Contract.cshtml HumanResourceContract
Contract PDF /HumanResource/DownloadContractPDF/{id} (Rotativa PDF) HumanResourceContract
Salary / allowances / deductions / rewards / insurance / charges /HumanResource/Salary/{id}, /HumanResource/ExAllowance/{id}, /HumanResource/Charges/{id} + Manage* _Manage*.cshtml HumanResourceSalary, HumanResourceManageData, HumanResourceContract
E-signatures /HumanResource/Signatures/{id}, /HumanResource/ManageSign/{id}, /HumanResource/ApproveSign, /HumanResource/RejectSign Signatures.cshtml HumanResourceSignatures, HumanResourceManageSign
Attachments & notes /HumanResource/Attachments/{id}, /HumanResource/Notes/{id}, /HumanResource/AddNote Attachments.cshtml, Notes.cshtml HumanResourceAttachments, HumanResourceNotes, HumanResourceAddNote
Per-employee leaves /HumanResource/Leaves/{id} Leaves.cshtml HumanResourceLeaves
Per-employee overtime view /HumanResource/Overtime/{id} Overtime.cshtml HumanResourceOvertime
HR report /HumanResource/Report Report.cshtml HumanResourceReport
Export users /HumanResource/ExportUsers (Excel) HumanResourceExportUsers
Sub-data / bulk import /HumanResource/UpdateSubData, /HumanResource/ImportData UpdateSubData.cshtml, ImportData.cshtml PayrollTransferData (payroll key on an HR screen)

AttendancesController — /Attendances/*

Feature Route Permission key
Yearly attendance grid /Attendances/Index/{id} AttendancesIndex
Monthly delay / lateness (+ PDF) /Attendances/Delay AttendancesDelay
Missing-attendance list /Attendances/Missings AttendancesMissings
Reset check /Attendances/ResetCheck ResetCheck
Export attendance /Attendances/Export, /Attendances/Users HumanResourceExportUsers

DocumentController (/Document/ExportationRotativeHeader, .../Footer, [AllowAnonymous]) is a shared Rotativa PDF header/footer provider with no HR logic.

Business logic

Class File Responsibility & notable logic
BHumanResource NKO.Main/NKO.Main/BAL/BHumanResource.cs (~120 ln) Non-blocking conflict detection. CheckConflictAttachments scans all other employees for a matching IdNumber on the same attachment type; CheckConflictEmailPhone does the same for PrivateEmail / MobilePhone. Warnings only.
BLeave NKO.Main/NKO.Main/BAL/BLeave.cs (~2700 ln) The leave engine. GetAnnualBalance(userId) — seniority accrual at 1.6667 days/month with brackets at 5 and 15 years of service and an age-50 bump; direct (fixed-term) contracts get 0 during trial / the first 6 contract-months then contractPeriod days; core contracts get 0 in the first 2 employment-months then ApplyYears; sick accrual is by level (0.8333 / L1 1.25 / L2 1.6667); overtime-allowance leave = accepted HR-signed overtime hours (within 30 days) ÷ 8; manual LeaveBalance rows are added; AutoLeaveCaluculate == false ⇒ use contract.LeaveBalance verbatim. GetBalance(userId, type, …) — a per-type rule engine covering all 16 LeaveTypeCodes (Annual, UrgentSick, Marriage core 7/direct 3, Paternity 5/direct 1 male-only, Maternity Syria 30/Turkey 112/twin 126 female + 6-month gate, Nursing 1.5 core female, Idda 7, Bereavement 3/1, ReligiousDuties 15 once + 12-month gate, Study 1.5/month only if no annual/sick balance + attachment, Sick unlimited + medical report, UnpaidExceptional only if no annual/sick balance, …); sets Allowed, Unlimited, AttachmentRequired, Message[]. GetLeaveCount — day count as hours/8, skipping public holidays & weekends, half-holidays / half-weekends counted as 4h. Workflow methods (SetSent, SetManagerAccepted, SetHRAccepted, SetGMAccepted, Set*Refused, SetCancelled) — see Leave Management.
AttenadancesHandler NKO.Lib/NKO.Shared/BAL/AttenadancesHandler.cs (~1650 ln; contract IAttendancesHandler) All attendance computation. GetMonthly / GetYearly — per-day reconciliation of Attendance rows against the branch CalendarProfile + CalenderConfiguration + SpecialHoliday and approved leaves (WorkDay / Weekend / PublicHoliday / PartialHoliday / Leave / PartialLeave / Absent / BeforeHiring). DelayInHoursMinutes — per-day lateness vs. the profile start / lunch. GetMonthlySummary — the payroll-facing roll-up: Paid Days = 30 − unpaid − beforeHiring − absent, Attendance Days = fullWorkDays + halfWorkDays/8, annual / administrative leave, weekend, public holiday. UpdateCheckInOut, GetAttendanceInfo (validates the IP allow-list and an approved e-signature), GetCalendarProfile.
BArchiveFile NKO.Lib/NKO.Shared/BAL/BArchiveFile.cs Generic (AreaId, ReferenceId, FileTypeId) file store used for employee / contract / charge attachments (S3), also by leave and every other module. Create, Edit(hasFile), GetByReference, GetArchiveTypes(areaId).

Data

  • Employee: AppUser, AppUserExtend, AppUserAttachment, AppUserIdentity, AppUserFamily, AppUserRelative, AppUserPosition, AppUserSign, AppUserInsurance, Bank (reference).
  • Contract & compensation (maintained here): AppUserContract; consumed by Payroll — AppUserSalary, AppUserAllowance, AppUserDeduction, AppUserCharge, AppUserReward.
  • Attendance: Attendance, CalendarProfile, CalenderConfiguration, CalendayDays, SpecialHoliday.
  • Leave: Leave, LeaveBalance, LeaveType.
  • Misc: Comment, Note, Reference, ArchiveFile, ArchiveFileType.

Full column detail: HR database.

Permissions

Distinct keys: HumanResourceIndex, HumanResourceDraftEmployees, HumanResourceReport, HumanResourceLeaves, HumanResourceExportUsers, HumanResourceDashboard, HumanResourceCreate, HumanResourceViewUser, HumanResourceEdit, HumanResourceEmployeeCard, HumanResourceDetails, HumanResourceContract, HumanResourceContractDetails, HumanResourceAddNote, HumanResourceNotes, HumanResourceFamilyManagement, HumanResourceConflict, HumanResourceConflictManagement, HumanResourceSalary, HumanResourceOvertime, HumanResourceAttachments, HumanResourceDeleteAttachment, HumanResourceManageAttachment, HumanResourceUploadFiles, HumanResourcePosition, HumanResourceManagePosition, HumanResourceManageData, HumanResourceManageSign, HumanResourceSignatures; AttendancesIndex, AttendancesDelay, AttendancesMissings, ResetCheck; and PayrollTransferData on the two import screens. Data scoping: SharedPermissions.{Users = 1, Leave = 2, Attendance = 14} via BUser.GetPermission (All / Location / Custom / Default).

Screenshots

Employee record & disabled login — /HumanResource/Create:

New-employee form

Draft-employee queue — /HumanResource/DraftEmployees:

Draft employees list

Contract — /HumanResource/Contract/{guid} (salary masked):

Contract history

Leave — list, request form, and the Manager → HR approval chain (/Timesheet/*):

Leaves list New leave request Leave approval timeline

Approved-employee master grid — /HumanResource (names / e-mail / ID masked):

Employee master list

Per-employee record — /HumanResource/EmployeeCard/{guid} (personal data masked):

Employee card