Status: Source-port architecture; runtime/security validation remains open.

Execution path

Admin and employee Requests controllers enter their respective services, then the shared RequestService. Creation validates the applicable policy and records EmployeeRequest type Exit. The approval engine records/reuses the applicable role chain. Review calls the tenant procedure wrapper for spReviewEmployeeRequest; service code handles review notifications and audit around the result.

People stores employment state in the tenant database. Membership stores login state/UserExit separately. Assets, Surveys, Payroll and external integrations are additional effect boundaries, not one demonstrated distributed transaction. Local flow references: UF2 creation, UF3 review, UF4 offboarding, UF5 final pay, UF6 rehire.

Review transaction and routing

The supplied procedure body wraps its local work in BEGIN TRANSACTION with commit/rollback and reports Result 1 or 0. With workflows enabled, it determines final approval from WorkflowStepsCount − ReviewStepsCount = 1. Intermediate approvals retain New status; final approval sets Approved. Decline records Declined and a review row. A batch loops through per-request work: a later failure need not roll back earlier commits.

Routing boundary: the procedure reads but does not increment ReviewStepsCount or set NextReviewEntityId. The technical source attributes those updates to a trigger on EmployeeRequestReviews, whose body is not included in the supplied SP catalogue. Older source sections say the review SP advances routing. Retain the body-based distinction; verify the deployed trigger and service behaviour before diagnosing a stuck step as a UI problem.

Workflows-disabled configuration allows a single-step approval in the source. This is not an operational workaround or an exemption from authorisation.

Exit and dependent effects

Boundary Evidence and limitation
Employment Final Type 5 approval creates EmployeeExit. StartDate earlier than transaction time also sets IsExited and Persons.PersonStatusId = 4. Other dates depend on later processing; exact worker and same-day/time-zone rules are not established.
Membership People’s narrative describes CreateUserExit and login UserStatusId = 3. The SQL exit branch alone does not prove this separate-store effect or session/external-app revocation completed.
Survey SurveyId greater than zero can create EmployeeSurvey with contextual fields. This is assignment, not response/delivery or a validated post-exit authentication contract.
Clearance People describes checklist/gating and waiver flags; task guidance requires explicit asset release. Do not infer a universal pre-exit gate from prose when the shown approval SQL can mark an exit immediately.
Payroll Eligibility/proration reads employment dates and relevant changes. Approval of the exit does not mean payroll approval, funding or settled payment.

PILON: generated change, not a payment

The supplied exit-approval branch requires positive PilonBasisId, PilonValue and PilonAmount. It derives tax/currency configuration from the paygrade, computes tax where applicable and inserts a one-off PayrollChange type 5. Its SQL sets status 3, labelled Pending; business prose calls this Approved. Preserve the conflict and verify actual eligibility/approval before payout or manual repair.

The shown duplicate check matches person, PILON type, amount and Pending status. It is not proof of a unique exit-origin key or safe arbitrary replay after status/amount changes. Source tax examples are historical configuration evidence, not verified current tax law. Do not repeat the source’s inconsistent positional tax-parameter comment as a signature.

Rehire and preserved evidence

RehirePerson loads an exited Person and describes reactivation, IsRehired/RehireDate, clearing ExitDate, membership activation and removing/inactivating UserExit, with audit/logging. Prior requests, account details, assets, absences, reviews and history remain. Paygrade history may change when a new grade is supplied. Exact leave/balance and integration handling remains qualified; pay and privileges require separate review rather than blanket restoration.

Security and operations boundaries