Source-port status: Post-V2 reconstruction from Leave — system flows (6 Oct 2026: web 8ff381cc4, backend 78e0e76bd, read-only dev SQL/logs). This port does not newly verify production or fix recorded defects. Leaves and Leave V2 are historical comparisons, not replacements for that newer snapshot.

Post-V2 architecture

Leave remains EmployeeRequest type 1 within the shared Requests engine, but “there is no leave service” is no longer accurate for the inspected build.

Component Recorded responsibility
RequestService Create/edit originals, generic review and delete; delegates to SQL and leave-specific services.
LeaveBalanceService Eligibility/day/balance validation and typed movement operations. Current SQL/C# ownership is not fully consolidated.
LeaveRequestLifecycleService Server action availability; withdraw/cancel/extend/modify and linked-change application.
LeaveOverlapService Own-leave/staffing overlap and department/company limits.
LeavePlanningService Annual cycle, periods, roster, revision, coordination, conversion and release.
LeaveCalendarService Shared working-day count and scoped calendar.
LeaveReportService / LeaveNotificationService Report views; employee/reliever lifecycle notifications.
LeavePlanningDeadlineReminderService Planning deadline reminders.
HolidayService / Paid_HolidaysService Earlier holiday domain/controller references; verify actual deployment version before changing it.

Mutations span C# and SQL

Submission consumes days in C#; spReviewEmployeeRequest and spDeleteEmployeeRequest still matter for review/delete restoration. spUpdateEmployeeLeaveBalance is the nightly accrual/rollover/expiry engine (source schedule 02:01). Do not conclude a behavior is absent by inspecting only RequestService, or assume August's proposed removal of SQL balance writes has shipped.

Original/change linkage and current state must be checked before applying a delta. Source ApplyApprovedLinkedRequestAsync guards the original still holding days. Preserve typed movement cause, affected employee, policy and before/after evidence. Auditability and exactly-once release are invariants, not established solely by having a log table.

Security and payroll boundary

View/create/edit capabilities and workflow reviewer context are distinct. Admin lifecycle paths require can_edit_leave_requests; overlap override additionally needs can_override_leave_overlap plus reason. Employee operations must remain scoped to their own eligible work; HR withdrawal is limited to requests HR recorded. Server computes allowed actions and calendar/roster scope.

Paid/unpaid policy and approved absence feed Payroll working-day/pro-ration logic; leave perks may become allowances. Lifecycle cancellation/extension stops after payroll processing. Exact consumption linkage, current migration state and transaction boundaries need verification before repair. External HRIS ingestion is referenced at Integration/Leave/RequestNotification; its authentication, replay and reconciliation contract is not fully supplied here.

Known defects — retained, not fixed by documentation

Finding in October reconstruction Consequence / verification required
Decline credits reviewer as well as SQL restoring requester Extra credit can affect a reviewer with a policy balance row. Source says master/production is affected; this port has not newly confirmed deployment. Keep exactly one requester release across C#/SQL in a coordinated engineering fix.
Batch review calls SQL directly Bypasses staffing overlap and converted-period release; possible child application bypass was not tested. Individual review is not proof batch is safe.
Declined API edit remains allowed Old-minus-new adjustment credits already released days; hiding UI Edit does not secure the API.
Return-for-correction service/status unreachable No endpoint/button calls it; overlap error may suggest an unavailable recovery.
Modify API has no screen Do not describe it as an available user journey.
Extension-window setting missing Default 0; no configurable screen established.
Accrual repair not reverified August defect inventory describes incorrect per-item rates, stale person/hire data and no replay/idempotency. Do not mark fixes delivered.

Engineering change discipline

Regression-test every shared request type when changing status guards. Compare balance and logs across submit/edit/review/decline/withdraw/delete and child completion, including repeat calls/concurrent review. Reconcile historical variances with HR sign-off before corrections; never silently rewrite balances.

August's rowversion token, single-owner ledger, accrual catch-up and migration capture are engineering proposals until verified against current code/SQL. Re-read current procedure definitions and migrations, test a restored dataset and capture changed SQL in source control. This chapter is a source port, not a runtime/security/financial test report.