Skip to content

Phase 7 HR — Production Readiness ​

FieldValue
Date2026-08-02
Re-verified2026-08-02
StatusReady for merge / staging go-live (opt-in Marketplace)
ScopeEmployees · Leave Management · Attendance · Payroll
Branchfeature/phase-7-hr-9630
CompanionSecurity Audit

Executive summary ​

Phase 7 delivers four free HR Marketplace SKUs on the frozen platform. After security remediation, headed browser verification, CI green on companion PRs, and a second readiness audit, the modules are production-ready for opt-in enablement. They are not default-included; tenants must install from Marketplace (Leave / Attendance / Payroll require Employees first).

Go / No-Go: Go for staging → production, with the ops follow-ups below.

GateResult
Security audit (no open Critical/High)Pass — see companion
Backend CI (Quality Gate + Pest)Pass — PR #72
Frontend CI (Quality Gate)Pass — PR #66
Docs CI (VitePress)Pass — PR #75
Website marketing SKUsMergeable — PR #12
Headed Playwright (2026-08-02)6/6 per HR module
Draft PRs marked ready☐ Eng
Staging smoke☐ QA / Ops

Ship contents ​

SKUSlugDepends onPrimary capabilities
Employeesemployees—Directory, employment type/status, optional user link, stats
Leave Managementleave-managementEmployees (hard)Types, balances, draft → submit → approve/reject/cancel
AttendanceattendanceEmployees (hard)Daily records, unique employee+date, check-in/out
PayrollpayrollEmployees (hard); Accounting (optional soft)Profiles, pay runs draft → approve → paid, journal post

All: is_default_included: false, is_billable: false, category hr.


Deploy order ​

  1. Backend migrate (schema + catalog + permissions + dependencies via migrate-only registrars)
  2. Deploy API (EloSync-Backend)
  3. Deploy SPA (EloSync-Frontend) with HR nav group
  4. Deploy Docs (this pack)
  5. Deploy marketing site (EloSync-Website; modules marked available)
  6. Staging smoke (below) before production traffic

Suggested merge order: Backend → Frontend → Docs → Website.

No new env vars are required for HR itself. Payroll journal post needs an entitled Accounting workspace with active expense + liability accounts.


Pre-flight checklist ​

#CheckOwnerPass?
1Migrations applied on staging/prod DBOps☐
2Catalog shows four hr modules; hard deps Leave/Attendance/Payroll → EmployeesOps☐
3Marketplace blocks Leave/Attendance/Payroll when Employees missingQA☐
4Default staff role does not include payroll.view on new tenantsQA☐
5Existing tenants: staff roles re-synced or manually stripped of payroll.view if undesiredOps☐
6Frontend HR routes gated with RequireAccessQA☐
7Pest HR suites green in CIEng☑ (CI green on #72)
8Playwright test:e2e:employees|leave-management|attendance|payroll green on stagingQA☐
9Draft PRs marked ready for review and merged in orderEng☐

Staging smoke (human) ​

Employees ​

  1. Enable Employees from Marketplace
  2. Create employee (required number + name)
  3. Edit, soft-delete, restore
  4. Confirm KPIs update

Leave Management ​

  1. Enable Leave (only after Employees)
  2. Create leave type (allowance > 0)
  3. Create request without optional days → days auto-calculated
  4. Submit → approve → balance used increases
  5. Confirm approved request cannot be deleted (soft or force)
  6. Confirm inflated days beyond date range returns 422

Attendance ​

  1. Enable Attendance
  2. Record present with check-in/out
  3. Duplicate employee+date returns 422
  4. Check-out before check-in returns 422

Payroll ​

  1. Enable Payroll (+ Accounting if testing journal)
  2. Create profile with base salary
  3. Create pay run → lines from active profiles
  4. Approve → Mark paid
  5. Post journal with expense debit + liability credit (or defaults)
  6. Confirm staff user cannot GET /payroll-profiles (403)

Automated verification ​

bash
# Backend
cd EloSync-Backend
php artisan test --compact \
  tests/Feature/Tenant/Employee/EmployeeTest.php \
  tests/Feature/Tenant/Leave/LeaveManagementTest.php \
  tests/Feature/Tenant/Attendance/AttendanceTest.php \
  tests/Feature/Tenant/Payroll/PayrollTest.php

# Frontend headed / CI
cd EloSync-Frontend
npm run test:e2e:employees
npm run test:e2e:leave-management
npm run test:e2e:attendance
npm run test:e2e:payroll

Evidence (2026-08-02):

  • Pest HR suites green locally after leave force-delete retention harden; CI Pest + Quality Gate SUCCESS on Backend #72
  • Headed Playwright 6/6 per module (Employees, Leave, Attendance, Payroll)
  • Frontend / Docs Quality Gates SUCCESS

Security posture (summary) ​

Full detail: Phase 7 HR Security Audit.

ControlStatus
Tenant isolation (BelongsToTenant + Pest isolation)Pass
Module + permission middlewarePass
Leave balance / days integrityPass (remediated)
Approved leave soft + force delete retentionPass (re-audit harden)
Pay-run amount + journal account controlsPass (remediated)
Compensation visibility (no staff payroll.view)Pass (new tenants)
Concurrent approve/post lockingPass (remediated)

Rollback ​

LayerAction
FrontendRedeploy previous SPA build (HR nav disappears for entitled tenants until re-deploy — API remains)
Backend codeRedeploy previous release; keep migrations (migrate-only catalog is additive)
Module disableMarketplace uninstall / disable subscription for affected SKUs (data retained via soft deletes)
SchemaDo not roll back HR migrations in production without a dedicated data plan

Monitoring & support ​

  • Platform activity log events for leave approve / pay-run approve (existing subscribers)
  • Laravel Nightwatch / Telescope for 422/403 spikes on /api/tenant/v1/{employees,leave-*,attendance-*,pay-*,payroll-*}
  • Support talking points: Employees must be enabled first; staff cannot see salaries by default; approved leave is retained for audit

Accepted residual risk ​

ItemSeverityNotes
No SoD on approve (creator may approve)InfoSMB default; optional flag later
Soft-delete uniques include trashed rowsLowRecreate may need restore; follow-up partial indexes
Employee user_id uniqueness is app-layer onlyLowFollow-up partial unique index
Unvalidated list sort/directionLowPlatform-wide pattern
Existing tenants may still grant staff payroll.viewMediumRe-sync roles after deploy

Sign-off ​

RoleNameDateDecision
Eng☐ Ready
QA☐ Ready
Ops☐ Ready

Release decision: Ready for production opt-in after staging smoke and staff-role re-sync where needed.

Official documentation for the EloSync SaaS Platform.