Skip to main content

Spyrl — Product Requirements Document (PRD)

Version: 1.0 · Date: 2026-10-31 · Status: Draft for review Related: brd.md (business requirements) · architecture.md · project-plan.md · summary.md · research/spryple-analysis.md · CONVENTIONS.md

This PRD defines what Spyrl must do, module by module, so that design, engineering and QA can build and verify it. It turns the business requirements in brd.md and the feature disposition in research/spryple-analysis.md (§19) into functional requirements, user stories, permissions, UI/UX rules, notifications, reports and non-functional requirements. Names, module codes, roles, ID schemes and release scope follow CONVENTIONS.md. If this document disagrees with CONVENTIONS.md, CONVENTIONS.md wins.


1. Document control​

ItemValue
DocumentProduct Requirements Document (PRD)
ProductSpyrl (working name), a multi-tenant HCM + Field-Force CRM SaaS for Indian SMEs
OwnerProduct Management
ReviewersEngineering lead, Payroll/compliance SME, QA lead, Security lead, Design lead
ApproversFounder/CEO, Head of Engineering
Source of truth for IDs and scopeCONVENTIONS.md §3–§7
Upstreambrd.md (BR-* requirements, business rules, objectives BO-*)
DownstreamModule design specs in the documentation site (modules/), the feature catalogue (features/), the API catalogue, test plans

1.1 Revision history​

VersionDateAuthorChange
0.12026-10-31ProductFirst complete draft from research baseline v1.0 and architecture v1.0
1.02026-10-31ProductReview-ready draft: all 16 modules, NFRs, catalogues, traceability

1.2 How to read this document​

  • Evidence labels. Every statement about the reference product carries [Observed] (the Spryple Help Center documents it, cited with a role code and page, e.g. (A: Leave Management)) or [Inferred] (it follows from documented workflows). Facts that come from screenshots reviewed in research §21 are cited as (research §21.x). Everything we design ourselves is [Proposed]. Spryple feature IDs (SP-<MOD>-NN) come from the research.
  • Requirement IDs. FR-<MOD>-NNN (functional), NFR-<CAT>-NN (non-functional), US-<MOD>-NN (user story, acceptance criteria AC1..n in Given/When/Then). IDs are stable: a removed requirement keeps its ID with the status "Withdrawn"; it is never renumbered.
  • Priority is MoSCoW for the release named in the row: Must (release cannot ship without it), Should (important; may slip one release with sign-off), Could (include if capacity allows), Won't (explicitly out of scope for that release; recorded to stop scope creep).
  • Release is the release in which the requirement is first delivered (R0–R4, see §5). R0 items ship to customers as part of the R1 MVP general availability (GA).
  • Statutory values (rates, ceilings, slabs, due dates, thresholds) are configurable examples to verify with a payroll/compliance expert before each release. The product never hard-codes them; they come from the versioned statutory pack (FR-PLT-009).
  • Business traceability. Each module section lists the BRD module it traces to (e.g. "Traces to: BR-ATT-*"). Requirement-level links to individual BR IDs are maintained in the requirements tool once brd.md is baselined.

1.3 Role abbreviations used in permission matrices​

Abbrev.Role key (CONVENTIONS.md §4)Abbrev.Role key
OWNorg_ownerSLAsales_admin
HRAhr_adminSLMsales_manager
HRMhr_managerFEXfield_executive
FNAfinance_adminKIOkiosk_operator
PRMpayroll_managerINSinstructor
LMline_manager (derived from reports_to)AUDauditor (read-only)
EMPemployee (everyone has it)PLA / SUPplatform_admin / support_engineer

Matrix cells show the default data scope of the seeded role: SELF, TEAM, DEPT, LOC, ORG, ORG(R) (read-only), — (no access). LOC* means "ORG or LOCATION, chosen at role assignment" as in CONVENTIONS §4. Tenants can clone and change seeded roles (FR-IAM-010); the matrices describe the seeded defaults only.


2. Product overview and vision​

2.1 Problem​

Indian SMEs with 10–1,000 employees run attendance, leave and payroll on spreadsheets, a biometric device's desktop software and a payroll accountant. Field-sales teams add WhatsApp check-ins and paper travel claims. The result is late and disputed salaries, missed statutory filings (EPF, ESI, PT, LWF, TDS), no audit trail and high HR effort at every month-end. Existing tools either cover HR without field force, or are enterprise suites that are too expensive and too hard to configure. See brd.md for the business case and objectives.

The reference product, Spryple, proves the demand for an SME suite that chains attendance → leave → payroll and adds field-force tracking [Observed] (research §1). It also shows the structural problems we must avoid: policies that are not effective-dated, duplicated rule screens, fixed leave types, default shared passwords, four separate mobile apps and missing statutory outputs [Observed/Inferred] (research §1, §17, §18).

2.2 Vision​

"From punch to payslip, correctly, every month, without spreadsheets." Spyrl is the one system an Indian SME needs to know who worked, where, and what to pay them, compliant by default and simple enough that a 20-person company can go live in a week.

2.3 Product goals (MVP horizon)​

#GoalMeasure (target at 6 months after R1 GA)
G1Fast self-serve go-liveMedian time from sign-up to first locked payroll run ≤ 21 days; setup-wizard completion ≥ 70% of trials
G2Correct pay without manual adjustment≥ 98% of payslips need no post-lock correction (measured by reversal and off-cycle correction runs)
G3Statutory outputs ready on time100% of locked runs produce ECR, ESI, PT and bank files that pass format validation
G4Self-service adoption≥ 60% monthly active employees on mobile (ESS); ≥ 80% of leave and regularization requests raised by employees, not HR
G5Month-end effort cutHR/payroll time from period close to payroll lock ≤ 2 working days for tenants ≤ 200 employees (customer survey + run timestamps)
G6TrustZero cross-tenant data incidents; zero default passwords; MFA on 100% of admin accounts

2.4 Target customers and plans​

SegmentTypical profilePlan (architecture.md §14)
Micro business5–50 staff, shop, clinic, small factory; owner runs HR on a phoneLite: attendance + simple payroll, mobile-first
SME, office/plant50–500 staff, 1–10 locations, shifts, a part-time HR + payroll personStandard: Core HR, ATT, LVE, PAY, ESS/MSS
SME, growing200–1,000 staff, multi-state, field teamsProfessional: + CLM, EXT/F&F, ENG, SSO, API, advanced reports; add-ons FFM, TSM, LMS
Large or regulated1,000+ staff or isolation demandsEnterprise: dedicated cell, custom domain, SAML, 99.9% SLA

"Lite" is an entitlement profile on the same product, not a separate app or data model [Proposed] (research §15, §19).

2.5 Scope summary​

In scope (R0–R4): the 16 modules in CONVENTIONS.md §3. Out of scope until after R4: recruitment/ATS, performance management, surveys, asset management, helpdesk, invoicing for timesheets, CRM quotes/orders, payroll outside India (see §15).


3. Personas​

Personas are written per role key. One person can hold several roles (e.g. the owner of a 30-person company is org_owner, hr_admin and payroll_manager).

Role keyPersonaGoalsPain points todayPrimary surfaces
org_ownerRamesh, owner-director of a 120-person auto-parts unit in PuneSee headcount, attendance and payroll cost; approve payroll; stay compliantSurprises at month-end; no single view; fear of PF/ESI noticesWeb dashboard, mobile approvals
hr_adminPriya, HR lead who configures the systemSet up masters and policies once; change them safely mid-yearRule changes that only apply to new joiners; duplicated settingsWeb (setup, policies)
hr_managerKavya, HR executive who runs daily operationsOnboard quickly, fix attendance, answer employee queriesChasing documents; manual data entry; Excel imports that fail silentlyWeb; mobile for approvals
finance_adminSuresh, finance controllerConfigure salary structures, statutory settings and bank accounts correctlyStatutory rates changing by state and date; formula errorsWeb
payroll_managerAnil, payroll accountant (often an external consultant)Run payroll in hours, not days; file statutory returns on timeRe-keying attendance; no variance check; portal files built by handWeb (payroll workbench)
line_managerDeepa, production supervisor with 25 operators on 3 shiftsApprove requests fast; see who is absent; plan shifts and swapsRequests on WhatsApp; no team calendar; shift swaps on paperMobile first; web for rosters
employeeImran, machine operator / office staffPunch easily; apply for leave; see payslip and balanceDisputed absences; no visibility of balance or salary breakupMobile (ESS), kiosk
field_executiveLakshmi, medical representative visiting 12 doctors a dayPunch from the field; log visits; get travel paidManual visit reports; slow travel claims; battery drainMobile only
sales_adminVikram, sales operationsConfigure pipeline stages, territories and mastersPipeline that does not match their sales processWeb
sales_managerFarhan, regional sales managerSee team location and visits; approve travel; move the pipelineNo proof of visits; inflated kmsWeb map; mobile
kiosk_operatorFront-desk receptionist at a plant gatePunch staff in and out on a shared tabletBuddy punching; queues at shift changeMobile in kiosk mode
instructorTraining coordinatorPublish mandatory courses; track completionPaper attendance for POSH and safety trainingWeb
auditorStatutory or internal auditor (time-boxed)Read records and audit logs without changing anythingAsking HR for exportsWeb (read-only)
platform_admin, support_engineer, billing_admin, release_managerSpyrl staffProvision, support and bill tenants safelyNot applicable (internal)Platform admin console

4. Product principles​

#PrincipleWhat it means in requirementsAnti-pattern we avoid (reference)
P1Configuration over customizationEvery tenant difference is expressed through plans, feature flags, typed policies, masters, custom fields, templates or workflows (architecture.md §8). No per-tenant code branches. A request that cannot be met by configuration becomes a product feature behind a flag, available to all tenants on that plan.Implementation-team Excel templates and vendor-side setup [Observed] (M: Attendance Management)
P2Effective-dated policiesPolicies, assignments, compensation and statutory tables are versioned with valid_from/valid_to. Every change asks "effective from when?" and "apply to whom?" and shows the affected employees before saving. Recalculation is deterministic and reproducible."Changes do not affect existing employees" [Observed] (A: Employee Management; A: Leave Management)
P3One place for each ruleEach setting exists in exactly one typed policy, with help text and an example generated from its schema. No numbered free-text rules.Probation, notice, lates and default shift each configured twice [Observed] (research §17 D4, D5)
P4Mobile-first ESSEvery employee and line-manager task in R1 is fully doable on the mobile app: punch, requests, approvals, payslips, balances. The web app is primary for configuration and payroll. One app for all roles.Four separate apps [Observed] (research §15)
P5India compliance by defaultEPF, ESI, PT, LWF, TDS, gratuity and statutory files are built in and driven by a centrally published, effective-dated statutory pack. Rates are data, never code.Manually typed TDS; statutory "reports" instead of portal files [Observed/Inferred] (M: Payroll Management)
P6Privacy by designData minimisation; purpose-tagged sensitive fields; explicit consent for face and location; location only between punch-in and punch-out; masking by default; retention schedules; DPDP rights built in.Plaintext password emails; "No data collected" store listing for a GPS app [Observed] (research §21.1, §21.2)
P7Secure by defaultNo default passwords, invite activation, MFA for admin roles, least-privilege roles with data scopes, full audit trail."Welcome1!" default password [Observed] (A: Employee Management)
P8Explainable numbersEvery computed value (day status, leave balance, payslip line, TDS) can show "how was this calculated?" with its inputs and policy version.Opaque lates-to-leave deductions [Inferred]
P9Build less, finish moreThe MVP covers attend-to-pay end to end before anything else. Breadth (LMS, CRM pipeline richness) waits until the core is proven.—

5. Release plan summary​

Consistent with CONVENTIONS.md §7. Dates and milestones are in project-plan.md.

ReleaseThemeModules and headline scopeExit criteria (summary)
R0FoundationsPLT (provisioning, plans, entitlements, flags, statutory pack publishing), IAM (invite activation, MFA, roles × scopes, audit; OIDC SSO follows in R1), ORG (masters, policy framework, import framework, setup wizard), NTF core (templates, email/SMS/push, approval engine), CI/CD, observabilityTenant can be provisioned in < 2 min; isolation test suite green; audit on all writes
R1 — MVPAttend-to-Pay coreEMP (hire, self-onboarding, directory, documents, checklists, job history), ATT (web/mobile punch with selfie + geo-fence, shifts, rotations, swaps, week-offs, regularization, permissions, OT with approval, extra days, penalties, biometric CSV/API import, period lock), LVE (leave-type builder, ledger, accruals, holidays, comp-off), PAY (structures, compensation, run lifecycle, EPF/ESI/PT/LWF/TDS with IT declarations, ECR/ESI/PT/LWF/bank files, payslips, arrears, variable pay, advances and loans, off-cycle), RPT (standard reports and dashboards), MOB (ESS + MSS)MVP acceptance checklist (§16.2) passed by 3 pilot tenants running one parallel payroll each
R2Complete HR lifecycleCLM, EXT (+ F&F), ENG, MOB kiosk + face verification, biometric device gateway, Form 16 / 24Q outputs, payroll journal export, public API and webhooks, SAML, multi-level (N-level) approvalsF&F settles through PAY; Form 16 generated for a full tax year in pilot
R3Field and projectsFFM (tracking with consent, visits, configurable pipeline, travel → CLM mileage), TSM (projects, weekly timesheets, approvals), calendar syncField add-on sold to ≥ 5 tenants; GPS ingest meets NFR-SCL-04
R4Learning and scaleLMS (mandatory courses, completion, certificates), advanced analytics (custom reports, scheduled delivery at scale), dedicated-cell automation, accounting/ERP API connectorsDedicated cell provisioned in < 1 day without manual steps

Decisions that reconcile source documents.

  1. Accounting integration: a payroll journal file export (CSV and Tally XML) is in R2 (architecture.md §16); API connectors to Zoho Books and ERPs are in R4 (CONVENTIONS.md §7 "accounting/ERP integrations").
  2. TDS: the TDS engine with regime choice, IT declarations and proof submission is R1 (CONVENTIONS.md §7; research §21.11 notes Spryple shows "IT Declaration" in its menu). Form 16 and 24Q return data are R2.
  3. Attendance capture: R1 has web punch, mobile punch with selfie + geo-fence, and biometric CSV/API import. The device push gateway, kiosk mode and face verification are R2.
  4. Approvals: R1 supports up to two levels with delegation, conditions and escalation; arbitrary N levels (max 5) arrive in R2 (research §18).

6. Shared concepts used by all modules​

These concepts are specified once here and referenced by module requirements.

6.1 Typed, effective-dated policies​

A policy is a typed configuration object (JSON-schema validated, architecture.md §2.2) with versions. Each version has valid_from, an optional valid_to, a status (draft, active, retired) and a change note. A policy assignment links a policy to employees through applicability rules evaluated on the employee's effective job assignment: location, department, designation, grade, employment type, and optionally a named employee list.

ConceptRule
ResolutionFor an employee on a date, the engine picks the assignment with the highest specificity (named list > designation > grade > department > location > employment type > tenant default). Ties are a validation error at save time.
DefaultEvery policy type has exactly one tenant-default assignment, so every employee always resolves to a policy.
ChangeEditing an active policy creates a new version with a chosen valid_from. If valid_from is in a period that is not locked, affected days and balances are recomputed. Locked periods are never changed; differences flow as arrears or adjustments (FR-PAY-040, FR-LVE-022).
PreviewBefore activation the UI shows the number and list of affected employees and, for attendance and leave, the number of days or balances that will be recomputed.
Policy types (R1)password_policy (IAM), attendance_policy, shift, geofence, overtime_policy, regularization_policy (ATT), leave_policy per leave type, holiday_calendar (LVE), probation_notice_policy (EMP), pay_schedule, salary_structure, statutory_settings, payroll_policy (PAY), approval_workflow (NTF)

6.2 Standard request lifecycle​

All employee requests (attendance request, regularization, permission, shift change, leave, leave cancellation, comp-off, optional holiday, advance salary, IT declaration, claim, separation, timesheet) use the same base state machine, generalised from Spryple's approval pattern [Observed] (research SP-X-03).

  • On-behalf requests: a user with the approve permission for the employee at the required scope may raise a request on the employee's behalf. It is auto-approved at that user's level and below, records raised_by and a mandatory reason, and notifies the employee. Higher levels, if configured, still apply. Spryple auto-approves all on-behalf requests [Observed] (research SP-X-04); we add the reason, audit and higher-level check [Proposed].
  • Locked periods: a request that touches a date inside a locked attendance/payroll period is blocked, or becomes an adjustment request that flows to the next open period (ATT and PAY define which).
  • Delegation: an approver can delegate for a date range; the delegate's actions are recorded "on behalf of".

6.3 Audit, explainability and identifiers​

  • Every create/update/delete and every approval writes an audit_event (actor, on-behalf-of, tenant, entity, before/after hash, IP, device, timestamp) (architecture.md §7).
  • Computed records (day status, balance, payroll line) store their inputs and policy version IDs, so the UI can show "how calculated".
  • Human-readable IDs are per tenant and sequence-safe: employee code (configurable pattern, FR-ORG-004), request numbers REQ-{MOD}-{YYYY}-{NNNNN}, claim ID CLM-{YYYY}-{NNNNN}, payroll run PR-{YYYYMM}-{NN}.

6.4 Masters pattern​

All masters (departments, designations, leave types, expense categories, pipeline stages and so on) share one behaviour, generalised from Spryple [Observed] (research SP-X-01): create, edit, Active/Inactive, case-insensitive duplicate-name rejection, and deactivation that requires reassignment of linked active records. We add bulk reassignment, CSV import/export, and a "used by" count [Proposed].


7. Module specifications​

Modules appear in CONVENTIONS.md §3 order. Each module has the same sub-sections. FR tables use the columns ID · Requirement · Priority · Release · Label.

7.1 PLT — Platform & Tenant Administration (control plane)​

Traces to: BR-PLT-* · Release: R0 core, R1 billing and lifecycle, R2/R4 dedicated cells · Architecture: architecture.md §3–§5, §9, §14, §15

7.1.1 Purpose and scope​

PLT is the control plane that Spyrl staff use to provision, configure, bill, support and upgrade tenants. Tenants see only a small part of it: their plan, usage, invoices, support-access log and data export.

In scopeOut of scope
Tenant registry and lifecycle; self-serve trial; plans, entitlements and add-ons; feature flags; cell registry and placement; statutory pack publishing; metering and billing; break-glass support access; tenant export and deletion; platform announcements; health scores; custom domains; dedicated cellsReseller/partner portal (post-R4); multi-region outside India; on-premise installs (architecture.md §10.2)

7.1.2 Reference product summary​

  • Spryple's "Super Admin" is a tenant role (company owner), not a platform operator; the control plane is not exposed [Inferred] (research §3.2).
  • Every Spryple login asks for a Company Code, which implies a shared multi-tenant deployment [Observed] (research SP-X-10); a self-serve trial exists at trial.spryple.com [Observed] (research §21.1).
  • Onboarding is vendor-assisted: "the implementation team will provide the suggested Excel sheet" [Observed] (M: Attendance Management).

7.1.3 What we change and why [Proposed]​

  • A separate control plane with its own database is the system of record for tenants, plans, cells and flags (ADR-004), so tenant operations never require database access in the app plane.
  • Self-serve provisioning in under 2 minutes, so trials do not depend on an implementation team.
  • Statutory rates are published centrally as a versioned pack that each tenant inherits, so a PT slab change reaches every tenant once, with a change log.
  • Support access is consented, time-boxed and visible to the tenant, replacing informal vendor access.

7.1.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-PLT-001Maintain a tenant registry with id, slug, company_code, legal name, plan, cell, region and status trial → active → past_due → suspended → churned → deleted; every status change is audited with actor and reason.MustR0[Proposed]
FR-PLT-002Self-serve sign-up (company name, owner name, work email, mobile with OTP, employee-count band, slug) provisions a tenant in a pooled cell in < 2 minutes: tenant row, seeded reference data (statutory pack, role templates, leave-type templates, notification templates), owner invite. Provisioning is idempotent and resumable.MustR0[Proposed]
FR-PLT-003Slugs are unique, 3–30 lowercase alphanumeric/hyphen characters, immutable after creation; a rename creates an alias that redirects. The company code for mobile login is a separate, human-friendly alias that can be changed by the owner.MustR0[Proposed]
FR-PLT-004Plans (Lite, Standard, Professional, Enterprise) and add-ons (Field Force, Timesheets, LMS, Face verification, WhatsApp) are defined as entitlement sets feature_key → limit. Tenant overrides are allowed. The app checks entitlements through a cached SDK (TTL ≤ 60 s). Disabled modules are hidden from navigation and their APIs return 403 entitlement_required.MustR0[Proposed]
FR-PLT-005Plan limits are soft: warn the owner at 90% and 100% of the employee limit; block creation of new active employees above 105%. Payroll processing, payslip access and statutory exports are never blocked for billing reasons between the 25th and the 5th without platform_admin approval.MustR1[Proposed]
FR-PLT-006Feature flags (OpenFeature-compatible) per tenant, cell, plan or percentage, including kill switches. Flag changes are audited and take effect in ≤ 60 s.MustR0[Proposed]
FR-PLT-007Cell registry (type pooled/dedicated, region, version, wave, capacity metrics) and tenant placement by plan and capacity rules (architecture.md §13 capacity triggers).MustR0[Proposed]
FR-PLT-008Move a tenant between cells with a logical export/import by tenant_id, row-count and checksum verification, and a routing cut-over; read-only window ≤ 30 minutes for a 1,000-employee tenant.ShouldR2[Proposed]
FR-PLT-009Publish a statutory pack: versioned, effective-dated reference data (EPF/EPS/EDLI rates and wage ceilings, ESI rates and thresholds, PT slabs by state, LWF by state, income-tax slabs and rebates by tax year and regime, gratuity ceiling, minimum wages where loaded). Tenants inherit the latest pack by default; a tenant may pin a version for a run with a reason. Payroll managers see a change log and an in-app banner when a new pack affects their states.MustR0[Proposed]
FR-PLT-010Daily usage metering per tenant: max active employees, GPS-tracked users, face-enrolled employees, SMS and WhatsApp counts, storage GB. Tenants see their own usage on a Billing page.MustR1[Proposed]
FR-PLT-011Billing through Razorpay Subscriptions: PEPM pricing with plan minimums, add-ons and metered usage; GST-compliant invoices; payment methods UPI AutoPay, cards, e-mandate; dunning with a 7-day grace banner, then suspended (read-only, payroll export still allowed).MustR1[Proposed]
FR-PLT-012Break-glass support access: a support_engineer requests access with a ticket reference and reason; scope read-only by default, write only with owner consent; time-box default 2 h, max 8 h; when the plan requires it, the tenant owner must consent in-app; every action is audited and listed in the tenant's Support access log.MustR0[Proposed]
FR-PLT-013Tenant data export on demand by org_owner: all entities as CSV/JSON plus a documents zip, delivered as an expiring link (24 h) and audited.MustR1[Proposed]
FR-PLT-014Tenant deletion: request by owner or after churn; grace period per contract (default 30 days, max 90); legal hold blocks deletion; deletion removes data from the database and object storage and issues a deletion certificate. Statutory payroll records are exported to the owner before deletion.MustR1[Proposed]
FR-PLT-015Platform announcements (in-app banner and email) targeted by plan, cell or tenant, with schedule and dismissal.ShouldR1[Proposed]
FR-PLT-016Tenant health score from activation (setup completion), adoption (DAU/MAU, punches per employee) and risk (failed runs, open tickets, past-due), shown on the platform console.ShouldR1[Proposed]
FR-PLT-017Platform admin console with platform roles (platform_admin, support_engineer, billing_admin, release_manager), mandatory MFA and IP allow-listing.MustR0[Proposed]
FR-PLT-018Rollout management: cell versions, waves, maintenance windows, per-tenant release notes; the payroll-window change freeze (25th–5th) is enforced for payroll-impacting flags.ShouldR1[Proposed]
FR-PLT-019Custom domain for Enterprise tenants: CNAME + TXT verification, automatic TLS, health check.ShouldR2[Proposed]
FR-PLT-020Dedicated-cell provisioning (own database on a shared app tier, or full stack) through Terraform modules with the same seed steps; assisted in R2, fully automated in < 1 day in R4.Should (R2) / Must (R4)R2/R4[Proposed]
FR-PLT-021Sandbox tenant for Enterprise: a copy of configuration (no personal data) refreshed on request.CouldR2[Proposed]
FR-PLT-022Optional sample data at trial creation (fictional employees, one month of punches), removable with one action before go-live.CouldR1[Proposed]

7.1.5 Key entities​

tenant (id, slug, company_code, legal_name, plan_id, cell_id, region, status, trial_ends_at), plan, entitlement (feature_key, limit), tenant_override, cell (type, region, version, wave, dsn_ref), feature_flag, statutory_pack (version, published_at, effective_from, items[]), usage_daily (tenant, metric, value, date), subscription, invoice, support_access_grant (engineer, reason, scope, starts, ends, consented_by), tenant_export, deletion_request.

7.1.6 Configuration settings​

SettingTypeDefaultNotes
trial.length_daysinteger 7–6014Per plan
limits.employee_soft_pctinteger105Hard block above this
support.consent_requiredbooleantrue for Professional/EnterpriseOwner consent before write access
support.max_grant_hoursinteger 1–82
deletion.grace_daysinteger 30–9030Contract-dependent
statutory_pack.auto_inheritbooleantrueIf false, owner accepts each pack

7.1.7 User stories​

US-PLT-01 — Self-serve trial. As a prospective org_owner, I want to create a trial without talking to sales, so that I can evaluate Spyrl today.

  • AC1: Given a unique slug and a verified mobile OTP, when I submit the sign-up form, then a tenant is provisioned and I receive an activation link by email within 2 minutes.
  • AC2: Given a slug already in use, when I type it, then the form shows "This address is taken" with three suggestions before I submit.
  • AC3: Given provisioning fails half-way, when the job retries, then no duplicate tenant, role or seed rows exist.

US-PLT-02 — Consented support access. As an org_owner, I want to approve and see every support access to my data, so that I stay in control.

  • AC1: Given a support request for write access, when I approve it in-app, then the grant starts with the requested scope and ends automatically at its expiry.
  • AC2: Given an active grant, when the engineer views an employee record, then the Support access log shows the engineer, time, entity and action within 1 minute.
  • AC3: Given I revoke a grant, when the engineer makes the next request, then it is denied.

US-PLT-03 — Statutory pack update. As a payroll_manager, I want new PT slabs to apply from their effective date, so that I do not edit rates by hand.

  • AC1: Given a pack with new Karnataka PT slabs effective 1 April, when it is published, then runs for periods from April use the new slabs and runs for March use the old ones.
  • AC2: Given the pack affects a state where my tenant has employees, when I open Payroll, then a banner links to the change log.

US-PLT-04 — Plan limit. As an hr_manager, I want a clear warning before I hit my plan's employee limit, so that onboarding is not blocked by surprise.

  • AC1: Given 100% of the limit is reached, when I add a new hire, then I see a warning and the hire is saved.
  • AC2: Given 105% is reached, when I try to activate another employee, then the action is blocked with "Upgrade plan or deactivate employees", and payroll actions remain available.

US-PLT-05 — Tenant export. As an org_owner, I want to export all my data, so that I can leave or audit freely.

  • AC1: Given I request an export, when it completes, then I receive a link valid for 24 h containing CSV/JSON for every module and a documents zip, and the request is audited.

7.1.8 Permissions​

ActionPLASUPbilling_adminrelease_managerOWNOthers
Create/suspend/delete tenant✓—suspend for dunning—request deletion (own)—
Change plan / overrides✓—✓—upgrade self-serve (own)—
Feature flags✓——✓——
Publish statutory pack✓ (two-person approval)———view / pin (own)PRM, FNA view
Break-glass accessapprove policyrequest——consent / revoke / view log—
Billing & invoices✓—✓—view / pay (own)—
Tenant export✓———✓ (own)—

7.1.9 UI/UX​

  • Platform console (web only): Tenants list (search by slug, name, owner email; filters by plan, status, cell), Tenant detail (plan, usage, health, flags, support grants, invoices), Cells, Flags, Statutory packs (diff view between versions), Announcements.
  • Tenant side: Settings → Subscription (plan, usage vs limits, invoices, payment method), Settings → Support access (pending requests, active grants, log), Settings → Data export.
  • Empty/error states: a suspended tenant sees a full-width read-only banner with "Pay now"; a failed payment shows the retry date; an export in progress shows progress and an email-on-ready note.

7.1.10 Notifications and automation​

Trial ending (7, 3, 1 days before), payment failed, suspension notice, support-access request and expiry, statutory pack published, export ready, deletion scheduled and completed. See the catalogue in §12.

7.1.11 Reports and analytics​

Platform: MRR, active tenants by plan, PEPM revenue, trial conversion, health-score distribution, usage by metric. Tenant: usage vs limits, invoice history, support access log.

7.1.12 Edge cases​

  • Owner email bounces during sign-up → the tenant stays trial_pending; OTP-verified mobile can resend the invite by SMS.
  • Payment fails on the 26th (payroll window) → suspension is deferred to the 6th; a banner warns from day 1.
  • A statutory pack is published with an error → platform_admin publishes a corrective version with the same effective date; runs that are calculated but not locked are flagged "recalculate"; locked runs are never changed automatically.
  • A tenant at its limit imports 50 hires → the dry-run reports how many will be blocked before commit.

7.2 ORG — Organisation Setup & Masters​

Traces to: BR-ORG-* · Release: R0 (masters, policy framework, import framework), R1 (legal entities, setup wizard, custom fields)

7.2.1 Purpose and scope​

ORG holds the tenant's structure (company, legal entities, locations, departments, designations, grades, employment types, cost centres, holiday calendars) and three shared frameworks that every module uses: the policy framework (§6.1), the data import framework and custom fields.

In scopeOut of scope
Company profile and branding; legal entities and statutory registrations; locations with geo point and employee-code pattern; departments (hierarchy), designations, grades, employment types, cost centres; holiday calendars; policy framework; import framework; custom fields; setup wizard and go-live readiness; org chartPosition management and headcount budgeting (post-R4); multi-country entities

7.2.2 Reference product summary​

  • Company information, departments and designations with Active/Inactive and no duplicates; departments cannot be inactivated until employees are transferred out [Observed] (A: Employee Management; SP-ORG-01..03).
  • Work locations carry address, branch short code, map picker and a prefix + seed for employee-ID generation; the same prefix and seed share one sequence [Observed] (SP-ORG-04). Employee IDs look like "NE13", "TNK1" [Observed] (research §21.2).
  • Company logo jpg/png ≤ 1 MB [Observed] (SP-ORG-05). Holidays by branch, date, type Public/Optional, name, with no duplicate date per branch [Observed] (SP-ORG-06).
  • Optional department↔designation mapping (Rule 36) [Observed] (SP-ORG-07). ESI numbers are configured state-wise [Observed] (SP-PAY-03).
  • No custom fields, no bulk reassignment and no legal-entity concept are documented [Inferred] (research §4.5, §20 Q8).

7.2.3 What we change and why [Proposed]​

  • Legal entities with PAN, TAN and statutory registrations, because EPF establishment codes, PT registrations and TAN (for TDS and Form 16) belong to an employer entity, not a branch.
  • Policy framework with applicability and effective dating (§6.1) instead of numbered rules.
  • Import framework with versioned templates, dry-run and row-level errors, so customers can self-migrate.
  • Custom fields and bulk reassignment remove two common reasons for vendor customisation.

7.2.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-ORG-001Company profile: legal name, display name, logo (jpg/png/svg ≤ 1 MB), registered address, industry, default time zone (Asia/Kolkata), financial year (Apr–Mar fixed for payroll), leave cycle default (Jan–Dec or Apr–Mar).MustR0[Observed] SP-ORG-01/05 + [Proposed]
FR-ORG-002Legal entity with PAN, TAN, optional GSTIN, EPF establishment code, ESI employer code per state, PT registration per state, LWF registration per state, Shops & Establishment registration, authorised signatory (name, designation, signature image for Form 16 and letters). Every tenant has at least one.MustR1[Proposed]
FR-ORG-003Multiple legal entities per tenant; each employee belongs to exactly one legal entity at a time (effective-dated); payroll runs and statutory files are per legal entity.ShouldR1[Proposed]
FR-ORG-004Locations: name, branch code, legal entity, address, state (drives PT/LWF/holidays), PIN, geo point (map picker or search), time zone, status.MustR0[Observed] SP-ORG-04 + [Proposed]
FR-ORG-005Employee code generator: pattern with tokens {PREFIX}, {SEQ:n}, {YY}; sequence scope ORG, LEGAL_ENTITY or LOCATION; concurrency-safe and unique per tenant; codes are never reused; an HR user may override a code on create if it is unique.MustR0[Observed] SP-ORG-04 + [Proposed]
FR-ORG-006Departments as a hierarchy (parent, head employee, cost centre); designations; grades/bands (optional); employment types (seeded: Permanent, Probation, Contract, Fixed-term, Intern, Consultant, Apprentice).MustR0[Observed] SP-ORG-02/03 + [Proposed]
FR-ORG-007Department↔designation mapping as an optional setting that restricts designation choices in forms.CouldR1[Observed] SP-ORG-07
FR-ORG-008Cost centres master, assignable to departments and employees (effective-dated), used by the payroll journal.ShouldR1[Proposed]
FR-ORG-009Masters pattern for every master (§6.4): duplicate-name rejection, Active/Inactive, deactivation blocked while active links exist, bulk reassignment wizard, "used by" count, CSV import/export.MustR0[Observed] SP-X-01 + [Proposed]
FR-ORG-010Holiday calendars: named calendars assigned to locations; holiday date, name, type (Public, Optional/Restricted), optional half-day; duplicate dates per calendar rejected; copy a calendar to next year; changes trigger recomputation of unlocked attendance and leave durations.MustR0[Observed] SP-ORG-06 + [Proposed]
FR-ORG-011Policy framework: register policy types with JSON schemas; versions with valid_from/valid_to; assignment by applicability with specificity resolution; impact preview; one tenant default per type; generated forms and help text from the schema.MustR0[Proposed]
FR-ORG-012Data import framework: downloadable versioned Excel/CSV templates per entity; upload → validate → dry-run report (row, column, error, suggestion) → commit; idempotent by natural key; a committed batch can be rolled back within 24 h if no dependent records were created. Max 10,000 rows per file.MustR0[Observed] SP-EMP-10/SP-ATT-14 + [Proposed]
FR-ORG-013Custom fields for Employee (R1), and later Location, Claim, Client (R2/R3): types text, number, date, single/multi-select, boolean, file; required flag; section placement; visibility and edit permission per role; included in import templates and the report builder. Max 50 per entity.ShouldR1[Proposed]
FR-ORG-014Setup wizard with ordered steps (company → legal entity → locations → departments/designations → holidays → attendance policy → leave types → salary structure → statutory settings → import employees → invite users) and a go-live readiness score with blocking items (e.g. "No salary structure assigned to 12 employees").MustR1[Proposed]
FR-ORG-015Branding: logo, primary colour (contrast-checked against WCAG AA), login background, email sender display name.ShouldR1[Proposed]
FR-ORG-016Org chart view from reports_to, filterable by department and location, with search; export as PNG/PDF.ShouldR1[Proposed]
FR-ORG-017Tenant label overrides for selected terms (e.g. "Comp-off" → "Compensatory leave"), applied in UI and notification templates.CouldR2[Proposed]
FR-ORG-018Industry starter templates (Office, Factory with shifts, Retail, Field sales) that pre-fill policies and masters in the setup wizard.CouldR1[Proposed]

7.2.5 Key entities​

company, legal_entity (pan, tan, gstin, epf_code, signatory), statutory_registration (entity, type EPF/ESI/PT/LWF/SE, state, number), location (code, entity, state, geo, tz, code_pattern), department (parent, head, cost_centre), designation, grade, employment_type, cost_centre, holiday_calendar, holiday (calendar, date, name, type, half_day), policy, policy_version (schema_id, payload, valid_from, valid_to, status), policy_assignment (rule, specificity), custom_field_def, import_batch (template_version, status, rows, errors).

7.2.6 Configuration settings​

SettingTypeDefault
employee_code.patternstring with tokens{PREFIX}{SEQ:4}
employee_code.scopeenum ORG / LEGAL_ENTITY / LOCATIONLOCATION
leave_cycleenum JAN_DEC / APR_MARJAN_DEC
designation_mapping.enforcedbooleanfalse
import.max_rowsinteger10,000
import.rollback_window_hoursinteger 0–7224

7.2.7 User stories​

US-ORG-01 — Location-based employee codes. As an hr_admin, I want each branch to have its own employee-code sequence, so that codes show the branch.

  • AC1: Given location "Kukatpally" with prefix "KP" and seed 1 and scope LOCATION, when two HR users create hires there at the same time, then the codes are KP0001 and KP0002 with no duplicate.
  • AC2: Given a hire is created and then deleted as a draft, when the next hire is created, then the deleted code is not reused.

US-ORG-02 — Effective-dated policy change. As an hr_admin, I want to change the late-grace minutes from 1 November for all employees, so that the change applies to existing staff too.

  • AC1: Given an attendance policy assigned to 240 employees, when I create a new version effective 1 November, then the preview shows 240 employees and the number of unlocked days that will be recomputed.
  • AC2: Given October is locked, when I set valid_from to 15 October, then the save is blocked with "15–31 Oct is in a locked period; choose 1 Nov or later, or unlock the period".

US-ORG-03 — Employee import with dry-run. As an hr_manager, I want to import 300 employees from Excel and see errors before anything is saved.

  • AC1: Given a file with 3 invalid PANs and 1 unknown department, when I run the dry-run, then I see 4 row errors with column names and suggestions and nothing is committed.
  • AC2: Given a clean file, when I commit, then 300 employees are created, and re-uploading the same file creates no duplicates.

US-ORG-04 — Deactivate a department. As an hr_admin, I want to deactivate a department and move its people in one step.

  • AC1: Given a department with 14 active employees, when I deactivate it, then a reassignment wizard asks for the target department and an effective date, and the deactivation completes only after the reassignment.

US-ORG-05 — Go-live readiness. As an org_owner, I want to know what is missing before my first payroll.

  • AC1: Given 12 active employees without a compensation record, when I open the setup checklist, then the readiness score lists "12 employees have no salary" as a blocking item with a link to fix it.

7.2.8 Permissions​

ActionOWNHRAHRMFNAPRMLMEMPAUD
Company profile, brandingORGORGORG(R)ORG(R)ORG(R)——ORG(R)
Legal entities, statutory registrationsORGORG(R)ORG(R)ORGORG(R)——ORG(R)
Locations, departments, designations, gradesORGORGLOC*(R)ORG(R)ORG(R)TEAM(R)own (R)ORG(R)
Holiday calendarsORGORGLOC*—ORG(R)TEAM(R)own (R)ORG(R)
Policies (create/version/assign)ORGORG (non-payroll)ORG(R)ORG (payroll)ORG(R)—own policy (R)ORG(R)
ImportsORGORGLOC*ORG (pay data)ORG (pay data)———
Custom field definitionsORGORG—————ORG(R)

7.2.9 UI/UX​

  • Web: Settings hub grouped as Organisation, People, Time, Pay, Notifications, Security, Integrations. Each master is a table with inline add/edit, status chips and a "used by" column. Policies use generated forms with a version timeline and a diff between versions. Imports use a 4-step stepper (Download template → Upload → Review errors → Commit).
  • Mobile: read-only holiday list and company policies for employees.
  • Empty states: "No locations yet. Add your first location to start punching." with the primary action; an import with errors shows a downloadable error file.
  • Errors: duplicate name shows inline "A department named 'Sales' already exists (inactive). Reactivate it?".

7.2.10 Notifications and automation​

Import completed/failed (to the uploader), policy version activated (to HR admins), holiday calendar changed (to affected employees, optional), readiness score blocking items (weekly digest during trial).

7.2.11 Reports and analytics​

Masters export; headcount by location/department/designation (in RPT); policy assignment report ("which policy applies to whom on date X"); import history.

7.2.12 Edge cases​

  • A location changes state (rare, e.g. office move) → create a new location; PT/LWF follow the employee's effective location.
  • Two policy assignments with equal specificity match one employee → rejected at save with the list of conflicting employees.
  • A holiday is added for a past, unlocked date where employees were marked absent → their days are recomputed to H, and LOP is reversed.
  • The employee-code pattern is changed → applies only to new codes; existing codes are unchanged.

7.3 IAM — Identity, Access & Security​

Traces to: BR-IAM-* · Release: R0 (auth, roles, audit), R1 (SSO, device binding, privacy centre), R2 (SAML, API clients) · Architecture: architecture.md §6, §7

7.3.1 Purpose and scope​

IAM authenticates users, authorises every action as a pair (permission, scope), protects sensitive fields, records the audit trail and implements privacy rights (consent, data-subject requests).

In scopeOut of scope
Invite activation; password, OTP and MFA; OIDC/SAML SSO; sessions and devices; roles, permissions, scopes; field-level protection; segregation of duties; audit log; consent records and DPDP requests; API clientsCustomer identity for end-customers of tenants; hardware tokens (FIDO2 is a future enhancement)

7.3.2 Reference product summary​

  • The admin sets a user ID per employee; the password defaults to "Welcome1!" and is changed after login [Observed] (A: Employee Management; SP-IAM-01). The credentials email contains the URL, Company Code, username and the plaintext password [Observed] (research §21.2).
  • Credentials are created manually after HR emails the Admin when onboarding completes [Observed] (M: Employee Management; SP-IAM-05).
  • "Roles & Permissions" documentation duplicates "Users Login", so the permission model is undocumented [Observed doc defect] (research §17 D1).
  • Password complexity is set through HR Policy Rules 1–9 [Observed] (SP-IAM-03); admin password reset by Location → Department → Employee, with an email to the employee [Observed] (SP-IAM-04).
  • New phones need manager approval in the CRM app [Observed] (M: CRM Field Force Management).

7.3.3 What we change and why [Proposed]​

  • No default or emailed passwords. Users activate through a single-use invite link (72 h) sent automatically when an employee becomes active (fixes the manual hand-off and the plaintext password).
  • A documented role builder: permissions × data scope, seeded templates, cloneable roles.
  • MFA mandatory for admin and payroll roles; SSO on paid plans.
  • Field-level protection and segregation of duties for payroll data.
  • Privacy centre for DPDP consent and data-subject requests.

7.3.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-IAM-001Invite activation: when a user account is created (automatically on employee activation, or manually), send a single-use activation link valid 72 h by email, and by SMS/WhatsApp if only a mobile exists. The user sets a password (and MFA if required). Links can be resent (invalidating the old one) and revoked. No password is ever generated, emailed or shown to administrators.MustR0[Proposed] replaces [Observed] SP-IAM-01
FR-IAM-002Login on web at {slug}.spyrl.app with email, username or mobile + password; on mobile with company code once, then the same credentials. Generic error messages that do not reveal whether a user exists.MustR0[Observed] SP-X-10 + [Proposed]
FR-IAM-003Typed password_policy: min length (8–64, default 10), character classes (default: any 3 of 4), history (default 5), optional expiry (default off), breached-password check against a k-anonymity list, argon2id hashing.MustR0[Observed] SP-IAM-03 Rules 1–9 redesigned
FR-IAM-004Brute-force protection: CAPTCHA after 3 failures; lock for 15 minutes after 5 failures in 15 minutes (configurable); per-IP and per-account rate limits; lock notification to the user.MustR0[Proposed]
FR-IAM-005Forgot password via email link or SMS OTP (10-minute validity). Admin "reset" sends a reset link; it never sets a password. All sessions are revoked on password change.MustR0[Observed] SP-IAM-04 redesigned
FR-IAM-006TOTP MFA with recovery codes; mandatory for org_owner, hr_admin, finance_admin, payroll_manager and platform roles; optional (or tenant-mandated) for others; MFA reset by org_owner with audit.MustR0[Proposed]
FR-IAM-007OIDC SSO with Google Workspace and Microsoft Entra ID (Standard plan and above); JIT linking only to an existing employee with the same verified email; "SSO only" enforcement per role group, with an owner break-glass password login.MustR1[Proposed]
FR-IAM-008SAML 2.0 SSO (Enterprise).ShouldR2[Proposed]
FR-IAM-009Permission model {module}.{resource}.{action}; a role is a set of permissions; a role assignment is role + scope + optional location/department filters + optional validity dates. Every API endpoint declares its permission.MustR0[Proposed]
FR-IAM-010Seeded role templates for every tenant role in CONVENTIONS.md §4; tenants can clone, edit and create custom roles; seeded originals are read-only and upgradeable by the platform; a role diff view shows permissions added/removed versus the template.MustR0[Proposed]
FR-IAM-011Data scopes SELF, TEAM (direct + indirect reports to a configurable depth, default unlimited), DEPARTMENT, LOCATION, ORG. TEAM is derived from the effective reports_to hierarchy and is never assigned manually.MustR0[Proposed]
FR-IAM-012Field-level protection for sensitive classes (compensation, bank, Aadhaar, PAN, health, biometric): masked in lists, exports and APIs unless the user has *.sensitive.read; an explicit "reveal" action is audited. Aadhaar shows only the last 4 digits everywhere except to emp.aadhaar.read.MustR0[Proposed]
FR-IAM-013Segregation of duties: a user can never approve their own request; optional tenant rule that the person who changed compensation or payroll inputs in a run cannot approve that run (FR-PAY-052).MustR1[Proposed]
FR-IAM-014Sessions: access token 15 min, rotating refresh token with reuse detection; web idle timeout (default 30 min, 5–480) and absolute lifetime (default 12 h); mobile refresh lifetime (default 30 days) with optional device biometric unlock; users and admins can list and revoke sessions.MustR0[Proposed]
FR-IAM-015Mobile device binding: the first login registers the device; when device_approval.required is on, a new device needs line-manager (or HR) approval before punches are accepted; remote sign-out and device block.MustR1[Observed] FFM device approvals + [Proposed]
FR-IAM-016Append-only audit log of all writes, approvals, sensitive reads, logins, permission changes and support access; viewer with filters (actor, entity, module, date); CSV export; retention per data class (payroll 8 years, others 3 years minimum).MustR0[Proposed]
FR-IAM-017Automatic access changes on lifecycle events: disable login at the last working day 23:59 location time; revoke admin roles on transfer if the role assignment is location-bound; re-enable on rehire only through a new invite.MustR1[Proposed]
FR-IAM-018Privacy centre: consent records per purpose (location at punch, continuous field tracking, face verification), shown to the employee with withdraw option; withdrawal disables the related feature for that employee and offers an alternative punch method.MustR1[Proposed]
FR-IAM-019Data-subject requests (access, correction, erasure, grievance): raised by employees, tracked with SLA (default 30 days, configurable, verify with counsel), fulfilled with an export or a correction workflow; erasure respects statutory retention and records the legal basis for retained data.MustR1[Proposed]
FR-IAM-020Security notifications: new-device login, password changed, MFA reset, role granted.ShouldR1[Proposed]
FR-IAM-021Admin access review report (users with admin/payroll permissions, last login, MFA status) with a quarterly reminder to the owner.ShouldR2[Proposed]
FR-IAM-022IP allow-list for admin and payroll roles (Professional+).CouldR2[Proposed]
FR-IAM-023OAuth2 client-credentials API clients bound to one tenant, with scopes, rotation and revocation (for the public API).MustR2[Proposed]
FR-IAM-024"View as employee" impersonation by tenant admins.Won't—[Proposed] (security risk; use the role preview instead)
FR-IAM-025Role preview: an admin can preview which menus and actions a role sees, without impersonating a real user.ShouldR1[Proposed]

7.3.5 Key entities​

user (tenant, employee_id, login identifiers, status), credential (argon2id hash, history), mfa_factor, invite (token hash, channel, expires_at, used_at), session, device (platform, model, push token, status, approved_by), permission, role (seeded flag, template version), role_permission, role_assignment (role, scope, filters, valid_from, valid_to), audit_event, consent_record (purpose, version, given_at, withdrawn_at), dsar_request, api_client.

7.3.6 Configuration settings​

SettingTypeDefault
password_policy.*typed policysee FR-IAM-003
mfa.mandatory_roleslist of role keysadmin and payroll roles
session.web_idle_minutesinteger 5–48030
session.mobile_refresh_daysinteger 1–9030
device_approval.requiredbooleanfalse (true recommended for field teams)
device_approval.approverenum LINE_MANAGER / HRLINE_MANAGER
sso.enforced_forlist of role keysnone
sod.payroll_editor_cannot_approvebooleantrue
team_scope.depthinteger or unlimitedunlimited

7.3.7 User stories​

US-IAM-01 — Activation without default passwords. As a new employee, I want to set my own password from a link, so that nobody else ever knows it.

  • AC1: Given HR activates my employee record, when activation completes, then I receive an activation link by email (or SMS if I have no email) within 60 s.
  • AC2: Given the link is older than 72 h or already used, when I open it, then I see "This link has expired" and a button to request a new one from HR.
  • AC3: Given any admin views my user record, then no password or password hint is shown anywhere.

US-IAM-02 — Mandatory MFA for payroll. As an org_owner, I want everyone who can see salaries to use MFA.

  • AC1: Given a user is granted payroll_manager, when they next log in, then they must enrol TOTP before reaching any screen.
  • AC2: Given a user loses their phone, when they use a recovery code, then they log in and are prompted to re-enrol, and the event is audited.

US-IAM-03 — Custom role. As an hr_admin, I want a "Plant HR" role that can manage attendance only for Plant 1.

  • AC1: Given I clone hr_manager, remove payroll permissions and assign it with scope LOCATION = Plant 1, when the user opens Attendance, then only Plant 1 employees are listed.
  • AC2: Given the same user calls the API for a Plant 2 employee, then the response is 403 and the denial is audited.

US-IAM-04 — New device approval. As a line_manager, I want to approve a field executive's new phone, so that buddy punching from another phone is prevented.

  • AC1: Given device_approval.required is on, when my team member logs in on a new phone, then punches from that phone are rejected with "Device pending approval" and I get a push notification.
  • AC2: When I approve, then the old device is signed out and punches from the new phone are accepted.

US-IAM-05 — Withdraw location consent. As an employee, I want to withdraw consent for location capture.

  • AC1: Given my attendance policy requires geo-fenced punch, when I withdraw location consent, then the app explains that I must punch on the kiosk or biometric device, and HR is notified to assign an alternative method.

US-IAM-06 — Sensitive field reveal. As an hr_manager without salary permission, I want to see the employee list without salary data.

  • AC1: Given I export the employee list, when the file is generated, then compensation and bank columns are absent or masked.
  • AC2: Given a payroll_manager reveals an account number, then the reveal is written to the audit log.

7.3.8 Permissions​

ActionOWNHRAHRMFNAPRMLMEMPAUD
Invite / resend / revoke userORGORGLOC*—————
Reset password link / MFA resetORGORG (not OWN)LOC* (link only)———SELF—
Manage roles and assignmentsORGORG (cannot grant OWN or payroll roles)—grant PRM/FNA only with OWN approval———ORG(R)
Approve deviceORGORGLOC*——TEAM——
View audit logORGORG (non-payroll)—ORG (payroll)ORG (payroll, R)—own activityORG(R)
Consent and DSARhandle ORGhandle ORGhandle LOC*———SELF (raise, withdraw)ORG(R)
Manage API clientsORGORG——————

7.3.9 UI/UX​

  • Web: login page with tenant branding; activation page with password strength meter; Security settings (password policy, MFA, SSO, sessions, devices); Users & Roles (users list with role chips and MFA status; role editor as a module × action grid with a scope selector; role preview); Audit log; Privacy (consents, requests).
  • Mobile: company-code screen (remembered), login, biometric unlock, device-pending screen, Profile → Privacy with consent toggles and explanations.
  • Error states: locked account shows time remaining; expired link offers "Ask HR to resend"; 403 pages explain which permission is missing ("You need Payroll access for Location Plant 2. Ask your administrator.").

7.3.10 Notifications and automation​

Activation link; activation reminder after 48 h; password changed; new-device login; device pending approval (to approver); MFA enrolment required; consent withdrawn (to HR); DSAR received and due-soon (to HR and owner); quarterly access review (to owner).

7.3.11 Reports and analytics​

Users and roles; MFA coverage; inactive users (no login > 60 days); device list; audit export; DSAR register with SLA status.

7.3.12 Edge cases​

  • An employee has no email and a shared family mobile → activation by SMS to the mobile; HR may hand over activation through the kiosk enrolment flow (R2).
  • A manager leaves and their reports' TEAM scope moves to the new reports_to from its effective date; pending approvals reassign to the new manager (FR-NTF-008).
  • A user holds two roles with different scopes → permissions are the union; scope is evaluated per permission.
  • SSO user's IdP account is disabled but the Spyrl session is valid → refresh fails at the next rotation (≤ 15 min); SCIM deprovisioning is a future enhancement.

7.4 EMP — Core HR & Onboarding​

Traces to: BR-EMP-* · Release: R1 (R2 rehire, R3 identity verification)

7.4.1 Purpose and scope​

EMP is the system of record for people: hire to active employment, the effective-dated job history, personal and statutory identity data, documents, checklists, inductions, probation and self-service profile changes.

In scopeOut of scope
New hires and pre-onboarding; employee profile; effective-dated job assignment (transfer, promotion, re-designation, manager change); documents with approval; onboarding checklists and induction; probation and confirmation; self-service change requests; directory; letters (basic templates); profile auditRecruitment/ATS and offers (post-R4, §15); performance; asset management; separation (EXT, R2)

7.4.2 Reference product summary​

  • New Hire requires First Name, Last Name, Hired On, Joining Date, Designation, Mobile and Emergency Contact; personal email is optional [Observed] (research §21.2; M: Employee Management, SP-EMP-04).
  • A self-onboarding link lets the hire fill personal, contact, family, experience and education details and upload documents [Observed] (SP-EMP-05); the link expires after 24 hours [Observed] (research §21.2).
  • HR completes Joining Formalities (official email, employment type, role, location, designation, department, reporting manager) [Observed] (SP-EMP-06). Profile fields include DOB, blood group, gender, marital status, Aadhaar number, languages, notice period, reporting manager department, residence and permanent address with "same as" [Observed] (research §21.2).
  • Checklists per department, each item with an approver; "No Due" completes the checklist [Observed] (SP-EMP-01/07; research §21.2). Document approval with re-upload loop; HR uploads are auto-approved [Observed] (SP-EMP-08). Induction programs with type, department, conducted by, date/time, status [Observed] (SP-EMP-09; research §21.2).
  • Probation is configured in two places, in months and in days [Observed] (research §17 D4). Promotions are a "Contract/Promotions" tab with no effective-dated job history documented [Inferred] (research §4.5).

7.4.3 What we change and why [Proposed]​

  • Effective-dated job assignments replace a flat profile, so payroll, policies and scopes are correct for any date.
  • Activation triggers the invite automatically (FR-IAM-001); no manual credential step.
  • Self-edit through change requests for sensitive fields (bank, name, PAN), so HR keeps control and has an audit trail.
  • One probation/notice policy (typed, effective-dated) replaces the duplicate settings.
  • A longer, safer pre-onboarding link (7 days, OTP-protected) because 24 h is too short for candidates gathering documents.

7.4.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-EMP-001Create a new hire with required fields First name, Last name, Offer/Hired-on date, Joining date, Designation, Mobile, Emergency contact; optional personal email, middle name, location, department, manager, employment type. The record starts as pre_joining.MustR1[Observed] SP-EMP-04
FR-EMP-002Pre-onboarding link sent by email/SMS; valid until submitted or for preboarding.link_days (default 7, 1–30); each open requires an OTP to the registered mobile/email; the candidate can save drafts and submit once; HR can reopen sections with a comment.MustR1[Observed] SP-EMP-05 + [Proposed]
FR-EMP-003Profile sections: Personal (name parts, preferred name, DOB, gender with inclusive options incl. "prefer not to say", marital status optional, blood group, nationality, languages, photo); Contact (personal email, mobile, residence and permanent address with "same as", emergency contacts); Family and nominees (name, relationship, DOB, dependent flag, nomination % for EPF/gratuity); Education; Experience; Bank (account holder, account number, IFSC with format validation and bank/branch lookup); Identity (PAN, Aadhaar, UAN, ESI IP number, passport, driving licence).MustR1[Observed] research §21.2 + [Proposed]
FR-EMP-004Identity validation: PAN format AAAAA9999A; Aadhaar 12 digits with Verhoeff checksum, stored encrypted and masked; UAN 12 digits; IFSC AAAA0XXXXXX; duplicate PAN/Aadhaar/UAN within the tenant is blocked with a warning naming the existing employee code.MustR1[Proposed]
FR-EMP-005Joining formalities: HR reviews the submission, completes work info and activates the employee on or after the joining date; activation assigns the employee code (FR-ORG-005), creates the user and sends the invite (FR-IAM-001), assigns policies by applicability and creates the onboarding checklist.MustR1[Observed] SP-EMP-06 + [Proposed]
FR-EMP-006Effective-dated job assignment: legal entity, location, department, designation, grade, employment type, reports_to, cost centre, work email, notice period override. Every change has an effective date, a reason (Transfer, Promotion, Re-designation, Manager change, Correction) and a timeline view. Back-dated changes are allowed only into unlocked periods (else they require PAY arrears, FR-PAY-040).MustR1[Proposed]
FR-EMP-007Bulk job changes and bulk profile updates through the import framework (FR-ORG-012) with dry-run.MustR1[Observed] SP-EMP-10 + [Proposed]
FR-EMP-008Employee statuses: pre_joining → active → on_notice → exited; plus inactive (long leave, suspension) and no_show (never joined). Probation is an attribute with start, end and outcome.MustR1[Proposed]
FR-EMP-009Documents: tenant document types (with "required for activation" and "has expiry" flags); upload pdf/jpg/png ≤ 10 MB (virus-scanned); HR approve/reject with reason; email/push on each outcome; re-upload loop; HR uploads auto-approved; expiry reminders 30 days before expiry.MustR1[Observed] SP-EMP-08 + [Proposed]
FR-EMP-010Checklist engine (shared with EXT): templates by type (Onboarding, Offboarding, Custom) and applicability (department, location); items with owner (role or named user), due offset in days, required evidence (none/comment/file); assignment creates tasks; completion of all required items sets the checklist completed ("No Due").MustR1[Observed] SP-EMP-01/07 + [Proposed]
FR-EMP-011Induction programs: type master, department, conducted by, date, start/end time, venue or link, attendees; invite email and calendar file; edit/cancel notifies attendees; attendance marking; shown on the employee home.ShouldR1[Observed] SP-EMP-02/09
FR-EMP-012Typed probation_notice_policy (by applicability): probation length in days or months, notice period in days during and after probation, auto-confirm on/off. Confirmation due list; reminders to line manager and HR 15 days before probation end; actions Confirm / Extend (new end date) / Not confirmed (→ EXT).MustR1[Observed] SP-EMP-03 + Rules 10–15 consolidated
FR-EMP-013Self-service profile: per-field setting self_edit = direct, approval or none. Defaults: photo, languages, emergency contact, address = direct; legal name, DOB, bank, PAN, family/nominees = approval; job fields = none. Change requests go through NTF approval to HR.MustR1[Observed] Rule 34 + [Proposed]
FR-EMP-014Employee directory: search by name, code, phone; filters by location, department, designation, status; card and list views; tenant setting to hide personal mobile numbers from peers.MustR1[Proposed]
FR-EMP-015Profile change history: field, old value (masked if sensitive), new value, effective date, actor, source (UI, import, API, request).MustR1[Proposed]
FR-EMP-016Letter templates (appointment, confirmation, increment, address proof, custom) with merge fields; generate PDF with the signatory from the legal entity; store in documents; send to the employee.ShouldR1[Proposed]
FR-EMP-017Statutory onboarding helpers: capture previous-employer UAN and income (for TDS, linked to FR-PAY-061), EPF opt-out eligibility (Form 11-style declaration fields), ESI family details.MustR1[Proposed]
FR-EMP-018no_show handling: if not activated within N days of joining date (default 7), remind HR; HR marks no-show, which closes the record without creating a user.ShouldR1[Proposed]
FR-EMP-019Rehire: create a new employment linked to the previous record, carrying identity data, with the previous exit's rehire-eligibility flag shown.ShouldR2[Proposed]
FR-EMP-020PAN/Aadhaar/bank verification through third-party APIs (e.g. penny-drop for bank) with consent.CouldR3[Proposed]
FR-EMP-021Contract workers via agency (vendor master, contract dates) without payroll.CouldR2[Proposed]
FR-EMP-022E-sign of letters.Won'tR1[Proposed] (post-R2 candidate)

7.4.5 Key entities​

employee (code, status, personal fields), employment (joining date, exit date, rehire link), job_assignment (effective-dated; entity, location, department, designation, grade, employment_type, reports_to, cost_centre, reason), identity_doc (type, number_enc, last4, verified), bank_account (enc), family_member, nomination, education, experience, document (type, file, status, expiry), checklist_template, checklist_item_template, checklist, task, induction_type, induction_program, induction_attendee, change_request, letter_template, letter.

7.4.6 Configuration settings​

SettingTypeDefault
preboarding.link_daysinteger 1–307
preboarding.sections_enabledlistall
profile.self_edit.<field>enum direct/approval/nonesee FR-EMP-013
directory.show_personal_mobilebooleanfalse
probation_notice_policytyped policyprobation 6 months; notice 15 days in probation, 30 days after
no_show.days_after_joininginteger7
documents.max_mbinteger 1–2510

7.4.7 User stories​

US-EMP-01 — Add a new hire. As an hr_manager, I want to add a hire with the minimum fields and send a pre-onboarding link.

  • AC1: Given the required fields are filled, when I save, then the hire appears under Pre-joining and a link is sent to the mobile (and email if given).
  • AC2: Given the PAN entered matches an active employee, when I save, then I see "PAN already used by KP0012 (active)" and cannot save without changing it.

US-EMP-02 — Self-onboarding. As a candidate, I want to fill my details on my phone over several days.

  • AC1: Given a valid link, when I open it, then I must enter an OTP sent to my mobile.
  • AC2: Given I saved a draft yesterday, when I reopen the link, then my data is still there.
  • AC3: Given I submit, when HR reopens the Bank section with a comment, then I get a notification and only that section is editable.

US-EMP-03 — Activate on joining. As an hr_manager, I want activation to set up everything the employee needs on day one.

  • AC1: Given work info is complete and the joining date is today, when I activate, then the employee code is generated, the attendance, leave and payroll policies resolve, the onboarding checklist is created and the activation link is sent.
  • AC2: Given a required document type is missing, when I activate, then I am warned and can proceed only if documents.block_activation is off.

US-EMP-04 — Promotion with effective date. As an hr_manager, I want to record a promotion effective 1 October with a new manager.

  • AC1: Given the employee's October attendance is unlocked, when I save the change effective 1 October, then the new designation, manager and resolved policies apply from 1 October, and pending approvals raised from 1 October move to the new manager.
  • AC2: Given September payroll is locked, when I set the effective date to 15 September, then I am told that compensation effects will be paid as arrears in the next run.

US-EMP-05 — Bank change request. As an employee, I want to change my salary account.

  • AC1: Given bank details need approval, when I submit the new account and a cancelled-cheque image, then HR gets an approval task and my old account stays active until approval.
  • AC2: Given approval happens after the payroll run is Approved, then the new account applies from the next run and I am told so.

US-EMP-06 — Probation confirmation. As a line_manager, I want a reminder before my report's probation ends.

  • AC1: Given probation ends on 30 November, when it is 15 November, then I and HR get a reminder with Confirm/Extend/Not confirmed actions.
  • AC2: When I choose Extend by 60 days, then the end date updates, the notice-period policy for probation continues, and the employee is notified.

US-EMP-07 — Onboarding checklist. As an IT owner of a checklist item, I want my task to appear in my inbox.

  • AC1: Given the "Laptop issued" item is owned by the IT department head, when the checklist is created, then the task appears in their inbox with a due date of joining date + 1.
  • AC2: When all required items are done, then the checklist shows Completed and the employee sees it on their home screen.

7.4.8 Permissions​

ActionOWNHRAHRMFNAPRMLMEMPAUD
Create hire / activateORGORGLOC*—————
View profile (non-sensitive)ORGORGLOC*ORGORGTEAMSELF + directory cardORG(R)
View sensitive (Aadhaar, bank, PAN)ORGreveal ORGreveal LOC*—ORG (bank, PAN)—SELF—
Change job assignmentORGORGLOC*——propose for TEAM (approval)——
Approve change requestsORGORGLOC*—bank (optional second step)—raise SELF—
Documents approveORGORGLOC*——TEAM(R)upload SELFORG(R)
Checklist tasksORGORGLOC*as owneras owneras ownerview SELFORG(R)
Probation actionsORGORGLOC*——TEAM (recommend)view SELF—

7.4.9 UI/UX​

  • HR web: People list (saved views: Pre-joining, Joining this week, On probation, On notice), employee profile with tabs (Overview, Job & history timeline, Personal, Family, Bank & IDs, Documents, Checklists, Letters, Activity). A "Joining this week" board shows readiness (documents, checklist, bank) per hire.
  • Candidate (mobile web, no app needed): stepper per section, camera upload for documents, progress bar, save draft.
  • Employee mobile: Me tab with profile cards, edit button per section (showing "Needs HR approval" where applicable), documents with status chips, checklist status.
  • Line manager: team list with probation-due and document-pending badges.
  • Empty states: "No pre-joining hires. Add a new hire or import a list." Errors: identity format errors inline; duplicate identity with a link to the existing record (if permitted).

7.4.10 Notifications and automation​

Pre-onboarding link and reminders (day 2 and 5 if not submitted); submission received (HR); section reopened (candidate); document approved/rejected; document expiring; activation link (via IAM); checklist task assigned/overdue; induction invite/changed/cancelled; probation due; change request outcome; no-show reminder; work anniversary and birthday feed (to ENG, R2).

7.4.11 Reports and analytics​

Employee master report with column chooser and filters (Emp ID, name, office email, mobile, status, type, department, designation, location, gender, blood group, custom fields) [Observed column set, research §21.2]; joiners and leavers; probation due; document compliance (missing/expired); headcount trend; job-change history.

7.4.12 Edge cases​

  • Joining date moves after the link was sent → HR edits it; policies and code assignment follow the new date; no duplicate record.
  • Two hires with the same name and DOB → allowed; identity duplicates are the only hard block.
  • Employee changes manager mid-month while a leave request is pending → the pending approval moves to the new manager from the effective date (FR-NTF-008); already-approved requests stay approved.
  • Aadhaar not provided (voluntary) → allowed; it is never mandatory except where the tenant marks it required for a specific legal purpose, with the purpose shown to the employee.
  • Back-dated transfer across states → PT/LWF state changes from the effective date; locked months are settled by arrears/adjustments in the next run.

7.5 ATT — Attendance, Shifts & Time​

Traces to: BR-ATT-* · Release: R1 (MVP-critical); R2 device gateway, kiosk and face (with MOB)

7.5.1 Purpose and scope​

ATT captures presence from every channel, applies shift and attendance policy, computes a status for every employee-day and hands payroll a locked, explainable set of payable days, LOP, overtime, extra days and penalties.

In scope (R1 unless noted)Out of scope
Web punch; mobile punch with selfie + geo-fence; offline punch queue; biometric CSV/API import and device mapping; manual punch; shifts (fixed, flexible, night); rotations; rosters; week-off patterns; shift change and swap; day-computation engine with status codes; lates/early-go and late → leave deduction; attendance requests (WFH, On-duty, remote); regularization; permissions (short leave); overtime with approval; extra days; week-off penalties; period close and lock; device push gateway (R2); kiosk and face (R2, via MOB)Continuous GPS tracking (FFM, R3); workforce demand forecasting and auto-rostering (post-R4); access-control hardware integration

7.5.2 Reference product summary​

  • Capture channels: biometric with device-user mapping [Observed] (SP-ATT-13); Excel upload with a vendor-supplied template [Observed] (SP-ATT-14); mobile self check-in with face, geo-located check-in within a manager-configured location, receptionist "Front Office Check-in/out" [Observed] (SP-ATT-19); field punch with photo and address [Observed] (SP-ATT-20). Punch records show time, in/out, address and source ("Lite", "CRM", "MOBILEAPP") with first/last photos [Observed] (research §21.3).
  • Geo-fence: a per-branch location with a geo-fencing radius (200 m in the example) [Observed] (research §21.3).
  • Shift master: start/end, grace in/out, "lates more than N → deduct X leave", minimum hours [Observed] (SP-ATT-01). Rotations per location, assign and reassign with start shift and date [Observed] (SP-ATT-07). Per-employee week-offs with history [Observed] (SP-ATT-08). Shift change requests; the manager can swap shifts between employees on approval [Observed] (SP-ATT-09).
  • Requests: attendance requests with work types WFH, WFO, On-Duty, Remote location, first/second half [Observed] (SP-ATT-02); permission in minutes, one per day, paid per Rule 29 [Observed] (SP-ATT-10); regularization by entering the out-time or converting to leave, plus manager bulk regularization [Observed] (SP-ATT-11/12); on-behalf requests auto-approved [Observed] (SP-ATT-04).
  • Day status legend: A, P, W, L, H, HD, WP, HP, HL; counts accept halves [Observed] (research §21.3). "In case of multiple attendance sources, break timings are not considered" [Observed] (research §21.3).
  • Rules are scattered across Shift master, HR Policy Rules 16–48 and Payroll Policies: half/full-day hours (27–28), flexible shifts (30–31), regularization lookback (32–33), default punch-out (35), lunch/tea durations (38–42), extra-day pay (43–45), week-off absence penalty (46–48) [Observed] (SP-IAM-03). Extra-day slabs per designation and penalty designations [Observed] (SP-ATT-17/18).
  • Gaps: OT is only "hours beyond the shift" with no approval or multipliers; no period lock; no liveness for face; shift swaps without the counterpart's consent [Observed/Inferred] (research §5.4).

7.5.3 What we change and why [Proposed]​

  • One typed attendance_policy (plus shift, geofence, overtime_policy, regularization_policy) assigned by applicability and effective-dated, replacing rules spread over three screens.
  • A deterministic day-computation engine that recomputes a day from its inputs whenever any input changes, and stores the explanation.
  • Multiple geo-fences per location with radius and accuracy tolerance, and a choice to block or flag out-of-fence punches.
  • Overtime needs approval and has a policy (minimum, rounding, caps, multipliers, pay vs comp-off).
  • Swap consent from the counterpart before manager approval.
  • Period lock tied to the payroll run, with post-lock corrections as next-period adjustments.

7.5.4 Day-status codes​

Each day has two sessions (first half, second half). The engine assigns a session status and derives the day code. The first nine codes are the minimum set from research §21.3; OD, MP and NE are [Proposed].

CodeNameDerivationDefault payable value
PPresentBoth sessions present: worked minutes ≥ full-day threshold1
AAbsentNo qualifying presence, leave or approved request on a working day0 (LOP)
HDHalf DayWorked minutes ≥ half-day threshold and < full-day threshold, other half not covered0.5
LLeaveBoth sessions on approved leave (including sandwich-counted days, LVE)1 if paid type; 0 if LOP type
HLHalf-day LeaveOne session on approved leave; the other present, OD or absent (flag other_half)leave half + other half value
WWeek-offScheduled week-off, not worked1; 0 if week-off penalty applies (flag penalty)
HHolidayHoliday on the employee's calendar (incl. an availed optional holiday, flag optional), not worked1
WPWeek-off PresentWorked on a week-off ≥ minimum hours1 + extra-day / OT / comp-off eligibility
HPHoliday PresentWorked on a holiday ≥ minimum hours1 + extra-day / OT / comp-off eligibility
ODOn Duty / RemoteApproved attendance request (WFH, On-duty, Remote) covering the session(s); work type stored as attribute1 (0.5 per session)
MPMissed PunchSingle punch or unmatched pair, unresolved; provisionalmissed_punch.provisional_value (default 0.5) until resolved; must be resolved before lock
NENot EmployedBefore joining date or after exit dateexcluded from period days

Display adds modifiers: late (L-dot), early-go, out-of-fence, manual, regularized, OT approved. Session combinations not covered above (e.g. OD + absent) display as HD with the attribute shown.

7.5.5 Day computation​

Engine rules:

  1. Attribution. A punch belongs to the shift instance whose window contains it: from shift_start − window_before (default 4 h) to shift_end + window_after (default 6 h). Night shifts that cross midnight belong to the start date.
  2. Pairing. Punches are sorted; the first is IN, the last is OUT; intermediate punches are breaks only when breaks.from_punches is on and all punches come from one source (as observed in Spryple, research §21.3).
  3. Dedup. Punches for the same employee within dedup_seconds (default 60) across sources collapse into one; all raw punches are kept.
  4. Worked minutes = OUT − IN − unpaid break minutes (fixed per shift or actual from punches).
  5. Late if IN > shift start + grace-in; early-go if OUT < shift end − grace-out. Flexible shifts check only total hours (and core hours if set).
  6. Recompute is idempotent and triggered by any input change for dates in an unlocked period; p95 latency ≤ 5 min after the change (NFR-PERF-05).

7.5.6 Functional requirements​

IDRequirementPriorityReleaseLabel
Capture
FR-ATT-001Web punch in/out from the browser; server time is authoritative; records IP, user agent and (if permitted) browser location; optional restriction to tenant IP ranges per policy. Source = WEB.MustR1[Proposed]
FR-ATT-002Mobile punch with selfie (front camera, compressed ≤ 300 KB) and device location (lat/long, accuracy); evidence kept for retention.punch_photo_days (default 180) then purged. Source = MOBILE.MustR1[Observed] SP-ATT-19/20 + [Proposed]
FR-ATT-003Geo-fences: each location has one or more circular fences (centre, radius 25–2,000 m, default 200 m). Policy geofence.mode = block, flag (allowed, needs reason, marked out-of-fence) or off. If reported accuracy is worse than geofence.max_accuracy_m (default 100 m), the punch is treated as out-of-fence for block mode prompts to retry, or flagged.MustR1[Observed] research §21.3 + [Proposed]
FR-ATT-004Employees can be allowed to punch at several locations (e.g. home branch + client sites) through their attendance policy.ShouldR1[Proposed]
FR-ATT-005Offline punch queue: the app stores punches with device time and elapsed time since the last server sync; uploads when online; the server accepts punches up to 72 h old, flags them offline, and flags clock_drift if device time differs from the computed server time by > 5 min.MustR1[Proposed]
FR-ATT-006Biometric device mapping: device master (serial, make, location) and mapping device user ID ↔ employee, with bulk import.MustR1[Observed] SP-ATT-13
FR-ATT-007Biometric punch import through (a) CSV/Excel upload with a published template and column mapping, and (b) an authenticated punch-batch API (integration key per tenant); idempotent by (device, device user, timestamp). Unmapped device users go to an "Unmapped punches" queue.MustR1[Observed] SP-ATT-14 + [Proposed]
FR-ATT-008Device push gateway (ADMS-style HTTP push) with per-device secret, plus a sync agent for pull-only devices; device health (last seen, last punch, queue lag) with an alert after device.offline_alert_minutes (default 60) during shift hours.MustR2[Proposed] (architecture.md §16)
FR-ATT-009Manual punch entry or edit by HR with mandatory reason; original values kept; day marked manual.MustR1[Proposed]
FR-ATT-010Kiosk and face-verified punches are accepted from MOB kiosk mode (FR-MOB-012..015) with source KIOSK, and field punches from FFM with source FIELD (R3).MustR2[Observed] SP-ATT-19 redesigned
Shifts, rosters and week-offs
FR-ATT-011Shift master: name, code, colour, start, end (total hours auto-calculated; crossing midnight allowed), unpaid break minutes, grace-in, grace-out, half-day and full-day thresholds (override policy), minimum minutes before OT counts, type fixed or flexible (required hours, optional core window).MustR1[Observed] SP-ATT-01 + Rules 27–31 consolidated
FR-ATT-012Shift assignment to one or many employees for a date range, with a week-off pattern; default shift per attendance policy for new joiners; bulk assignment by filter.MustR1[Observed] SP-ATT-06 + Rules 19–21/25–26 consolidated
FR-ATT-013Rotation sequences: ordered list of shifts with a step length (days or weeks), an anchor date and location; assign to employees with a start step and date; reassign from a date without changing past days.MustR1[Observed] SP-ATT-07
FR-ATT-014Roster grid (employees × days) for line managers and HR: view and edit shifts and week-offs, copy a week, publish changes with notification; coverage row per shift per day (present / scheduled).ShouldR1[Observed] research §21.3 + [Proposed]
FR-ATT-015Drag-and-drop roster planning with minimum-coverage warnings.CouldR2[Proposed]
FR-ATT-016Week-off patterns: fixed weekdays, nth-weekday rules (e.g. 2nd and 4th Saturday), rotating, or per-employee; effective-dated history.MustR1[Observed] SP-ATT-08 + Rules 16–18
FR-ATT-017Shift change request: date range, from-shift (auto), to-shift, reason; optional swap with a named colleague, who must accept before the manager decides; approval updates both rosters.MustR1 (consent: Should)[Observed] SP-ATT-09 + [Proposed]
FR-ATT-018Auto-shift detection for employees on a "multi-shift" policy: pick the allowed shift whose start is nearest to the first IN.ShouldR1[Proposed]
Day engine
FR-ATT-019Day-computation engine as specified in §7.5.4–§7.5.5: session and day status, first IN, last OUT, worked, break, late and early-go minutes, OT candidate minutes, flags; stores inputs and policy version IDs; "How calculated" view.MustR1[Inferred] research §5.3 + [Proposed]
FR-ATT-020Missed-punch handling per missed_punch settings: default_out = none, shift end, or shift start + full-day hours; provisional value; auto-resolution at period close if still open (at_close = absent / half / present).MustR1[Observed] Rule 35 + [Proposed]
FR-ATT-021Break rules: fixed unpaid break per shift, or actual breaks from punches with lunch and tea durations and graces; excess break minutes reported.ShouldR1[Observed] Rules 38–42
FR-ATT-022Late and early-go tracking per period; late → deduction rule: after late.free_count lates (default 3) in a period, each further late (or each block of N lates) deducts a configured fraction of a day from an ordered list of leave types (e.g. CL → EL → LOP) via the leave ledger.MustR1[Observed] SP-ATT-01, Rules 22–24 consolidated
Requests
FR-ATT-023Attendance requests for work types from a tenant master (seeded: Work From Home, Work From Office, On Duty, Remote Location), date range, full/first half/second half, reason, attachment; produces OD sessions on approval; per-type limits per month.MustR1[Observed] SP-ATT-02
FR-ATT-024Regularization: the employee sees days needing action (A, MP, HD, late) as alerts; actions: add missing time, raise an attendance request, or apply leave (LOP only if no balance); within regularization.lookback_days (default 7) and up to regularization.max_per_period (default 4).MustR1[Observed] SP-ATT-03/11, Rules 32–33
FR-ATT-025Manager bulk regularization: lists of full-day and half-day exceptions for the team; multi-select → attendance request or leave on behalf (auto-approved at the manager level, reason required).MustR1[Observed] SP-ATT-12
FR-ATT-026Permission (short leave): date, start time, duration in minutes, reason; limits permission.max_per_day (default 1), max_per_period (default 2), max_minutes (default 120); paid or unpaid; the approver may edit the duration before approving; approved minutes excuse late/early-go.MustR1[Observed] SP-ATT-10, Rule 29
Overtime, extra days, penalties
FR-ATT-027Typed overtime_policy: eligibility by applicability; basis (beyond shift end, beyond daily hours, beyond weekly hours); minimum minutes; rounding (down to 15/30/60); daily and period caps; multipliers per day type (working, week-off, holiday; e.g. 2× ordinary rate where the Factories Act applies, to verify); outcome pay, comp_off or employee_choice; approval pre, post or none.MustR1[Proposed] (fixes [Observed] gap)
FR-ATT-028OT approval: computed OT candidates appear as OT claims for the line manager, who approves all, part (edit minutes) or rejects; only approved OT is sent to PAY or credited as comp-off (FR-LVE-014). Pre-approval requests can be raised before the work.MustR1[Proposed]
FR-ATT-029Extra days on WP/HP: outcome per policy = extra-day pay, comp-off credit, or none; extra-day slabs per designation (min days worked, max days worked → eligible extra days) as observed.MustR1[Observed] SP-ATT-17, Rules 43–45
FR-ATT-030Week-off penalty: when an employee is absent on the configured adjacent days (before, after or both), the week-off becomes unpaid (W + penalty); applicable designations/applicability; per-period cap.MustR1[Observed] SP-ATT-18, Rules 46–48
Period, lock and output
FR-ATT-031The attendance period follows the pay schedule window of the employee's pay group (e.g. 26th–25th) (FR-PAY-005).MustR1[Observed] SP-PAY-04
FR-ATT-032Period close: a checklist shows unresolved MP, pending requests, pending OT claims and unmapped punches; HR can send reminders, auto-resolve per policy, then lock the period per pay group. Locked days cannot change.MustR1[Proposed]
FR-ATT-033Unlock requires att.period.unlock with reason and is allowed only while the dependent payroll run is not Approved or later; unlocking invalidates the run's calculation (status back to Draft).MustR1[Proposed]
FR-ATT-034Post-lock corrections (approved late requests, regularization of a locked day) create attendance adjustments (± payable days, OT minutes) carried into the next open period and shown on the payslip as "Attendance adjustment for ".MustR1[Proposed]
FR-ATT-035Payable-days output per employee per period: days in period, P, A, HD, L by type, LOP days, W, H, WP, HP, OD, penalties, extra days, approved OT minutes by multiplier, late-deduction days, adjustments.MustR1[Observed] SP-PAY-13 Payable Days + [Proposed]
FR-ATT-036Attendance upload (daily status or punches) via the import framework, for migration and for tenants without devices.MustR1[Observed] SP-ATT-14
Views and anomalies
FR-ATT-037Employee calendar with status codes and colours, first IN/last OUT, today's and next shift, pending alerts; month summary with half-day counts (e.g. 14.5).MustR1[Observed] SP-ATT-15, research §21.3
FR-ATT-038Manager "Team today": scheduled, punched in, late, absent, on leave, OD, not yet punched; drill to punches with photos and fence status.MustR1[Observed] SP-ATT-15/19
FR-ATT-039Anomaly flags and review queue: out-of-fence, offline/clock drift, punch from an unapproved device, selfie missing, impossible travel between consecutive punches (> 150 km/h).ShouldR1[Proposed]
FR-ATT-040Alternative fences: Wi-Fi BSSID allow-list and rotating QR code at a location.CouldR2[Proposed]

7.5.7 Key entities​

punch_raw (employee, source, device, ts_device, ts_server, lat, lng, accuracy, photo_ref, fence_result, flags), device (serial, make, location, secret), device_user_map, shift, shift_assignment (employee, shift, from, to), rotation, rotation_step, rotation_assignment, weekoff_pattern, roster_day (materialised plan), attendance_day (employee, date, s1_status, s2_status, code, first_in, last_out, worked_min, late_min, early_min, ot_candidate_min, flags, inputs_hash, policy_version_ids), attendance_request, regularization, permission_request, shift_change_request, ot_claim, attendance_period (pay group, from, to, status open/closing/locked), attendance_adjustment, work_type, geofence.

SettingTypeDefault (example)
thresholds.full_day_minutes / half_day_minutesinteger480 / 240 (Spryple example 8 h / 4 h)
grace.in_minutes / grace.out_minutesinteger 0–12010 / 10
capture.allowed_methodsset WEB, MOBILE, BIOMETRIC, KIOSK, FIELDMOBILE, BIOMETRIC
capture.selfie_requiredbooleantrue for MOBILE
geofence.modeenum block / flag / offflag
geofence.max_accuracy_minteger 10–500100
geofence.allowed_locationslisthome location
punch.dedup_secondsinteger 0–60060
punch.window_before_h / window_after_hinteger4 / 6
breaks.from_punchesbooleanfalse
missed_punch.default_outenum none / shift_end / start_plus_full_daynone
missed_punch.provisional_valueenum 0 / 0.5 / 10.5
missed_punch.at_closeenum absent / half / presentabsent
late.free_countinteger 0–313
late.deduct_pernumber (days) per late or per block0.5 per block of 3
late.deduct_orderordered list of leave typesCL, EL, LOP
regularization.lookback_days / max_per_periodinteger7 / 4
permission.max_per_day / max_per_period / max_minutes / paidinteger / integer / integer / boolean1 / 2 / 120 / true
weekoff_penalty.enabled / adjacent / applicabilityboolean / enum before, after, both / rulefalse / both / —
extra_day.outcome / slabs[]enum pay, comp_off, none / listcomp_off
overtime_policy.*typed policysee FR-ATT-027; approval post, rounding 30, min 30
requests.work_types_enabledlistWFH, On Duty
roster.edit_by_line_managerbooleantrue
device_approval.requiredboolean (IAM)false

7.5.9 User stories​

US-ATT-01 — Geo-fenced selfie punch. As an employee, I want to punch in from my phone at the plant gate.

  • AC1: Given I am inside a 200 m fence and location accuracy is 30 m, when I tap Punch In and take a selfie, then the punch is accepted within 2 s and my home screen shows "In since 08:57".
  • AC2: Given geofence.mode = block and I am 600 m away, when I tap Punch In, then the app shows "You are 600 m from Plant 1. Move closer or contact your manager" and no punch is stored.
  • AC3: Given geofence.mode = flag, when I punch outside the fence, then I must enter a reason and the punch is marked out-of-fence for my manager.

US-ATT-02 — Offline punch. As an employee in a basement with no signal, I want my punch saved.

  • AC1: Given no connectivity, when I punch, then the app shows "Saved offline, will sync" with the time.
  • AC2: When connectivity returns within 72 h, then the punch is uploaded and the day is recomputed; if my phone clock was 20 minutes off, the punch is flagged clock_drift.

US-ATT-03 — Night shift. As a line_manager, I want night-shift hours counted on the shift's start date.

  • AC1: Given a shift 22:00–06:00 and punches at 21:55 on 3 Nov and 06:05 on 4 Nov, when the day is computed, then 3 Nov is P with 8 h 10 min and 4 Nov is not affected.

US-ATT-04 — Regularize a missed punch. As an employee, I want to fix a day where I forgot to punch out.

  • AC1: Given yesterday is MP, when I open Alerts, then I can enter the out time with a reason.
  • AC2: When my manager approves, then the day is recomputed (e.g. to P) and the alert disappears.
  • AC3: Given the day is 10 days old and the lookback is 7 days, then the action is disabled with "Regularization window has passed; contact HR".

US-ATT-05 — Overtime approval. As a line_manager, I want to approve only genuine overtime.

  • AC1: Given an operator worked 2 h 20 min beyond shift end with rounding 30 min, when OT is computed, then an OT claim of 2 h 00 min is created for me.
  • AC2: When I approve 1 h 30 min, then 1 h 30 min at the working-day multiplier is sent to payroll and the rest is discarded with my note.

US-ATT-06 — Shift swap with consent. As an employee, I want to swap my Saturday night shift with a colleague.

  • AC1: Given I request a swap with Ravi, when I submit, then Ravi must accept before my manager sees the request.
  • AC2: When the manager approves, then both rosters change for that date and both of us are notified.

US-ATT-07 — Late deduction. As an hr_admin, I want every 3 lates after 3 free lates to deduct half a day of CL.

  • AC1: Given an employee has 7 lates in the period, when the period closes, then 0.5 day is debited from CL (or the next type in order if CL is exhausted) with the reason "Late deduction: 4 lates beyond free count".

US-ATT-08 — Week-off penalty. As an hr_admin, I want week-offs unpaid when a worker is absent on both sides.

  • AC1: Given penalty is on with adjacent = both and a worker is A on Saturday and Monday, when Sunday is computed, then Sunday shows W with the penalty flag and payable value 0.

US-ATT-09 — Period lock. As a payroll_manager, I want attendance frozen before I calculate payroll.

  • AC1: Given 4 unresolved MP days, when I try to lock, then I see the list and can auto-resolve them per policy or send reminders.
  • AC2: Given the period is locked and a manager approves a late regularization, then an attendance adjustment of +0.5 day is created in the next period.

US-ATT-10 — Biometric import. As an hr_manager, I want to import a day's device CSV without duplicates.

  • AC1: Given a CSV with 1,200 punches of which 300 were imported yesterday, when I commit, then only 900 new punches are stored and affected days recompute.
  • AC2: Given 5 device user IDs are unmapped, then those punches go to Unmapped punches for mapping.

US-ATT-11 — On-behalf attendance request. As a line_manager, I want to mark a team member On Duty for a client visit.

  • AC1: Given I have att.request.approve@TEAM, when I raise an On-duty request on their behalf with a reason, then it is approved at my level, the day becomes OD and the employee is notified.

7.5.10 Permissions​

ActionOWNHRAHRMPRMLMEMPKIOAUD
Punch (own)SELFSELFSELFSELFSELFSELFLOC (others, punch-only, R2)—
View punches, photos, daysORGORGLOC*ORG(R)TEAMSELF—ORG(R)
Raise requests (attendance, regularization, permission, shift change)SELFSELFSELF + on behalf LOC*SELFSELF + on behalf TEAMSELF——
Approve requests and OTORGORGLOC*—TEAM———
Shifts, rotations, rosters, week-offsORGORGLOC*—TEAM (if roster.edit_by_line_manager)view SELF—ORG(R)
Attendance policies, geo-fencesORGORGLOC*(R)ORG(R)—view own policy—ORG(R)
Manual punch, import, device mappingORGORGLOC*—————
Lock periodORGORGLOC*ORG————
Unlock periodORGORG (reason)—ORG (reason)————

7.5.11 UI/UX​

  • Employee mobile (primary): home card with a large Punch button showing state (In since / Out), fence status chip ("Inside Plant 1"), shift today; Alerts list; calendar month with codes and legend; request forms (attendance, regularization, permission, shift change) as bottom sheets; offline banner and pending-sync counter.
  • Employee web: same calendar and requests; web punch button if allowed.
  • Line manager mobile: Team today (counts + list), Approvals inbox (swipe approve/reject, bulk select), OT claims, team calendar; roster view (read and simple edits).
  • HR web: Attendance workbench with tabs Daily (status grid with filters), Exceptions (MP, out-of-fence, anomalies), Requests, OT, Rosters, Devices & imports, Period close (checklist, lock button with a confirmation listing totals).
  • States: before first shift assignment, show "No shift assigned. Ask HR" on the punch card; location permission denied shows a step-by-step enable guide and alternative methods; camera denied blocks selfie punch with guidance; a locked period shows a lock icon and disables edits with "Locked on 27 Oct by Anil".

7.5.12 Notifications and automation​

Punch reminder at shift start + grace if not punched (push, opt-out); missed punch-out reminder at shift end + 1 h; alerts digest for pending regularizations (daily); request submitted/decided; swap consent requested; OT claim pending (manager, daily digest); roster published or changed; device offline (HR); period close reminder (HR, 2 days before window end); period locked (PRM); auto-resolution summary.

7.5.13 Reports and analytics​

Monthly attendance register (code grid with counts), daily attendance, punch detail with photos and source, late and early-go, missed punch, overtime (claimed vs approved, by multiplier, cost estimate), extra days and penalties, shift-wise attendance and coverage, out-of-fence and anomalies, device health, payable-days summary, absenteeism rate trend (RPT). See §13.

7.5.14 Edge cases​

  • Duplicate source punches (biometric and mobile within a minute) → deduplicated; both are retained in raw data.
  • Late-arriving biometric data for a past unlocked date → day recomputed; if the date is locked → the punch is stored and an adjustment suggestion is raised to HR.
  • Shift change mid-period → days before and after use their own shift; the engine never back-applies a new shift to past days unless the assignment is back-dated.
  • Employee joins mid-period → days before joining are NE and excluded from payable days.
  • Holiday added after the day was computed → recompute to H (or HP if worked) and reverse LOP.
  • Device clock wrong → device-time offset can be set per device; affected punches are re-timed with an audit entry.
  • DST/time zones → India has no DST; locations carry a time zone for future non-IST sites; storage is UTC.
  • Leave and punch on the same day → approved full-day leave wins; punches are kept and flagged "worked on leave" for HR (no automatic comp-off).
  • Consent withdrawn for location → MOBILE punches are rejected with guidance to use another method (FR-IAM-018).

7.6 LVE — Leave & Holidays​

Traces to: BR-LVE-* · Release: R1 (MVP-critical); R2 statutory leave templates; R3 calendar sync

7.6.1 Purpose and scope​

LVE lets tenants define any leave type, credits balances through an auditable ledger, handles requests, cancellations, comp-off and optional holidays, and feeds LOP and encashment to payroll through ATT and PAY.

In scopeOut of scope
Leave-type builder with templates; per-type policies (eligibility, accrual, caps, carry-forward, lapse, encashment, sandwich, notice, documents); ledger; accrual and year-end jobs; requests, cancellation, on-behalf; comp-off; optional holidays; advanced (negative) leave; opening balances; calendars; leave payroll bridgeHourly leave (Won't R1); leave trading or donation between employees; holiday master (ORG, FR-ORG-010)

7.6.2 Reference product summary​

  • Ten fixed leave types: Casual, Sick, Comp-off, Loss of Pay, Maternity, Paternity, Wedding, Bereavement, Earned, Advanced; activate or deactivate only [Observed] (A: Leave Management; SP-LVE-02).
  • Per-type rules: quota, credit frequency (monthly/quarterly/half-yearly/yearly), sandwich flags, max per instance, minimum service months, advance notice days, lapse days, lapse → perks, document above N days, comp-off minimum hours and expiry days, carry-forward cap, maternity minimum gap between terms and maximum times, advanced leave borrowed against a monthly-accruing CL/SL/EL [Observed] (SP-LVE-03).
  • Common rules: sandwich across weekends and holidays, past-dated leave window, configurable emails, leave cycle Apr–Mar or Jan–Dec, max optional holidays per year [Observed] (SP-LVE-01).
  • Eligibility by gender and marital status (maternity for "married females", paternity for "married male") [Observed] (SP-LVE-04).
  • Employee: balance-limited request with half days, history with edit/delete before approval, cancel approved future leave, comp-off only on week-off/holiday dates, optional holiday requests, view-only policies [Observed] (SP-LVE-05). Mobile request also captures contact number and emergency mail during leave [Observed] (research §21.4).
  • Manager: cancellation approvals, on-behalf leave and comp-off (auto-approved, balance shown), reports and a Payroll Report (approved leaves, LOP and absent counts) [Observed] (SP-LVE-06).
  • Policy changes apply only to new employees [Observed] (SP-LVE-07).

7.6.3 What we change and why [Proposed]​

  • Leave-type builder seeded with Spryple-like templates, so tenants add Restricted, Study, Sabbatical, Menstrual or state-specific leave without code.
  • Ledger instead of a mutable balance, so every balance is explainable and auditable.
  • Inclusive eligibility: marital status is never a condition; parental leave is gender-neutral (primary/secondary caregiver, adoption, surrogacy); statutory maternity eligibility is expressed through service/days-worked conditions, not marriage.
  • Effective-dated policy versions with an explicit "apply to existing employees from date X" recalculation.
  • Encashment through payroll instead of only "convert to perks".

7.6.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-LVE-001Leave-type builder: name, code, colour, paid/unpaid, category (General, Sick, Comp-off, LOP, Parental, Statutory, Special), unit (full/half day), active flag. Templates seed the ten observed types (Paternity becomes "Parental — secondary caregiver"). LOP is a system type that cannot be deleted.MustR1[Observed] SP-LVE-02 redesigned
FR-LVE-002Typed leave_policy per type and applicability, effective-dated, with the settings in §7.6.6.MustR1[Observed] SP-LVE-03 + [Proposed]
FR-LVE-003Inclusive eligibility: conditions by employment type, minimum service days, probation allowed, location, grade, and optional caregiver role; gender may be used only for types flagged statutory_gender_specific (e.g. maternity benefit) and never marital status; maternity eligibility supports a days-worked condition (e.g. 80 days in the preceding 12 months under the Maternity Benefit Act, to verify).MustR1[Proposed] (drops [Observed] SP-LVE-04)
FR-LVE-004Leave ledger per employee and type: entries opening, accrual, debit (request), reversal, adjustment, carry_forward, lapse, encashment, late_deduction, comp_off_credit, comp_off_expiry; each with date, quantity, source reference, policy version and actor. Balances are derived; concurrent debits are serialised per employee.MustR1[Proposed]
FR-LVE-005Accrual engine: credits per frequency (monthly, quarterly, half-yearly, yearly), at period start or end, idempotent per (employee, type, period); preview of the next run; backfill when a policy version changes.MustR1[Observed] SP-LVE-03 + [Proposed]
FR-LVE-006Pro-rata on joining and exit with rounding (nearest_half, down_half, none) and a joining-day cut-off (e.g. joined after the 15th → no credit that month).MustR1[Proposed]
FR-LVE-007Leave request: type (eligible types only, with live balance), from/to dates, first/second half on start and end days, reason, attachment, contact number and alternate email during leave; the day count is shown before submit.MustR1[Observed] SP-LVE-05, research §21.4
FR-LVE-008Day counting excludes the employee's week-offs and holidays unless sandwich rules apply: sandwich.weekends (week-offs between two leave days are counted), sandwich.holidays (holidays between leave days are counted), and sandwich.adjacent (e.g. leave on Friday and Monday counts Saturday and Sunday). Uses the employee's own roster and holiday calendar.MustR1[Observed] SP-LVE-01/03
FR-LVE-009Validations: balance (or negative allowance), max/min per request, advance notice days, backdated window days, document required above N days (upload now or within N days after return), max times per year or career, minimum gap between terms, overlap with existing requests or OD, dates in a locked period. Each failure gives a specific message.MustR1[Observed] SP-LVE-03
FR-LVE-010Team conflict warning: show teammates on leave on the same dates to the employee (names only if permitted) and to the approver, with a configurable max-concurrent-absence warning per team.ShouldR1[Proposed]
FR-LVE-011Cancellation: before approval → withdraw; approved and fully in the future → cancellation request needing approval (CancelRequested in §6.2); partially taken → cancel remaining days only; past leave → HR only, unlocked period only. Approved cancellation posts a ledger reversal.MustR1[Observed] SP-LVE-05/06
FR-LVE-012On-behalf leave and comp-off by line manager or HR, with balance shown and reason required; approved at the actor's level (§6.2).MustR1[Observed] SP-X-04 + [Proposed]
FR-LVE-013Optional holidays: per calendar list of optional holidays; yearly quota per policy (optional_holiday.max_per_year); request and approval; on-behalf; availed day shows as H with the optional flag in ATT.MustR1[Observed] SP-LVE-01/06
FR-LVE-014Comp-off credit: (a) employee request for a worked week-off/holiday date with hours worked (only WP/HP dates selectable, minimum hours per policy, within the backdated window), or (b) automatic credit from approved ATT outcomes (extra day or OT as comp-off, FR-ATT-028/029). Credits expire after comp_off.expiry_days (default 60) with a reminder 7 days before.MustR1[Observed] SP-LVE-03/05
FR-LVE-015Advanced (negative) leave: allow borrowing up to N days against a type that accrues monthly; the negative balance is recovered from future accruals; at exit the outstanding negative balance becomes an F&F deduction (EXT).ShouldR1[Observed] SP-LVE-02/03
FR-LVE-016Year-end processing per leave cycle: preview and run carry-forward (with cap), lapse (with optional lapse days grace), and encashment candidates; idempotent and reversible until the next accrual runs.MustR1[Observed] SP-LVE-03 + [Proposed]
FR-LVE-017Leave encashment payout through PAY: at year end (from FR-LVE-016 candidates), on employee request (if allowed, with approval), and at F&F; amount = days × per-day rate from a formula on configured components (e.g. Basic / 26 or Basic / 30).ShouldR1[Proposed]
FR-LVE-018Opening balances by import (FR-ORG-012) and manual adjustments with reason, both as ledger entries.MustR1[Proposed]
FR-LVE-019Employee balance view per type (available, booked, pending, taken this cycle, expiring soon) and a ledger statement with "how calculated" for each entry.MustR1[Observed] SP-LVE-05 + [Proposed]
FR-LVE-020Calendars: my leave, team leave (line manager), organisation leave by location/department (HR); holidays list (next 3 and View all).MustR1[Observed] SP-LVE-05/06
FR-LVE-021Policy documents: view-only company leave policy PDFs and a generated plain-language summary of the employee's own resolved policy.MustR1[Observed] SP-LVE-05 + [Proposed]
FR-LVE-022Locked-period protection: approvals, cancellations or policy changes that would alter a locked period do not change it; they create ledger and attendance adjustments in the next open period (FR-ATT-034).MustR1[Proposed]
FR-LVE-023Leave payroll bridge report: per employee per period approved leave by type, LOP days, absent days and encashment days, reconciled with ATT payable days.MustR1[Observed] SP-LVE-06
FR-LVE-024Policy version migration: when a new version applies to existing employees, show a preview of balance changes (e.g. quota 12 → 15, pro-rated from 1 July) and post adjustment entries on activation.MustR1[Proposed] (fixes [Observed] SP-LVE-07)
FR-LVE-025Insufficient balance handling: offer to split a request into the available paid days plus LOP days, if the policy allows.ShouldR1[Proposed]
FR-LVE-026Statutory state leave templates (e.g. Shops & Establishments minimum entitlements by state), published with the statutory pack.CouldR2[Proposed]
FR-LVE-027Calendar sync of approved leave to Google/Microsoft calendars (out-of-office event).ShouldR3[Proposed] (architecture.md §16)
FR-LVE-028Hourly leave units.Won'tR1[Proposed] (use ATT permissions for short absences)

7.6.5 Key entities​

leave_type, leave_policy / leave_policy_version (per type, applicability), leave_ledger_entry (employee, type, date, qty, kind, source_ref, policy_version_id), leave_request (type, from, to, from_session, to_session, days, status, contact, alt_email, attachment), leave_request_day (date, session, counted, reason: sandwich/regular), comp_off_credit (worked_date, hours, expires_on, status), optional_holiday_request, leave_cycle_run (type, cycle, kind, status), encashment_request.

7.6.6 Configuration settings (typed leave_policy, per type)​

SettingTypeDefault (Casual Leave template example)
entitlement.annual_daysdecimal12
accrual.frequency / accrual.timingenum monthly, quarterly, half_yearly, yearly / start, endmonthly / start
accrual.prorate_joining / rounding / joining_cutoff_dayboolean / enum / integertrue / nearest_half / 15
eligibility.min_service_days / allow_in_probation / employment_typesinteger / boolean / list0 / true / all
request.max_days / min_days / half_day_alloweddecimal / decimal / boolean3 / 0.5 / true
request.advance_notice_days / backdated_daysinteger1 / 3
request.document_required_above_daysinteger or nullnull (Sick template: 2)
limits.max_times_per_year / max_times_career / min_gap_yearsinteger or nullnull
sandwich.weekends / holidays / adjacentbooleanfalse / false / false
balance.max_cap / negative_allowed_daysdecimal or nullnull / 0
year_end.carry_forward_max / lapse / encash_maxdecimal / boolean / decimal0 / true / 0 (Earned template: carry 30, encash 15)
comp_off.min_hours / expiry_days / backdated_daysdecimal / integer / integer4 / 60 / 30 (Comp-off template)
approval.workflowreference to NTF workflowline manager, single level
notifications.enabledbooleantrue

Tenant-level: leave_cycle (ORG), optional_holiday.max_per_year (default 2), team_conflict.max_concurrent (default off).

7.6.7 User stories​

US-LVE-01 — Apply for leave on mobile. As an employee, I want to apply for two days of casual leave and see the count before submitting.

  • AC1: Given I select Thu–Fri with a CL balance of 4, when I pick the dates, then the form shows "2 days" and "Balance after: 2".
  • AC2: Given Saturday and Sunday are my week-offs and sandwich weekends is off, when I select Fri–Mon, then the count is 2 days.
  • AC3: Given sandwich weekends is on, when I select Fri–Mon, then the count is 4 days with Saturday and Sunday labelled "sandwich".

US-LVE-02 — Approve with team context. As a line_manager, I want to see who else is away before approving.

  • AC1: Given two teammates are on leave on the same dates, when I open the request, then I see their names and the team's absence count for those dates.
  • AC2: When I reject, then a reason is mandatory and the employee is notified with it.

US-LVE-03 — Cancel future leave. As an employee, I want to cancel approved leave next week.

  • AC1: Given approved leave starting in 5 days, when I cancel, then the request moves to Cancellation requested and my manager is notified.
  • AC2: When my manager approves the cancellation, then the ledger shows a reversal and my balance is restored.
  • AC3: Given leave that started yesterday, when I try to cancel, then only the remaining future days can be cancelled.

US-LVE-04 — Comp-off from holiday work. As an employee who worked on a holiday, I want a comp-off credit.

  • AC1: Given the day is HP with 6 h worked and the minimum is 4 h, when I request comp-off, then the request shows 1 day and goes to my manager.
  • AC2: Given the credit is approved on 1 Nov with expiry 60 days, when 24 Dec arrives, then I get a reminder; on 31 Dec the unused credit expires with a ledger entry.

US-LVE-05 — Gender-neutral parental leave. As an hr_admin, I want parental leave available to any new parent.

  • AC1: Given a "Parental — secondary caregiver" type with no gender condition, when an employee of any gender applies with the child's date of birth or adoption date, then the request is accepted if within the policy window.
  • AC2: When I try to add marital status as an eligibility condition, then the policy editor does not offer that field.

US-LVE-06 — Mid-year policy change for everyone. As an hr_admin, I want to raise annual EL from 15 to 18 days from 1 July for existing employees.

  • AC1: Given a new version effective 1 July, when I preview, then I see each employee's additional pro-rated credit (e.g. +1.5 days for July–December).
  • AC2: When I activate, then adjustment entries are posted and the employee ledger shows "Policy update EL v3".

US-LVE-07 — Year-end carry-forward. As an hr_manager, I want to run the year-end process safely.

  • AC1: Given carry-forward max 30 and encashment max 15, when I preview year-end for 31 Dec, then I see carry-forward, lapse and encashment per employee before running.
  • AC2: Given I run it twice, then the second run makes no changes.

US-LVE-08 — Optional holiday. As an employee, I want to take Onam as an optional holiday.

  • AC1: Given my quota is 2 and I have used 1, when I request Onam, then it goes for approval and, once approved, the day shows H (optional) and my quota shows 0 remaining.

7.6.8 Permissions​

ActionOWNHRAHRMPRMLMEMPAUD
Leave types and policiesORGORGORG(R)ORG(R)—own policy (R)ORG(R)
Apply / cancel ownSELFSELFSELFSELFSELFSELF—
Apply on behalfORGORGLOC*—TEAM——
Approve requests and cancellationsORGORGLOC*—TEAM——
View balances and ledgerORGORGLOC*ORG(R)TEAMSELFORG(R)
Manual adjustment, opening importORGORGLOC*————
Year-end runORGORGORG (run)ORG(R)———
Encashment approvalORGORGLOC*ORG (pay)—request SELF—

7.6.9 UI/UX​

  • Employee mobile: balance chips coloured by type on the Leave tab; Apply bottom sheet with a range calendar that greys week-offs and holidays, shows the live count and sandwich labels; history list with status chips and actions per status; comp-off and optional-holiday tabs; policy summary.
  • Line manager: approvals inbox (shared with ATT), team leave calendar (month view with avatars), conflict banner inside each request.
  • HR web: leave types (builder with template picker), policy editor with version timeline and preview, balances grid with ledger drill-down, year-end runner (preview → run), import for opening balances.
  • States: no eligible leave type → "You are not yet eligible for leave. CL becomes available after 30 days of service (on 14 Dec)". Insufficient balance → offer split with LOP (FR-LVE-025). Locked period → "These dates are in a locked payroll period; HR will adjust in the next period".

7.6.10 Notifications and automation​

Request submitted (approver), decided (employee, with reason), cancellation requested/decided, reminder for pending approvals (daily digest, escalation per NTF), comp-off expiring, balance credited (monthly, opt-in), year-end summary (employee), document pending after return (employee, HR), long leave starting (HR, for absence planning).

7.6.11 Reports and analytics​

Leave balance (as on date), leave register (employee-wise, date-wise, type-wise, designation-wise), leave summary (worked days vs leave), comp-off register (credited, availed, expired), LOP report, encashment report, year-end report, leave trend and Bradford-style absence frequency (Could, R4).

7.6.12 Edge cases​

  • Holiday calendar changes after leave approval → the request's day count is recomputed; the ledger is adjusted (or a next-period adjustment if locked) and the employee is notified.
  • Roster change makes a leave day a week-off → that day is no longer counted (unless sandwich applies).
  • Employee transfers to a location with a different policy mid-cycle → the new policy applies from the transfer date; accruals are pro-rated across both versions.
  • Leave spans two payroll periods, one locked → the locked part stays; the open part follows the change.
  • Exit date before an approved future leave → the leave beyond the exit date is cancelled automatically with reversal.
  • A request exceeding the balance at submission but valid at approval (accrual in between) → validation re-runs at approval time.

7.7 PAY — Payroll & Statutory Compliance (India)​

Traces to: BR-PAY-* · Release: R1 (MVP-critical, highest risk); R2 Form 16, 24Q, journal export, F&F run, reimbursement payout, VDA; R4 accounting API connectors

7.7.1 Purpose and scope​

PAY turns compensation, attendance and inputs into a correct, reproducible, approved and locked payroll, then produces payslips, bank files and statutory files for Indian employers.

In scopeOut of scope
Salary components and formulas; structure templates; effective-dated compensation; pay schedules and pay groups; EPF, ESI, PT, LWF, TDS (with regime choice, IT declarations and proofs in R1), gratuity provision; inputs (attendance, one-time, recurring, variable pay, arrears, OT, extra days); advance salary and loans; run lifecycle with validation, variance, approval, lock, payment and reversal; off-cycle runs; payslips; bank files; ECR, ESI, PT and LWF files; Form 16 and 24Q data (R2); journal export (R2); F&F run (R2)Direct filing on government portals (we generate files; architecture.md §16); payroll for employees outside India; payroll outsourcing services; earned wage access (§15); weekly or fortnightly pay frequencies (Won't R1)

7.7.2 Reference product summary​

  • Pay groups are chosen by CTC range: name, CTC start–end, chosen earnings and deductions, each component as % (of CTC/Basic) or flat; components can be renamed for the payslip; status "Configuration in Progress → Active" [Observed] (A: Payroll Management; SP-PAY-05). A sample pay group is named "… without ESI", implying the structure decides statutory applicability [Inferred] (research §21.5).
  • Assign / reassign pay group with a CTC breakdown (monthly/annual, EPF-aware), used for increments and new financial years [Observed] (M: Payroll Management; SP-PAY-10/11).
  • Statutory configuration: EPF employee/employer contribution, admin charges, EDLI; ESI with "include employer contribution in CTC" and state-wise ESI numbers; PT by state with slabs; gratuity and VDA [Observed] (SP-PAY-02/03/07/08/13).
  • Pay schedule: same or different payroll and leave windows (e.g. 25th–24th); salary basis "actual days in month" or "organisation working days" [Observed] (SP-PAY-04).
  • Payroll policies (14 rules): advance-salary instalments and cooling-off, OT in salary, gratuity coverage, VDA, absent = LOP, dynamic payroll processing, ESI/EPF independent of LOP, minimum OT hours, variable-pay frequency, LOP-linked week-off deduction, extra-day payment [Observed] (SP-PAY-07).
  • Monthly payroll: select FY and month → select employees → Calculate Salary → payslips published; only the Finance Manager can generate [Observed] (SP-PAY-12). No lock, approval or reversal is documented [Inferred] (research §7.3).
  • Inputs: arrears by month/branch/employee with Pending/Paid [Observed] (SP-PAY-09); other deductions master [Observed] (SP-PAY-14); variable pay with calculation and distribution periods, monthly share or lump sum [Observed] (SP-PAY-17); TDS entered as a manual amount per employee [Observed] (SP-PAY-16), although the employee menu shows IT Declaration and Form 16 [Observed] (research §21.5).
  • Advance salary: needs at least one payslip; amount ≤ gross; approval by Finance Manager; recovery tracking [Observed] (E: Payroll Management). The Advance Salary Report section is empty [Observed doc defect] (research §17 D9).
  • Outputs: Monthly Payroll (PDF for bank), EPF download for the portal, ESI and PT reports, bank-wise salary summary [Observed] (SP-PAY-13/15). Portal-ready ECR/ESIC files and bank transfer files are not evidenced [Inferred] (research §7.3).
  • Payslip shows earnings, deductions, other deductions, LOP, arrears, variable pay, gratuity, OT and extra days; sample earnings include fuel, vehicle maintenance and VDA; gratuity appears as an employee deduction [Observed] (research §21.5).

7.7.3 What we change and why [Proposed]​

ChangeWhy
Structure templates separate from effective-dated compensationA CTC range should not decide the structure; a promotion at the same CTC, or an employee outside every range, must still work. History must be correct for arrears.
Formula components with a safe expression languageTenants express their rules (e.g. HRA = 40% of Basic for non-metro) without vendor changes.
Run lifecycle Draft → Calculated → Reviewed → Approved → Locked → Paid → Reversed with immutable snapshotsLegal defensibility; no silent edits after payment; four-eyes control.
TDS engine with regime choice, declarations and proofs in R1Manual TDS is error-prone and Spryple appears to offer declarations (parity).
Portal-ready ECR, ESI, PT and LWF files and bank transfer filesThe real month-end work is producing files the portals and banks accept.
Gratuity as an employer provision, not an employee deductionGratuity is an employer liability; showing it as a deduction misleads employees [Inferred critique] (research §21.5).
Advances and loans on a recovery ledgerRecovery must survive pauses, prepayments and exit.

Statutory values in this section are examples to verify with a payroll/compliance expert. They live in the statutory pack (FR-PLT-009). Note: the Income-tax Act, 2025 replaces the Income-tax Act, 1961 from 1 April 2026 and renumbers sections and forms; this PRD uses the familiar names (Form 16, 24Q, Form 12BB, Form 12BA) as functional labels for "annual TDS certificate", "quarterly salary TDS return" and so on. The Labour Codes were brought into force in November 2025; central and state rules and their effect on wage definitions must be verified before R1 GA.

7.7.4 Core model​

7.7.5 Payroll run lifecycle​

TransitionWho (default)PreconditionsEffects
Create (Draft)payroll_managerPay group and period open; no other open regular run for the same pay group and periodInputs editable; employees included by pay group and employment dates
Calculatepayroll_managerAttendance period locked, or the pay schedule uses an attendance cut-off (FR-PAY-005); no blocking validationsSnapshot of inputs; per-employee results; variance report
Reviewpayroll_manager or a designated reviewerEvery blocking issue cleared; every warning acknowledged or employee heldRun read-only except holds and comments
Approveorg_owner or finance_admin (workflow configurable, FR-PAY-035)Approver did not edit inputs in this run when SoD is on (FR-PAY-036)Approval recorded with totals hash
LockApprover or payroll_manager (auto-lock on approval is a setting)ApprovedInputs and results immutable (Object Lock for artefacts); payslips, bank, statutory and journal files generated; payslips published at payslip.publish_at
Paidpayroll_managerLockedPayment date and UTR per employee (import or bulk mark); failed payments listed for re-issue
Reversepayroll_manager requests, approver approvesLocked or Paid; reason requiredA reversal run with negated lines is created and locked; the original shows "Reversed by PR-…"; a correction off-cycle can then be run. Statutory files for the period are regenerated as revised versions.

7.7.6 Calculation pipeline (per employee, deterministic)​

  1. Resolve snapshot: compensation versions active in the period (a mid-period revision splits the period into segments, each prorated), job assignment (state for PT/LWF, legal entity), statutory pack version, payroll policy version.
  2. Days: payable days and LOP from ATT (FR-ATT-035); salary basis from the pay schedule (calendar days, fixed 30, fixed 26, or organisation working days).
  3. Earnings: fixed components prorated by payable_days / basis_days where prorate = true; formula components evaluated in dependency order; OT = approved minutes × hourly-rate formula × multiplier; extra days; variable pay; arrears; one-time earnings; reimbursements (R2).
  4. Wage bases: EPF wages, ESI wages, PT gross, LWF wages and gratuity wages from component flags, with the Labour Codes wage check if enabled (FR-PAY-015).
  5. Employee statutory deductions: EPF (and VPF), ESI, PT, LWF.
  6. TDS from the TDS engine (FR-PAY-050).
  7. Other deductions: advance and loan EMIs, recurring deductions, one-time deductions, penalties.
  8. Net pay = gross earnings − total deductions, rounded per rounding.net (default nearest rupee, with a rounding line). If net < 0, deductions are applied in priority order (statutory → TDS → loans/advances → others) and unrecovered amounts are carried forward with a flag.
  9. Employer cost: EPF employer (EPS + EPF), EDLI, admin charges, ESI employer, LWF employer, gratuity provision, other employer contributions → monthly CTC cost.

All money uses exact decimal arithmetic (no floating point), rounding is defined per component (nearest, up, down, to 1 or 0.01), and each line stores its formula, inputs and result for "how calculated".

7.7.7 Statutory reference values (examples to verify)​

ItemExample value in the statutory pack (verify before use)
EPFEmployee 12% of EPF wages; employer 12% split 8.33% EPS (on wages up to the ₹15,000 ceiling, i.e. max ₹1,250) and 3.67% EPF; EDLI 0.5% on wages up to ₹15,000; admin charges 0.5%; contributions above the ceiling optional per employee/employer
ESIEmployee 0.75%, employer 3.25% of ESI wages; coverage when gross wages ≤ ₹21,000 per month (₹25,000 for persons with disability); contribution periods April–September and October–March (coverage continues for the period once eligible)
PTState-specific monthly slabs and special months (e.g. a higher February deduction in some states); annual cap ₹2,500 under the Constitution
LWFState-specific employee and employer amounts, monthly, half-yearly (e.g. June/December) or annual
TDSNew regime as default with standard deduction and rebate per the tax year; old regime on employee choice; health and education cess 4%; surcharge slabs; higher rate when PAN is missing
Gratuity15/26 × last drawn wages × completed years of service; eligibility after 5 years of continuous service (shorter for fixed-term employees under the Code on Social Security, to verify); ceiling ₹20 lakh

7.7.8 Functional requirements​

IDRequirementPriorityReleaseLabel
Set-up
FR-PAY-001Component master: code, name, payslip label, type (Earning, Deduction, Employer contribution, Reimbursement, Variable, Statutory), calculation method (Flat, % of components, Formula, Monthly input, Slab lookup), prorate by payable days, part of CTC, taxability (taxable / exempt / partially exempt with rule reference), wage-base flags (EPF, ESI, PT, LWF, gratuity, Labour Codes "wages" vs "exclusion"), rounding, display order. Seeded with standard Indian components (Basic, DA, HRA, Conveyance, Special allowance, LTA, Bonus, OT, Arrears, EPF, ESI, PT, LWF, TDS).MustR1[Observed] SP-PAY-05 + [Proposed]
FR-PAY-002Safe formula language: arithmetic, min, max, round, if, comparisons; references to components, CTC, payable_days, basis_days, days_in_period, approved OT minutes, employee attributes (state, metro flag, grade, employment type); no loops or external calls; dependency ordering with cycle detection; "test with employee" preview.MustR1[Proposed]
FR-PAY-003Salary structure templates: named, versioned (Draft → Active → Retired), list of components with calculation per component; one balancing component (e.g. Special allowance = CTC − other CTC components) that can never go negative (save-time check across a CTC range preview). Templates replace CTC-range pay groups.MustR1[Observed] SP-PAY-05 redesigned
FR-PAY-004Employee compensation record, effective-dated: annual CTC (or monthly gross for Lite), structure template version, component overrides, pay group, reason (Joining, Increment, Promotion, Correction, Restructure); monthly and annual breakdown preview including employer contributions; history list (the employee's CTC history).MustR1[Observed] SP-PAY-10/11 + [Proposed]
FR-PAY-005Pay schedule: period window (calendar month, or custom start day such as 26th–25th); optional attendance cut-off earlier than the period end, with days after the cut-off assumed present and trued-up next period as adjustments; salary basis (calendar days, fixed 30, fixed 26, organisation working days); pay date; payslip publish rule.MustR1[Observed] SP-PAY-04, SP-PAY-07 (dynamic processing)
FR-PAY-006Pay groups: legal entity + pay schedule (+ optional location filter); each employee belongs to one pay group at a time through the compensation record.MustR1[Proposed]
FR-PAY-007EPF settings per legal entity from the statutory pack: rates, wage ceiling, employer split, EDLI and admin charges, per-employee options (contribute on actual wages above ceiling, VPF %, EPF exempt/excluded with reason), EPS eligibility (age 58 cut-off, pre-existing membership).MustR1[Observed] SP-PAY-02 + [Proposed]
FR-PAY-008ESI settings: rates, wage threshold, contribution-period continuity, employer codes by state, "include employer contribution in CTC" toggle; zero-day reason codes.MustR1[Observed] SP-PAY-03 + [Proposed]
FR-PAY-009PT: enabled states per legal entity, slabs from the statutory pack by the employee's work state, special months, exemption flags (e.g. persons with disability where a state exempts them).MustR1[Observed] SP-PAY-13
FR-PAY-010LWF: enabled states, employee and employer amounts, frequency and deduction months from the statutory pack.MustR1[Proposed] (gap in [Observed])
FR-PAY-011Gratuity: monthly provision as an employer contribution (optional CTC component), eligibility rules and formula from the pack; payout computed in F&F (FR-PAY-060).MustR1[Observed] SP-PAY-07 redesigned
FR-PAY-012Company bank accounts (debit accounts): bank, IFSC, account, branch address, bank-file format, and flags for which account pays salary, EPF, ESI or PT.MustR1[Observed] SP-PAY-06
FR-PAY-013Typed payroll_policy: absent = LOP; OT included in salary; extra-day payment formula; LOP-linked week-off deduction; ESI/EPF behaviour on LOP; variable-pay frequency; advance and loan rules (FR-PAY-023/024); deduction priority; rounding; negative-net handling.MustR1[Observed] SP-PAY-07 consolidated
FR-PAY-014Minimum-wage check per state and skill category (where loaded in the pack): warning on compensation save and in pre-run validation.ShouldR1[Proposed]
FR-PAY-015Labour Codes wage check: if exclusions exceed 50% of total remuneration, add the excess to wages for EPF/gratuity bases per tenant setting; show the impact in the structure preview (verify the rule before enabling by default).ShouldR1[Proposed]
FR-PAY-016Variable DA: notification name, CPI points, rate per point, effective date, attachment; drives a VDA component.CouldR2[Observed] SP-PAY-08
FR-PAY-017Bulk salary revision: import or grid of new CTCs/templates with effective date, preview of monthly impact and arrears, revision letters (FR-EMP-016).ShouldR1[Observed] SP-PAY-11 + [Proposed]
FR-PAY-018Lite payroll profile: a "Simple" template (monthly salary × payable days / basis days, optional PT/EPF/ESI) on the same engine, with a simplified run screen.MustR1[Observed] research §21.5 (Lite report)
Inputs
FR-PAY-019Attendance and leave inputs from the locked ATT period (FR-ATT-035) including adjustments from earlier periods; the run shows the ATT lock version used.MustR1[Observed] research §16 + [Proposed]
FR-PAY-020One-time earnings and deductions per employee per run via a grid or import (incentive, bonus, fine, canteen, uniform), with component and remark.MustR1[Observed] SP-PAY-14 + [Proposed]
FR-PAY-021Recurring deductions: master (name, default amount) assigned to employees with start/end months.MustR1[Observed] SP-PAY-14
FR-PAY-022Variable pay plans: calculation period, distribution as monthly share or lump sum, amounts per employee (import), payout month.MustR1[Observed] SP-PAY-17
FR-PAY-023Advance salary request: eligibility (at least advance.min_payslips payslips, default 1; amount ≤ advance.max_pct_of_gross of last gross, default 100%; cooling-off months after last recovery); instalments (1–advance.max_instalments, default 6); approval line manager (optional) → payroll manager; disbursed in the next run or off-cycle.MustR1[Observed] E: Payroll Management, SP-PAY-07
FR-PAY-024Loans: type, principal, interest (0% default; simple or reducing), EMI schedule, start month; perquisite value flag for TDS on concessional loans (verify threshold).ShouldR1[Proposed]
FR-PAY-025Recovery ledger for advances and loans: scheduled EMIs, recovered amounts per run, pause/skip with approval, prepayment, outstanding balance, auto-flag to F&F at exit.MustR1[Observed] (recovery tracking) + [Proposed]
FR-PAY-026Salary hold and release per employee per run (with reason); held salaries are excluded from bank files and released in a later run or off-cycle.MustR1[Proposed]
FR-PAY-027Reimbursement payout: approved CLM claims flow as non-taxable/taxable reimbursement components into the next run (or a bank file outside payroll, per tenant setting).MustR2[Proposed] (fixes [Observed] gap)
Run lifecycle
FR-PAY-028Payroll run per pay group and period with type Regular, Off-cycle (Bonus, Correction, Arrears-only, Supplementary), F&F (R2) or Reversal; ID PR-{YYYYMM}-{NN}.MustR1[Proposed]
FR-PAY-029Run state machine and transition rules as in §7.7.5; every transition audited with actor, time, totals hash and comment.MustR1[Proposed]
FR-PAY-030Pre-run validations, blocking: missing compensation, missing or invalid bank account (unless payment mode is cash/cheque), attendance not locked (unless cut-off mode), structure balancing component negative, duplicate run. Warnings: missing PAN (higher TDS), missing UAN for EPF members, minimum-wage breach, ESI threshold crossing, new joiners and leavers in period, net pay change > variance.threshold_pct.MustR1[Proposed]
FR-PAY-031Calculation engine per §7.7.6: deterministic, exact decimal, idempotent; 1,000 employees in < 5 minutes (NFR-PERF-04); per-line explanation; frozen input snapshot.MustR1[Proposed]
FR-PAY-032Recalculate selected employees in Calculated or Reviewed state after input fixes, without recalculating others.MustR1[Proposed]
FR-PAY-033Variance report against the previous locked run: per employee and per component, absolute and %; highlights above variance.threshold_pct (default 10%) with reasons (revision, LOP change, new component, arrears).MustR1[Proposed]
FR-PAY-034Review workspace: filters (warnings, variance, new joiners, leavers, held), per-employee payslip preview, comments, hold/release, mark reviewed.MustR1[Proposed]
FR-PAY-035Approval through an NTF workflow (default: one level, org_owner or finance_admin), showing totals by component, headcount, variance summary and statutory totals; approve or send back with reason.MustR1[Proposed]
FR-PAY-036Segregation of duties (setting sod.payroll_editor_cannot_approve, default on): a user who edited compensation or inputs included in the run cannot approve it; in single-person tenants the owner can waive SoD with an audited acknowledgement.MustR1[Proposed]
FR-PAY-037Lock: freezes the run; artefacts stored with object lock; generates payslips, bank files, statutory files and (R2) journal; closes inputs for that period; later changes become arrears or adjustments.MustR1[Proposed]
FR-PAY-038Paid: mark paid in bulk or per employee, import bank response/UTR file, list failed transfers and re-issue them in an off-cycle run or a new bank file.MustR1[Proposed]
FR-PAY-039Reversal: create a reversal run for a locked or paid run (full or selected employees) with reason and approval; regenerate revised statutory files; original artefacts remain retrievable.MustR1[Proposed]
FR-PAY-040Arrears: back-dated compensation changes, back-dated attendance adjustments and back-dated statutory changes recompute the affected locked periods in a shadow calculation and pay the difference per component (including EPF/ESI/PT effects) as arrears lines in the next run; manual arrear entries by month and employee are also supported; arrears appear on the payslip with the source month.MustR1[Observed] SP-PAY-09 + [Proposed]
FR-PAY-041Off-cycle runs (bonus, correction, supplementary, arrears-only, advance disbursement) with their own lifecycle, selectable employees and components; statutory deductions computed on the combined monthly wages where the rules require it.MustR1[Proposed]
Payslips and payments
FR-PAY-042Payslip template (company logo, legal entity, employee details, PAN, UAN, bank masked, days summary: days in period, payable days, LOP; earnings, deductions, employer contributions (optional), arrears and variable pay with source, OT and extra days, net pay in figures and words, YTD totals, leave balances (optional), footer text); configurable layout within the template engine.MustR1[Observed] research §21.5 + [Proposed]
FR-PAY-043Payslip distribution: published in the app at payslip.publish_at (on lock or on pay date); email with password-protected PDF (default password pattern configurable, e.g. PAN + DOB); bulk download for HR; re-issue keeps version history.MustR1[Observed] SP-PAY-12 + [Proposed]
FR-PAY-044Bank transfer files: a generic NEFT/RTGS CSV plus bank-specific adapters (initial set of 3 banks chosen with pilot customers), split by debit account, excluding held and cash-paid employees, with control totals and a checksum.MustR1[Observed] SP-PAY-13/15 extended
Statutory outputs
FR-PAY-045EPF ECR file in the EPFO ECR text format (UAN, name, gross wages, EPF wages, EPS wages, EDLI wages, EE share, EPS share, ER share, NCP days, refund of advances) per establishment, with pre-generation validation (UAN format, wage arithmetic) and a summary.MustR1[Proposed] (extends [Observed] SP-PAY-13)
FR-PAY-046ESI monthly contribution file in the ESIC upload format (IP number, name, days paid, wages, reason code for zero/partial days) per employer code.MustR1[Proposed]
FR-PAY-047PT return data per state: employee-wise deduction and slab-wise summary in the format the state requires (CSV/Excel where no upload format exists).MustR1[Observed] SP-PAY-13 extended
FR-PAY-048LWF return data per state and period.MustR1[Proposed]
FR-PAY-049Statutory payment tracking: record challan/TRRN numbers, amounts and dates for EPF, ESI, PT, LWF and TDS per period, needed for 24Q and audit.ShouldR1[Proposed]
Income tax (TDS)
FR-PAY-050TDS engine: projects annual taxable salary (actuals to date + projected remaining months + declared and verified exemptions/deductions + previous-employer income), applies the employee's regime, slabs, standard deduction, rebate, surcharge and cess from the pack, and deducts (annual tax − TDS to date) / remaining months; handles one-time incomes in the month paid; manual override per employee per run with reason; tax worksheet visible to the employee.MustR1[Proposed] (replaces [Observed] SP-PAY-16)
FR-PAY-051Tax regime choice by the employee once per tax year in the declaration window (default: new regime if no choice), with a side-by-side tax comparison; HR can unlock a choice with reason.MustR1[Proposed]
FR-PAY-052IT declarations (Form 12BB-style): rent and landlord PAN (above threshold), home loan interest, investments and insurance, medical insurance, education loan, NPS, LTA, other deductions as enabled in the pack; open/close dates per tax year; declared amounts drive TDS until proofs are due.MustR1[Observed] research §21.5 (menu) + [Proposed]
FR-PAY-053Proof submission and verification: upload per declared item, verifier approves full/partial/rejects with reason; after the proof deadline TDS uses verified amounts only.MustR1[Proposed]
FR-PAY-054Previous-employer income and TDS for mid-year joiners (Form 12B-style data) entered by the employee or HR, included in projection and Form 16.MustR1[Proposed]
FR-PAY-055Form 16 (Part B generated; Part A imported from the TRACES download) per employee per tax year, digitally signable PDF, bulk generation and publication to employees.MustR2[Observed] research §21.5 (menu) + [Proposed]
FR-PAY-05624Q quarterly return data for salary TDS (deductee details, challan mapping, annexure II salary details in Q4) in a format importable into the return preparation utility; validation report.MustR2[Proposed]
FR-PAY-057Perquisite statement (Form 12BA-style) for employees with perquisites (concessional loans, company assets).ShouldR2[Proposed]
Accounting, F&F, self-service, dashboards
FR-PAY-058Payroll journal export on lock: CSV and Tally XML with ledger mapping per component, cost centre and legal entity; payable and statutory liability ledgers.MustR2[Proposed] (architecture.md §16)
FR-PAY-059API connectors to Zoho Books and ERP systems for journal posting.ShouldR4[Proposed]
FR-PAY-060F&F run hook: EXT triggers an F&F run type that computes salary to the last working day, leave encashment, gratuity (if eligible), notice pay or recovery, bonus/variable dues, loan and advance recovery, other deductions and TDS; the result is reviewed, approved, locked and paid like any run, and produces the F&F statement.MustR2[Proposed] (gap in [Observed])
FR-PAY-061Employee self-service (web and mobile): payslips by tax year and month (view, download), CTC breakup and history, YTD earnings and deductions, tax worksheet, regime choice, declarations and proofs, advance request and recovery status, Form 16 download (R2).MustR1[Observed] E: Payroll Management, research §21.5
FR-PAY-062Finance dashboard: payroll cost by month, department, location and legal entity; headcount paid; EPF/ESI/PT/LWF/TDS totals; run status per pay group; variance trend.MustR1[Observed] SP-PAY-01 + [Proposed]
FR-PAY-063Statutory bonus computation (Payment of Bonus Act: eligibility, wage ceiling, minimum/maximum %) as an off-cycle helper.CouldR2[Proposed]
FR-PAY-064Weekly or fortnightly pay frequencies.Won'tR1[Proposed] (revisit in R3 if factory demand appears)
FR-PAY-065Reproducibility: any locked run's payslips and files can be regenerated byte-for-byte from the snapshot for 8 years.MustR1[Proposed]

7.7.9 Key entities​

pay_component, formula, salary_structure / salary_structure_version / structure_component, compensation (employee, valid_from, valid_to, ctc_annual, structure_version_id, pay_group_id, reason), compensation_override, pay_schedule, pay_group, statutory_settings (per legal entity, type), company_bank_account, payroll_policy, pay_input (run, employee, component, amount, source), recurring_deduction, variable_pay_plan / variable_pay_entry, advance / loan / recovery_entry, salary_hold, pay_run (pay group, period, type, status, statutory_pack_version, att_lock_version, totals_hash), pay_run_employee (snapshot JSON, gross, deductions, net, status, hold), pay_run_line (component, amount, base, formula, explanation), arrear (source_period, component, amount), payslip (version, pdf_ref, published_at), bank_file, statutory_file (type, period, version, file_ref), statutory_payment, tax_regime_choice, it_declaration / it_declaration_item / it_proof, previous_employment_income, tds_projection, form16 (R2), return_24q (R2), journal_export (R2).

7.7.10 Configuration settings​

SettingTypeDefault (example)
pay_schedule.period_start_dayinteger 1–281 (calendar month)
pay_schedule.attendance_cutoff_dayinteger or nullnull
pay_schedule.salary_basisenum calendar_days / fixed_30 / fixed_26 / org_working_dayscalendar_days
pay_schedule.pay_dayinteger or "last working day"last working day
payslip.publish_atenum on_lock / on_pay_dateon_pay_date
payslip.password_patterntemplate{PAN}{DOB:DDMMYYYY}
run.auto_lock_on_approvalbooleanfalse
variance.threshold_pctdecimal10
rounding.netenum nearest_1 / up_1 / nonenearest_1
deduction.priorityordered liststatutory, TDS, loans, others
advance.min_payslips / max_pct_of_gross / max_instalments / cooling_off_monthsinteger / decimal / integer / integer1 / 100 / 6 / 3
tds.default_regimeenum new / oldnew
tds.declaration_window / proof_windowdate ranges per tax yearApr 1–Apr 30 / Jan 1–Jan 31
sod.payroll_editor_cannot_approvebooleantrue
reimbursement.payout_mode (R2)enum payroll / separate_bank_filepayroll
esi.include_employer_in_ctcbooleantrue
epf.restrict_to_ceilingboolean (per employee override)true

7.7.11 User stories​

US-PAY-01 — Structure template independent of CTC. As a finance_admin, I want one structure for all staff grades with Basic at 50% of CTC and a balancing Special allowance.

  • AC1: Given a template where Basic = 50% of monthly CTC, HRA = 40% of Basic, Conveyance = ₹1,600 flat and Special allowance is balancing, when I preview CTC ₹3,60,000, then the monthly breakup shows Basic ₹15,000, HRA ₹6,000, Conveyance ₹1,600 and Special allowance as the remainder after employer contributions.
  • AC2: Given a CTC so low that Special allowance would be negative, when I preview, then the template shows "Balancing component negative below CTC ₹X" and cannot be activated without a minimum-CTC rule.

US-PAY-02 — Increment with arrears. As a payroll_manager, I want an increment approved in November but effective 1 September to be paid as arrears.

  • AC1: Given September and October are locked, when I save the new compensation effective 1 September, then the November run shows arrears lines for September and October per component, with EPF and ESI recomputed on the arrears.
  • AC2: The payslip shows "Arrears: Sep 2026, Oct 2026" with amounts per component.

US-PAY-03 — Run payroll with validation. As a payroll_manager, I want blocking issues listed before I calculate.

  • AC1: Given 3 employees have no bank account, when I calculate, then the run stops with those 3 listed and links to fix them, unless I hold them.
  • AC2: Given all blocking issues are fixed, when I calculate 400 employees, then the run reaches Calculated in under 2 minutes and a variance report is available.

US-PAY-04 — Approve with four eyes. As an org_owner, I want to approve payroll on my phone and know that the preparer could not approve it.

  • AC1: Given the run is Reviewed, when I open the approval, then I see headcount, gross, net, employer cost, statutory totals and top variances.
  • AC2: Given SoD is on and Anil edited inputs, when Anil tries to approve, then the action is disabled with "You edited this run; another approver is required".

US-PAY-05 — Lock and generate files. As a payroll_manager, I want all files ready when the run locks.

  • AC1: When the run locks, then payslips, the bank file(s), ECR, ESI, PT and LWF files are generated, listed with checksums and downloadable.
  • AC2: Given the ECR has a UAN with 11 digits, then generation fails validation and names the employee before lock completes.

US-PAY-06 — Reverse a wrong run. As a payroll_manager, I want to reverse a locked run for 5 employees who were paid twice.

  • AC1: Given a locked run, when I request a reversal for 5 employees with a reason and it is approved, then a reversal run with negated lines is locked, the original shows "Partially reversed by PR-202611-02", and revised statutory files are generated.

US-PAY-07 — Choose tax regime and declare. As an employee, I want to compare regimes and declare my rent.

  • AC1: Given the declaration window is open, when I open Tax, then I see projected annual tax under both regimes and can choose one.
  • AC2: Given I choose the old regime and declare rent ₹15,000/month with landlord PAN, when the next run calculates, then my monthly TDS reflects the HRA exemption.
  • AC3: Given the proof deadline passes without proof, when the following run calculates, then TDS uses verified amounts only and I am notified.

US-PAY-08 — Advance salary. As an employee, I want an advance of ₹20,000 repaid over 4 months.

  • AC1: Given I have at least one payslip and my last gross was ₹30,000, when I request ₹20,000 in 4 instalments, then the request goes for approval.
  • AC2: Given it is approved and disbursed in November, then December–March payslips show ₹5,000 recovery each and the recovery ledger shows the balance.

US-PAY-09 — Payslip on mobile. As an employee, I want to see my payslip and understand LOP.

  • AC1: Given November is published, when I open Payslips, then I see net pay, earnings and deductions, payable days and LOP days, and can download a PDF.
  • AC2: When I tap "LOP 1.5 days", then I see the dates and statuses from attendance that caused it.

US-PAY-10 — Mid-month joiner. As a payroll_manager, I want joiners paid pro-rata.

  • AC1: Given an employee joined on 16 November with a 30-day calendar month, when the run calculates, then prorated components use 15/30 and days before joining are not counted as LOP.

US-PAY-11 — Held salary. As a payroll_manager, I want to hold an absconding employee's salary.

  • AC1: Given I hold the salary with a reason, when the run locks, then the employee is excluded from the bank file but included in statutory files per the rules, and the held amount appears in a "Held salaries" report until released.

7.7.12 Permissions​

ActionOWNHRAHRMFNAPRMLMEMPAUD
Components, templates, statutory settings, bank accounts, payroll policyORG——ORGORG(R)——ORG(R)
Compensation create/reviseORG——ORGORG (if granted)—view SELFORG(R) masked
One-time and recurring inputsORG—LOC* (non-salary inputs, if granted)ORGORG——ORG(R)
Create/calculate/review runORG——ORG(R)ORG——ORG(R)
Approve runORG——ORG————
Lock, mark paid, request reversalORG——ORGORG———
Approve reversalORG——ORG————
Download bank/statutory filesORG——ORGORG——ORG(R)
Advance/loan approvalORG——ORGORGTEAM (first level, optional)request SELF—
Verify IT proofsORG——ORGORG—submit SELF—
View payslipsORG——ORGORG—SELFORG(R)

hr_admin and hr_manager have no salary access by default; tenants may grant it through a custom role.

7.7.13 UI/UX​

  • Payroll workbench (web): a run page with a stepper Draft → Calculated → Reviewed → Approved → Locked → Paid; tiles for headcount, gross, net, employer cost; tabs Validations, Employees (grid with filters and payslip preview), Variance, Inputs, Files, Activity. Every money figure is right-aligned with en-IN grouping (₹1,23,456.00).
  • Set-up: component editor with formula editor (autocomplete for component codes, live validation, "test with employee"); structure template preview across a CTC range; compensation editor with a timeline of versions.
  • Approver (mobile and web): approval card with totals, variance highlights and statutory totals; Approve / Send back.
  • Employee mobile: Pay tab with latest net pay, payslip list by tax year, "How was this calculated?" drill-down, Tax (regime comparison, declarations, proofs with camera upload), Advances.
  • States: no compensation → "Your salary details are not set up yet; contact HR". Run blocked → validation list with "Fix" links. Locked run → read-only banner with lock time and actor. Payslip not yet published → "November payslip will be available on 30 Nov".

7.7.14 Notifications and automation​

Attendance lock reminder (to HR, from PAY calendar); run calculated with warnings; review complete → approval requested; approved; locked (files ready); payslip published (employees, push + email); payment failed (PRM); declaration window opening/closing (employees, 7 days and 1 day before); proof deadline; proof verified/rejected; advance decision and disbursement; loan EMI paused; statutory due-date reminders (EPF/ESI 15th of next month, TDS 7th, PT per state — examples to verify); statutory pack changed (PRM).

7.7.15 Reports and analytics​

Payroll register (salary register), payslip bulk export, bank-wise salary summary, EPF report and ECR, ESI report and file, PT report by state, LWF report, TDS projection and deduction register, declarations and proofs status, CTC report, payroll cost by department/location/cost centre, variance report, arrears report, advance and loan recovery report (fixes the empty Spryple report section), held salaries, payable-days report, statutory payment register, Form 16 status (R2), 24Q validation (R2). See §13.

7.7.16 Edge cases​

  • Mid-period revision → two segments prorated by days; statutory computed on the total.
  • Employee crosses the ESI threshold mid contribution period → continues ESI until the period ends (per pack rules).
  • Employee transfers state mid-month → PT and LWF per the state rule for that month (default: state on the last day of the period; configurable).
  • Negative net → apply the deduction priority; carry forward the remainder; warn in review.
  • Exit in the period before EXT is live (R1) → salary to the last working day in the regular run; F&F items handled as manual one-time inputs.
  • Statutory pack correction after lock → no automatic change; a banner offers an arrears or correction run.
  • Missing PAN → TDS at the higher rate per the pack; warning in validation.
  • Rounding differences between component sum and net → a rounding line keeps net = gross − deductions exactly.
  • Reversal after statutory filing → revised files are generated; the UI reminds the user that portal revisions are manual.
  • Two pay groups for one employee in the same period (transfer between legal entities) → two runs; each legal entity files its own part; TDS projection combines both.

7.8 NTF — Notifications & Workflow (approvals engine)​

Traces to: BR-NTF-* · Release: R0 core (templates, email/push/in-app, approval engine), R1 (SMS, WhatsApp, escalation, digests), R2 (N-level workflows, webhooks)

7.8.1 Purpose and scope​

NTF delivers every message Spyrl sends and runs every approval. Modules publish domain events; NTF turns them into notifications through templates and channels, and turns requests into approval tasks through workflow definitions stored as data.

In scopeOut of scope
Template catalogue with tenant overrides; channels (in-app, email, push, SMS, WhatsApp); preferences, quiet hours, digests; delivery tracking and retries; approval workflow engine (levels, conditions, approver resolution, delegation, escalation); unified approvals inbox; scheduled reminder rules; outbound webhooks (R2)Marketing campaigns; two-way chat; editing every UI message (replaced by i18n bundles)

7.8.2 Reference product summary​

  • Approvals follow one pattern (Submitted → Approved/Rejected with reason; edit/delete while Submitted; History tabs) across attendance, leave, comp-off, permission, shift change, separation, timesheet and claims [Observed] (research SP-X-03). On-behalf requests are auto-approved [Observed] (SP-X-04).
  • Email notifications for onboarding, documents, induction, password reset and timesheet defaulters; leave emails are configurable [Observed] (SP-X-09). A Messages Master per module lets admins edit success/error messages shown with their screen name [Observed] (SP-X-02).
  • Multi-level approval, delegation and escalation are not documented [Inferred] (research §20 Q2).

7.8.3 What we change and why [Proposed]​

  • Workflow as data: one engine and one inbox for every request type, with levels, conditions, delegation and SLA escalation.
  • Reliable delivery: transactional outbox, retries and delivery status, so "I never got the email" can be checked.
  • Messages Master is replaced by i18n resource bundles plus tenant overrides of notification templates and selected labels (FR-ORG-017); editing every UI string per tenant is a maintenance trap.
  • India channels: DLT-registered SMS templates and opt-in WhatsApp as a metered add-on.

7.8.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-NTF-001Template catalogue keyed by event (§12) with per-channel variants, sandboxed Handlebars-like syntax, merge-field picker, preview with sample data, versioning and per-tenant overrides that can be reset to default.MustR0[Observed] SP-X-09 + [Proposed]
FR-NTF-002Channels: in-app inbox, email (SES, ap-south-1), push (Expo → FCM/APNs) in R0; SMS (MSG91/Gupshup) in R1; WhatsApp (Meta Cloud API via a BSP, add-on) in R1. Channel adapters are interchangeable.Must (WhatsApp: Should)R0/R1[Proposed]
FR-NTF-003SMS uses DLT-registered templates and sender IDs (India); WhatsApp uses pre-approved templates and requires recorded user opt-in.MustR1[Proposed]
FR-NTF-004User preferences per category and channel; categories flagged mandatory (security, payslip published, approval assigned) cannot be fully disabled (at least in-app stays on).MustR1[Proposed]
FR-NTF-005Quiet hours for push/SMS/WhatsApp (tenant default 21:00–08:00 local time, user-adjustable) except security and punch-related messages; approver daily digest option.ShouldR1[Proposed]
FR-NTF-006Delivery pipeline from the transactional outbox: retries with exponential backoff (max 5), provider failover for SMS, bounce/complaint handling for email, per-message status (queued, sent, delivered, failed, read for in-app), dead-letter queue and admin resend.MustR0[Proposed]
FR-NTF-007Workflow definitions per request type: ordered steps (R1: max 2 levels), each with an approver rule, optional condition (e.g. leave.days > 3, claim.amount > 5000, request.backdated = true), and an action on timeout; tenant default workflows are seeded per request type.MustR0[Proposed]
FR-NTF-008Approver resolution: line_manager, manager_of_manager, department_head, hr_of_location, role@scope, named user; resolved when the step starts. When the resolved approver changes (manager change, exit, role removal), pending tasks are reassigned to the new approver from the effective date and both are notified. If no approver resolves, the task goes to the tenant's fallback approver (default hr_admin).MustR0[Proposed]
FR-NTF-009Delegation: an approver delegates all or selected request types for a date range; the delegate acts "on behalf of"; auto-suggested when the approver has approved leave.MustR1[Proposed]
FR-NTF-010SLA reminders and escalation per step: remind after remind_after_hours (default 24), escalate after escalate_after_hours (default 72) to the next level or fallback approver, or auto-approve/auto-reject where the tenant explicitly configures it (never for payroll approval).MustR1[Proposed]
FR-NTF-011Unified approvals inbox (web and mobile): all pending tasks across modules with filters, context (balances, conflicts, attachments), bulk approve/reject with a common reason, deep links from push and email that require normal authentication.MustR1[Observed] SP-ATT-05 + [Proposed]
FR-NTF-012N-level workflows (max 5 steps) and parallel steps (any-one or all-of).ShouldR2[Proposed]
FR-NTF-013Scheduled reminder rules configurable by tenants from a catalogue (e.g. "document expiring in N days", "probation ends in N days", "birthday today"), with recipients and channels.ShouldR1[Proposed]
FR-NTF-014In-app inbox: read/unread, mark all read, filters, 90-day retention.MustR0[Proposed]
FR-NTF-015Email branding (logo, sender display name, reply-to) and, for Enterprise, a custom sending domain with SPF/DKIM verification.Should (custom domain: R2)R1[Proposed]
FR-NTF-016Outbound webhooks for selected domain events (employee.created, leave.approved, payroll.locked, punch.created …): HMAC SHA-256 signatures, retries with backoff, DLQ, replay, per-endpoint event filters.MustR2[Proposed] (architecture.md §16)
FR-NTF-017Tenant-editable text for every UI success and error message (Spryple Messages Master).Won't—[Observed] SP-X-02 replaced
FR-NTF-018One-click approve directly from an email without signing in.Won't—[Proposed] (security)

7.8.5 Key entities​

notification_template (event_key, channel, locale, version, body, tenant override), notification (recipient, event, channel, status, attempts, provider_ref), notification_preference, outbox_event, workflow_definition (request_type, version, steps[]), workflow_instance (request ref, current step, status), approval_task (approver, on_behalf_of, due_at, escalated, decision, reason), delegation, reminder_rule, webhook_endpoint, webhook_delivery.

7.8.6 Configuration settings​

SettingTypeDefault
workflow.<request_type>workflow definitionline manager, 1 level (payroll run: OWN or FNA)
workflow.fallback_approverrole or userhr_admin
sla.remind_after_hours / escalate_after_hoursinteger24 / 72
quiet_hourstime range21:00–08:00
channels.enabledsetin-app, email, push
digest.approversenum off / daily 09:00off
whatsapp.enabledboolean (add-on)false

7.8.7 User stories​

US-NTF-01 — Two-level leave approval. As an hr_admin, I want leave longer than 3 days to need HR approval after the manager.

  • AC1: Given a workflow with step 1 line manager and step 2 hr_of_location when days > 3, when an employee applies for 5 days, then after the manager approves, the HR task is created and the request shows "Approved by manager, pending HR".
  • AC2: Given 2 days, then only the manager approves.

US-NTF-02 — Manager on leave. As a line_manager going on leave, I want my approvals handled.

  • AC1: Given my leave is approved, when I open the inbox, then I am offered delegation to a chosen colleague for my leave dates.
  • AC2: Given I did not delegate and a task waits 72 h, then it escalates to my manager and both of us are notified.

US-NTF-03 — Manager change. As an hr_manager, I want pending requests to follow the new manager.

  • AC1: Given an employee's reports_to changes effective today, when the change is saved, then their 3 pending tasks move to the new manager and the old manager loses access to them.

US-NTF-04 — Delivery check. As an hr_manager, I want to see whether an employee received their activation SMS.

  • AC1: Given a failed SMS, when I open the employee's notification log, then I see status Failed with the provider reason and a Resend button.

US-NTF-05 — Customise a template. As an hr_admin, I want the payslip email to include a line in Telugu.

  • AC1: Given I edit the payslip-published email template, when I preview with sample data, then merge fields render and invalid fields are highlighted before save; Reset restores the default.

7.8.8 Permissions​

ActionOWNHRAHRMFNAPRMLMEMP
Edit templates and channelsORGORG—payroll templates———
Edit workflowsORGORG (non-payroll)—ORG (payroll)———
Act on approval tasksassignedassignedassignedassignedassignedassignedassigned (swap consent)
Delegate own approvalsSELFSELFSELFSELFSELFSELF—
View delivery logsORGORGLOC*———SELF
Manage webhooks (R2)ORGORG—————

7.8.9 UI/UX​

  • Inbox (web and mobile): tabs "To approve", "My requests", "Notifications"; cards show request type icon, employee, dates, key numbers and risk chips (conflict, backdated, over limit); swipe actions on mobile; bulk select on web.
  • Workflow editor (web): a vertical list of steps with approver rule, condition builder (field, operator, value) and timeout action; test with an example request.
  • Template editor: split view (editor, live preview), channel tabs, character count for SMS.
  • Empty states: "You're all caught up" in the inbox; "No custom templates; defaults are in use".

7.8.10 Notifications and automation​

NTF owns the catalogue in §12 and the escalation automation (FR-NTF-010).

7.8.11 Reports and analytics​

Approval turnaround by request type and approver, SLA breaches and escalations, notification delivery rates by channel, failed messages, SMS/WhatsApp usage (metered).

7.8.12 Edge cases​

  • An approver is also the requester (e.g. a manager with no manager) → step resolves to the fallback approver; never self-approval.
  • A request is edited while in step 2 → approvals reset to step 1 (§6.2).
  • Escalation target is on leave with delegation → the delegate receives it.
  • Provider outage → messages queue and retry; push and in-app continue; SMS fails over to the secondary provider.

7.9 RPT — Reporting, Dashboards & Exports​

Traces to: BR-RPT-* · Release: R1 (standard reports, dashboards, exports); R4 (custom report builder, advanced analytics)

7.9.1 Purpose and scope​

RPT provides one report framework: dataset definitions with scope-aware filters, column choice, export and scheduling, so "the same report per role" is one report evaluated at each role's data scope. Module sections list their reports; the full catalogue is §13.

In scopeOut of scope
Report framework; standard report catalogue; persona dashboards; exports (Excel, CSV, PDF); saved views; scheduled delivery; KPI definitions; export governance; custom report builder and advanced analytics (R4)A general BI tool; embedding third-party BI (customers can use exports or the API)

7.9.2 Reference product summary​

  • Super Admin dashboard: employee count by location; employees by department by location; headcount (active, new, exit); attendance by work type (WFH, WFO, on duty, absent); employees on leave by department; leave counts; shift-based headcount by department; payroll amount by department by month [Observed] (SA: Super Admin Dashboard).
  • Excel and PDF export on almost every report; a common filter idiom City-Branch → Manager → Employee → Period with Search and Clear [Observed] (SP-X-05, SP-X-06). Employee report with a column chooser [Observed] (SP-RPT-01).
  • Reports are re-implemented per role and module, with no saved filters, scheduling, custom builder, drill-down or trend analytics [Inferred] (research §14).

7.9.3 What we change and why [Proposed]​

  • One framework, scope-aware: the same "Monthly attendance" report shows a line manager their TEAM and HR their LOCATION; less code, consistent numbers.
  • Saved views and scheduled email delivery for routine month-end packs.
  • Governed exports: masking, audit and watermarks, because exports are the main leak path for salary data.
  • Custom builder only in R4, after the standard catalogue proves which datasets matter.

7.9.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-RPT-001Report framework: each report is a dataset definition (fields, types, sensitivity class, default columns), filters and permissions; row-level filtering by the viewer's (permission, scope); column chooser, sort, group totals.MustR1[Proposed]
FR-RPT-002Standard filter bar: Legal entity → Location → Department → Manager → Employee → Period, plus status and search; Clear resets.MustR1[Observed] SP-X-06
FR-RPT-003Standard report catalogue as in §13 for R1 modules.MustR1[Observed] module reports + [Proposed]
FR-RPT-004Exports to Excel (xlsx), CSV and PDF; reports above 10,000 rows run asynchronously with an in-app/email link valid 24 h.MustR1[Observed] SP-X-05 + [Proposed]
FR-RPT-005Export governance: sensitive columns are omitted or masked unless the user holds the sensitive permission; every export is audited (who, report, filters, row count); PDFs carry a watermark with user and timestamp.MustR1[Proposed]
FR-RPT-006Persona dashboards: Owner (headcount, joiners/leavers, attendance today by status, payroll cost trend, pending approvals, compliance due dates), HR (exceptions, documents pending, probation due), Line manager (team today, approvals, leave calendar), Payroll (run status, variance, statutory totals), Employee (attendance month, balances, latest payslip). Includes the Spryple-equivalent org widgets listed in §7.9.2.MustR1[Observed] SA dashboard + [Proposed]
FR-RPT-007Drill-down from every dashboard tile to the underlying filtered list.ShouldR1[Proposed]
FR-RPT-008Saved views (filters + columns) per user, shareable with users who have the same permission.ShouldR1[Proposed]
FR-RPT-009Scheduled delivery: daily, weekly or monthly email of a saved view to users (evaluated at each recipient's scope) as a secure link; attachments only for non-sensitive reports.ShouldR1[Proposed]
FR-RPT-010KPI definitions with documented formulas: attrition rate, absenteeism %, late %, OT hours and cost, payroll cost per employee, leave utilisation, approval turnaround.ShouldR1[Proposed]
FR-RPT-011Custom report builder over curated datasets (fields, filters, grouping, simple charts), respecting scopes and sensitivity.ShouldR4[Proposed]
FR-RPT-012Advanced analytics: trends, attrition cohorts, absence patterns, OT cost forecasting, payroll cost forecasting.CouldR4[Proposed]
FR-RPT-013Scheduled data feed (daily CSV to customer S3/SFTP) for external BI.CouldR4[Proposed]

7.9.5 Key entities​

report_definition (key, dataset, fields, sensitivity), saved_view (owner, filters, columns, shared_with), report_job (status, rows, file_ref, expires_at), report_schedule (view, cron, recipients), kpi_definition.

7.9.6 Configuration settings​

reports.async_threshold_rows (default 10,000), reports.link_ttl_hours (24), reports.pdf_watermark (on), schedule.max_per_user (10).

7.9.7 User stories​

US-RPT-01 — Scope-aware report. As a line_manager, I want the monthly attendance report for my team only.

  • AC1: Given I open Monthly attendance, then only my TEAM appears, and the Location filter lists only locations where my team works.

US-RPT-02 — Large export. As an hr_manager, I want a 30,000-row punch export.

  • AC1: Given the result exceeds 10,000 rows, when I export, then the job runs in the background and I get a link within 15 minutes, valid for 24 h.

US-RPT-03 — Masked export. As an hr_manager without salary permission, when I export the employee master, then bank and CTC columns are not included and the export is audited.

US-RPT-04 — Monthly pack. As a payroll_manager, I want the payroll register emailed to the owner on lock day.

  • AC1: Given a schedule "on payroll lock", when the run locks, then the owner receives a secure link to the register.

7.9.8 Permissions​

Each report inherits the module's read permission and scope (e.g. att.day.read@TEAM). Owner and auditor see all reports at ORG scope (auditor read-only; no schedules). Payroll reports require pay.*.read. Export requires rpt.export in addition to the read permission (seeded for all admin and manager roles; employees can export only their own data).

7.9.9 UI/UX​

  • Reports hub (web): grouped by module, search, favourites, recently run; a report page with the filter bar, preview grid (first 500 rows), Export menu, Save view, Schedule.
  • Dashboards: tile grid with responsive layout; each tile has a title, number, trend vs last period and a "View list" link; charts follow the accessible palette (§10).
  • Mobile: dashboards for owner, line manager and employee; reports are web-only except "Team today" and personal statements.
  • Empty state: "No data for the selected filters" with a Clear filters button; first-use dashboards show setup prompts.

7.9.10 Notifications and automation​

Export ready; scheduled report delivered; schedule failed (to owner of the schedule).

7.9.11 Reports and analytics​

See §13 for the full catalogue.

7.9.12 Edge cases​

  • A scheduled report's recipient loses permission → that recipient is skipped and the schedule owner is notified.
  • Data changes during a long export → exports read from a consistent snapshot (one transaction or a replica at a point in time).
  • Employee transferred mid-period → scope is evaluated on the record's effective assignment for each date (a manager sees days when the employee was in their team).

7.10 MOB — Mobile app (single app, role-based) + Kiosk mode​

Traces to: BR-MOB-* · Release: R1 (ESS + MSS), R2 (kiosk + face verification), R3 (field features)

7.10.1 Purpose and scope​

One Expo app for iOS and Android serves employees, managers, field staff and shared kiosks, with navigation driven by roles and entitlements (ADR-014).

In scopeOut of scope
App shell, company-code onboarding, ESS, MSS, push, offline punch and cached reads, app security, version enforcement, kiosk mode, face enrolment and verification, field features (R3, specified in FFM)Separate apps per product; tablet-optimised admin; smartwatch apps

7.10.2 Reference product summary​

  • Four apps: Spryple HCM (attendance requests, face self check-in/out, approvals, Today Attendees, capture employee image, configure location, leave, payslips, Rewards & Recognition, Receptionist front-office check-in), Spryple Lite (add employee with monthly salary and shift, face profiles, reports), Spryple CRM (punch with photo, clients, activities, travel, leave) and Claims installed as "Spryple CRM" [Observed] (MOB: Spryple HR, Spryple Lite, Sales CRM Mobile Application, Claims Management; research §15).
  • Face enrolment by manager or receptionist with Verified/Not Verified status; kiosk "Face Detections" with all/selected employees and camera flip; no liveness cue visible [Observed] (research §21.3). Lite was last released 2024-08 [Observed] (research §21.1).
  • Store listings say "No data collected" while also "Shares location" [Observed] (research §21.1).

7.10.3 What we change and why [Proposed]​

  • One app, so employees install once and Lite is a plan, not a product.
  • Kiosk mode replaces the receptionist login: a locked, location-scoped, punch-only device with face + liveness or PIN.
  • Consent-gated face templates and accurate store data-safety declarations.
  • Offline-first punching for factories and basements.

7.10.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-MOB-001Single Expo app (iOS 15+, Android 9+/API 28+) with role- and entitlement-driven tabs: Home, Attendance, Leave, Pay, Inbox, Me; Team for managers; Field for field executives (R3).MustR1[Proposed]
FR-MOB-002Company-code onboarding: resolve tenant → API base URL and branding; remember the tenant; support switching tenants for users with accounts in more than one.MustR1[Observed] SP-X-10 + [Proposed]
FR-MOB-003ESS: punch card, alerts, attendance calendar and requests, leave apply/history/balances, comp-off, optional holidays, payslips and tax, advances, profile and documents, holidays, policies, notifications inbox.MustR1[Observed] research §15
FR-MOB-004MSS: team today, approvals inbox with bulk actions, team calendar, roster view and simple edits, on-behalf requests, device approvals, OT claims.MustR1[Observed] research §15
FR-MOB-005Offline: punch queue (FR-ATT-005); cached read-only data (last 3 payslips, balances, holidays, calendar of the current month) with "last updated" time; clear offline banner. Requests other than punches require connectivity, but drafts are kept locally.MustR1[Proposed]
FR-MOB-006Push notifications with deep links into the relevant screen after authentication.MustR1[Proposed]
FR-MOB-007Device biometric (fingerprint/face ID) app unlock as a convenience, never as attendance proof.ShouldR1[Proposed]
FR-MOB-008Minimum supported version enforcement (426 Upgrade Required + store link) and OTA updates for JS-only fixes.MustR1[Proposed] (architecture.md §11)
FR-MOB-009Low-end device support: 2 GB RAM devices, install size ≤ 40 MB, usable on 2G/3G-class connections (punch payload ≤ 350 KB including selfie).MustR1[Proposed]
FR-MOB-010App security: tokens in secure storage; payslip and tax screens block screenshots on Android; rooted/jailbroken devices warned (block configurable); no sensitive data in logs or notifications text (e.g. "Your payslip is ready", not the amount).ShouldR1[Proposed]
FR-MOB-011Store data-safety and privacy labels declare location, photos, face data (R2) and their purposes accurately; in-app prominent disclosure before any OS permission prompt.MustR1[Proposed] (fixes [Observed] research §21.1)
FR-MOB-012Kiosk enrolment: HR enrols a device with a one-time kiosk code; the kiosk token is location-scoped and punch-only; the device shows only the kiosk screen (with OS pinning/guided-access guidance); exit needs an admin PIN.MustR2[Observed] SP-ATT-19 redesigned
FR-MOB-013Kiosk identification: face 1:N within the kiosk's location with liveness detection, or employee code + PIN; confirmation screen with name and photo; configurable "face + PIN" for high-assurance sites.MustR2[Proposed]
FR-MOB-014Face enrolment with explicit consent (FR-IAM-018): self-enrolment or assisted by HR/manager/kiosk operator; liveness at enrolment; store templates/embeddings rather than images where the provider allows; status Verified/Not verified; re-enrol and delete.MustR2[Observed] research §21.3 + [Proposed]
FR-MOB-015Face verification (1:1) on personal-device punches when the attendance policy requires it, with a match threshold and fallback to selfie + manager review on failure.ShouldR2[Proposed]
FR-MOB-016Kiosk offline mode: accepts PIN punches with a photo while offline, flags them offline, and verifies face on sync where possible.ShouldR2[Proposed]
FR-MOB-017Kiosk operator assisted punch for selected employees (e.g. visitors without phones), with reason and photo.MustR2[Observed] SP-ATT-19 (Receptionist)
FR-MOB-018Field features (tracking, visits, clients, travel) inside the same app, enabled by the FFM entitlement.MustR3[Proposed]
FR-MOB-019Hindi, Telugu and Tamil UI (with tenant-selectable defaults).ShouldR2[Proposed] (architecture.md §8)

7.10.5 Key entities​

device (IAM), kiosk_device (location, token, status, last_seen), face_template (employee, provider_ref, version, consent_id, status), offline_queue_item (device-side), app_version_policy.

7.10.6 Configuration settings​

SettingTypeDefault
mobile.min_versionsemver per platformset per release
mobile.block_rootedbooleanfalse (warn)
kiosk.identificationenum face / pin / face_and_pinface
kiosk.liveness_requiredbooleantrue
face.match_thresholdprovider-specific decimalprovider default
face.retention_after_exit_daysinteger30

7.10.7 User stories​

US-MOB-01 — First run. As an employee, I want to set up the app in under a minute.

  • AC1: Given I enter company code "acme", then the app shows ACME branding and the login screen; after activation it opens Home with the punch card.

US-MOB-02 — Manager approvals on the go. As a line_manager, I want to approve five leave requests from a push notification.

  • AC1: When I tap the push, then the inbox opens after biometric unlock with the request; I can multi-select and approve all with one reason.

US-MOB-03 — Kiosk punch with liveness. As an employee at the factory gate, I want to punch by looking at the tablet.

  • AC1: Given I am enrolled, when I face the kiosk, then liveness passes, my name and photo appear and the punch is recorded within 2 s.
  • AC2: Given someone holds up my photo, then liveness fails, no punch is stored and the attempt is logged.

US-MOB-04 — Face consent. As an employee, I want to understand and control face enrolment.

  • AC1: Given I have not consented, when HR starts enrolment, then I see the purpose, retention and alternative (PIN) and must accept before capture.
  • AC2: When I withdraw consent, then my template is deleted within 24 h and the kiosk offers PIN for me.

US-MOB-05 — Forced upgrade. Given my app is below the minimum version, when I open it, then I see an upgrade screen with a store link and cannot punch until I upgrade (queued offline punches are still uploaded first).

7.10.8 Permissions​

Navigation and actions follow the user's roles (§9). Kiosk devices hold only att.punch.create@LOCATION for others and att.kiosk.*; they cannot read any employee data except the name and photo shown on a successful match. kiosk_operator can additionally perform assisted punches for their LOCATION.

7.10.9 UI/UX​

Mobile-first patterns in §10: bottom tabs, one primary action per screen, bottom-sheet forms, large touch targets (≥ 48 dp), status chips with text (not colour alone), skeleton loaders, pull-to-refresh, offline banner. Kiosk UI: full-screen camera with a guide oval, large clock, result screen for 3 s, high-contrast mode.

7.10.10 Notifications and automation​

Push for approvals, request outcomes, punch reminders, payslip ready, announcements (R2), device approval; kiosk offline alert to HR (R2).

7.10.11 Reports and analytics​

App adoption (DAU/MAU by role), app version distribution, offline punch share, kiosk usage and face-match failure rates (R2).

7.10.12 Edge cases​

  • Shared family phone → one user per device at a time; switching users clears cached data.
  • Low storage → selfie compression and queue size limit (max 200 queued punches) with a warning.
  • Time zone changed on the phone → server time rules; device time used only for offline punches with drift checks.
  • Kiosk loses power mid-sync → queued punches persist and upload on restart (idempotent).

7.11 CLM — Claims & Expense Reimbursement​

Traces to: BR-CLM-* · Release: R2 (R3 mileage from FFM travel; R4 OCR)

7.11.1 Purpose and scope​

CLM lets employees claim expenses with bills, applies an expense policy, routes claims through verification and finance approval, and pays them through payroll or a bank file.

In scopeOut of scope
Expense categories and policy (limits, receipts, per-diem, mileage); claims with multiple bills; duplicate detection; verify → approve → pay; payout via PAY or bank file; finance dashboard; mileage claims from FFM travel (R3); OCR (R4, Could)Corporate cards; travel booking; vendor payments; GST input-credit filing (we only capture GST fields)

7.11.2 Reference product summary​

  • A claim is one or more bills (reimbursement type, bill number, bill date, amount, file) plus a description → Submitted; employee tabs Submitted, In Progress, Paid, Rejected [Observed] (E: Claims Management).
  • The manager verifies and can reject individual bills and enter a verified amount (mobile); the Finance Manager approves verified claims and marks them Paid; finance dashboard with counts by status, settlement ratio, previous vs current scorecard and paid amount by type [Observed] (M: Claims Management; A: Claims Management; research §9).
  • Claim ID format CL_GEN_<company>_<n>; bill image required with a 2 MB limit; type "Food Charges" seen; mobile statuses Submitted, Verified, Paid, Rejected with a reason [Observed] (research §21.6).
  • CRM travel records go Pending → Verified → Approved → Claimed in a separate path [Observed] (M/E: CRM Field Force Management).
  • No limits, per-diem, mileage rates, duplicate detection or payroll payout are documented [Inferred] (research §9).

7.11.3 What we change and why [Proposed]​

  • An expense policy by category, grade and city tier, so limits are enforced at submission rather than argued at verification.
  • One status model for all roles and one pipeline for both bills and travel (mileage claims generated from FFM travel in R3).
  • Payout through payroll (or a bank file), closing the loop that Spryple leaves manual.
  • Duplicate detection on bill number, amount, date and vendor.

7.11.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-CLM-001Expense categories master (seeded: Food, Travel – local, Travel – outstation, Lodging, Fuel, Mobile/Internet, Mileage, Other) with GL code and tax treatment.MustR2[Observed] research §21.6 + [Proposed]
FR-CLM-002Typed expense_policy by applicability: per-category limits per bill/day/month, by grade and city tier; receipt required above an amount; per-diem rates; mileage rate per vehicle type; claim submission window (days after bill date, default 60); currency INR only.MustR2[Proposed]
FR-CLM-003Claim with one or more bills: category, bill number, bill date, vendor, amount, optional GSTIN and GST amount, attachment (pdf/jpg/png ≤ 5 MB, camera capture), description; claim ID CLM-{YYYY}-{NNNNN}; save draft; submit.MustR2[Observed] E: Claims Management + [Proposed]
FR-CLM-004Policy checks at submission: over-limit bills are blocked or flagged (per policy over_limit = block / flag with justification); missing receipt; outside window.MustR2[Proposed]
FR-CLM-005Duplicate detection on (bill number, amount, date, vendor) and on file hash across the tenant; duplicates are blocked or flagged for the verifier.MustR2[Proposed]
FR-CLM-006Unified statuses: Draft → Submitted → Verified → Approved → Paid, with Rejected (reason) from Submitted or Verified, and Withdrawn by the employee before verification. The same names appear for every role.MustR2[Observed] research §9 redesigned
FR-CLM-007Verification by line manager (workflow via NTF): per-bill accept, reject (reason) or reduce to a verified amount; a selected-records summary before confirming.MustR2[Observed] M: Claims Management
FR-CLM-008Finance approval by payroll_manager (or configured role) with bulk approve; the approved amount can only be ≤ the verified amount.MustR2[Observed]
FR-CLM-009Payout: approved claims flow to the next payroll run as reimbursement components (FR-PAY-027), or into a separate reimbursement bank file; status becomes Paid when the run is Paid or the file is marked paid.MustR2[Proposed]
FR-CLM-010Finance dashboard: counts and amounts by status (current month), settlement ratio (paid / total), previous vs current month scorecard, paid amount by category.MustR2[Observed] research §9
FR-CLM-011Mileage claims generated from verified FFM travel (km × policy rate), with the travel record attached, in the same pipeline.MustR3[Observed] travel approvals merged
FR-CLM-012Claim advances (cash advance against a trip, settled against claims).CouldR3[Proposed]
FR-CLM-013Receipt OCR to pre-fill bill fields.CouldR4[Proposed]
FR-CLM-014Outstanding claims at exit are listed in F&F (pay or reject).MustR2[Proposed]

7.11.5 Key entities​

expense_category, expense_policy (version), claim (code, employee, status, totals), claim_bill (category, bill_no, date, vendor, amount, gst, file, verified_amount, decision), claim_payout (run or bank file), mileage_claim_source (R3).

7.11.6 Configuration settings​

expense_policy.* (limits, receipts, per-diem, mileage, window), claims.over_limit (block / flag, default flag), claims.payout_mode (payroll / bank file, default payroll), claims.max_file_mb (5), workflow.claim (line manager verify → finance approve).

7.11.7 User stories​

US-CLM-01 — Submit a claim with bills on mobile. As a field_executive, I want to photograph three bills and submit one claim.

  • AC1: Given I add three bills with photos, when I submit, then I see claim CLM-2027-00042 with total ₹2,350 and status Submitted.
  • AC2: Given a food bill of ₹900 and a daily food limit of ₹600 with over_limit = flag, then I must add a justification before submitting.

US-CLM-02 — Verify per bill. As a line_manager, I want to reduce one bill and reject another.

  • AC1: When I set bill 1 to ₹600 verified and reject bill 3 with a reason, then the claim shows verified ₹1,450 and moves to Finance.

US-CLM-03 — Pay through payroll. As a payroll_manager, I want approved claims paid with salary.

  • AC1: Given claims approved by the 20th, when the November run calculates, then each employee's payslip shows "Reimbursement" lines and the claims become Paid when the run is Paid.

US-CLM-04 — Duplicate bill. Given the same bill number, amount and date were claimed last month, when I submit, then the bill is flagged "Possible duplicate of CLM-2027-00011" for the verifier.

7.11.8 Permissions​

ActionOWNHRAPRMFNALMEMP/FEXAUD
Categories and policyORGORGORG(R)ORG—own policy (R)ORG(R)
Submit / withdrawSELFSELFSELFSELFSELFSELF—
VerifyORG———TEAM——
Approve / mark paidORG—ORGORG———
View claimsORGORGORGORGTEAMSELFORG(R)

7.11.9 UI/UX​

Mobile-first claim capture (camera, multi-bill list, running total, policy hints per category); manager verification screen with bill images side by side and per-bill actions; finance web grid with bulk approve and dashboard. Empty state: "No claims yet. Tap + to add a bill." Errors: file too large shows the limit; over-limit shows the remaining allowance.

7.11.10 Notifications and automation​

Claim submitted (verifier), verified (finance, employee), approved, paid (employee), rejected (employee with reason), pending verification > 3 days (escalation), submission window closing for draft bills.

7.11.11 Reports and analytics​

Claims register (Applied on, Employee, Claim ID, bill count, requested, verified, approved, paid, status, action on/by — extends the observed column set), claims by category, settlement ratio trend, policy exceptions, duplicates flagged, outstanding claims at exit.

7.11.12 Edge cases​

  • Policy changes after a bill date → the policy version effective on the bill date applies.
  • Employee exits with claims in Submitted → routed to HR for decision in F&F.
  • Payroll run reversed after claims were marked Paid → claims return to Approved and are paid in the correction run.

7.12 EXT — Exit & Full-and-Final Settlement​

Traces to: BR-EXT-* · Release: R2

7.12.1 Purpose and scope​

EXT manages resignation, termination and other separations through to clearance, F&F settlement, letters and access revocation.

In scopeOut of scope
Resignation with approval chain; HR-initiated separation (termination, retirement, death, absconding, end of contract); notice period computation, shortfall, buy-out and waiver; clearance with owners; exit interview; F&F (via PAY-060); relieving and experience letters; access revocation; rehire eligibility; attrition analyticsLegal case management; gratuity trust administration; outplacement

7.12.2 Reference product summary​

  • Offboarding settings: automatic clearance reminders and a notice period in days [Observed] (A: Exit Management). Termination categories and separation reasons as masters [Observed] (A: Exit Management).
  • The employee raises a separation request (exit date, reason, notes), editable or cancellable before approval [Observed] (E: Exit Management). The HR Manager approves with an approved exit date or rejects — the reporting manager is skipped [Observed] (M: Exit Management); the rejection text says "approved" [Observed doc defect] (research §17 D7).
  • Termination by employee + category → termination checklist; backdated termination window 0–60 days (Rule 37) [Observed] (M: Exit Management; SP-IAM-03).
  • No F&F, exit interview, letters or access revocation are documented [Inferred] (research §8).

7.12.3 What we change and why [Proposed]​

  • Employee → line manager → HR approval with last-working-day (LWD) negotiation.
  • Clearance with task owners (IT, Finance, Admin, manager) using the EMP checklist engine.
  • F&F as a payroll run type, so settlement uses the same engine, approvals and files.
  • Automatic access revocation at LWD 23:59 local time (FR-IAM-017).

7.12.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-EXT-001Resignation request: proposed LWD, reason (master), notes, attachment; system shows the policy LWD from the notice period (FR-EMP-012) and the shortfall days; edit or withdraw before final approval.MustR2[Observed] E: Exit Management + [Proposed]
FR-EXT-002Approval workflow line manager → HR (NTF): approve with an agreed LWD, request a discussion, or reject with reason; status on_notice from approval.MustR2[Observed] M: Exit Management redesigned
FR-EXT-003Notice handling: shortfall recovery (days × daily rate, formula), buy-out by employee, waiver by HR with reason, leave adjustment against notice if the policy allows.MustR2[Proposed]
FR-EXT-004HR-initiated separation with type (Termination, Retirement, End of contract, Death, Absconding) and category master; back-dated LWD allowed up to separation.backdate_max_days (default 30, 0–60) and only into unlocked payroll periods.MustR2[Observed] Rule 37 + [Proposed]
FR-EXT-005Clearance: offboarding checklist templates by applicability with owners (IT: laptop, access; Finance: advances; Admin: ID card; Manager: handover), due relative to LWD, evidence, "No Due" sign-off per owner.MustR2[Observed] SP-EMP-01 + [Proposed]
FR-EXT-006Exit interview: a configurable short questionnaire sent near LWD; responses visible to HR only; aggregated reasons in analytics.ShouldR2[Proposed]
FR-EXT-007F&F initiation: when clearance is complete (or forced by HR), create an F&F run (FR-PAY-060) pre-filled with pending salary, leave encashment balance, gratuity eligibility, notice pay/recovery, outstanding advances/loans, pending claims (FR-CLM-014) and assets not returned; F&F statement PDF.MustR2[Proposed]
FR-EXT-008Letters: relieving letter and experience letter from templates after F&F lock (or on LWD per setting); service certificate.MustR2[Proposed]
FR-EXT-009Access revocation at LWD 23:59 location time; ex-employees keep read-only access to their payslips and Form 16 through a limited "alumni" login for alumni.access_days (default 365) if enabled.Must (alumni: Should)R2[Proposed]
FR-EXT-010Rehire eligibility flag and exit reason on the employment record.ShouldR2[Proposed]
FR-EXT-011Absconding process: after N consecutive absent days (default 7), prompt HR to start an absconding case with notices sent and salary hold.ShouldR2[Proposed]
FR-EXT-012Resignation withdrawal after approval, with approval, before LWD.MustR2[Proposed]

7.12.5 Key entities​

separation (type, reason, requested_lwd, approved_lwd, status, shortfall_days, buyout, waiver), separation_reason, termination_category, clearance (checklist), exit_interview, fnf_case (run ref, statement ref), alumni_access.

7.12.6 Configuration settings​

separation.backdate_max_days (30), workflow.resignation (LM → HR), notice.recovery_formula (e.g. (Basic + DA) / 30 × shortfall days), notice.allow_leave_adjustment (false), clearance.reminder_days (2), letters.issue_on (fnf_lock / lwd), alumni.enabled (true), alumni.access_days (365), absconding.days (7).

7.12.7 User stories​

US-EXT-01 — Resign with notice shortfall. As an employee, I want to resign and see my notice obligations.

  • AC1: Given a 30-day notice and a requested LWD 20 days away, when I fill the form, then I see "Shortfall 10 days; may be recovered or waived".
  • AC2: When my manager approves with LWD +25 days and HR approves, then my status is On notice and clearance tasks are created.

US-EXT-02 — Clearance owners. As the IT owner, I want my clearance task listed with the LWD so I collect the laptop on time.

  • AC1: Given LWD is 30 Nov, then my task is due 28 Nov and escalates to HR if not done by LWD.

US-EXT-03 — F&F. As a payroll_manager, I want the F&F pre-filled.

  • AC1: Given clearance is complete, when the F&F run is created, then it includes salary to LWD, EL encashment of 12 days, gratuity (eligible, 6 years), shortfall recovery of 5 days and an outstanding advance of ₹10,000, each with its formula.
  • AC2: When the F&F run is locked and paid, then the F&F statement and relieving letter are published to the employee's alumni access.

US-EXT-04 — Access revocation. Given LWD is today, when it is 23:59 at the employee's location, then the employee's sessions end and normal login is disabled; alumni login (if enabled) shows only payslips and letters.

7.12.8 Permissions​

ActionOWNHRAHRMPRMLMEMPClearance owner
Raise resignationSELFSELFSELFSELFSELFSELF—
Approve resignationORGORGLOC*—TEAM (level 1)——
HR-initiated separationORGORGLOC*—propose TEAM——
Clearance tasksORGORGLOC*finance tasksown tasksview SELFassigned
F&F runORG (approve)——ORG—view own statement—
Exit interview responsesORGORGLOC*——submit SELF—

7.12.9 UI/UX​

Employee: Resign screen with policy LWD and shortfall explanation; status timeline (Submitted → Manager → HR → On notice → Clearance → F&F → Relieved). HR web: Separations board by stage; clearance progress per employee; F&F link to the payroll run. Empty: "No active separations". Errors: back-dated LWD into a locked period is blocked with an explanation.

7.12.10 Notifications and automation​

Resignation submitted/decided; LWD reminders (7 days, 1 day) to employee, manager, clearance owners; clearance overdue; exit interview invitation; F&F ready for review; F&F paid; letters issued; access revoked (HR summary).

7.12.11 Reports and analytics​

Attrition (voluntary/involuntary, by department, location, tenure band, reason), notice compliance (shortfall, waivers, buy-outs), clearance ageing, F&F turnaround (LWD → paid), rehire-eligible alumni.

7.12.12 Edge cases​

  • Death of an employee → separation type Death; F&F payable to nominees (FR-EMP-003 nominations); no notice recovery; gratuity eligibility per statute regardless of service length (verify).
  • Employee on long leave during notice → leave beyond LWD cancelled automatically.
  • Resignation withdrawn after F&F created → F&F run is cancelled if not locked; otherwise HR is told a reversal is needed.

7.13 ENG — Engagement: Announcements, Recognition​

Traces to: BR-ENG-* · Release: R2

7.13.1 Purpose and scope​

ENG provides company announcements with audience targeting and read tracking, and peer recognition.

In scopeOut of scope
Announcements (targeted, scheduled, acknowledgements); recognition (types, messages, wall, reactions); birthday and work-anniversary feedSurveys and eNPS (§15); rewards catalogues and points redemption; social chat

7.13.2 Reference product summary​

  • Announcements: topic, title, publish from/to, description; Submit (Published) or Save as Draft; Published → edit/view/stop; Draft → edit/view; Completed → view/republish; Cancelled → view [Observed] (A: Employee Management; SP-ENG-01).
  • Rewards & Recognition in the HCM app: send to a peer with a recognition type and message; Sent/Received lists; counts per type per employee [Observed] (MOB: Spryple HR). Types: Birthday, Outstanding, Job Well Done, Congratulations, Performance-based recognition; template messages with a 145-character limit [Observed] (research §21.9).
  • No audience targeting, read receipts, reactions or public wall [Inferred] (research §13).

7.13.3 What we change and why [Proposed]​

Audience targeting and read receipts make announcements useful for compliance notices; a recognition wall with reactions increases visibility at near-zero cost.

7.13.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-ENG-001Announcements with topic, title, rich-text body (sanitised), attachments, publish from/to, statuses Draft → Scheduled → Published → Completed, Stopped/Cancelled, and republish.MustR2[Observed] SP-ENG-01
FR-ENG-002Audience targeting by location, department, designation, employment type or named list; preview of recipient count.MustR2[Proposed]
FR-ENG-003Read receipts and optional "acknowledge" button with an acknowledgement report (for policy notices).MustR2[Proposed]
FR-ENG-004Pin announcements; push/email on publish (configurable per announcement).ShouldR2[Proposed]
FR-ENG-005Recognition: send to one or more colleagues with a type from a tenant master (seeded with the five observed types) and a message (limit configurable, default 280 characters); visibility public (wall) or private.MustR2[Observed] research §21.9 + [Proposed]
FR-ENG-006Recognition wall with reactions and comments; admins can hide content with a reason (moderation).ShouldR2[Proposed]
FR-ENG-007Automatic birthday and work-anniversary posts (respecting an employee opt-out and hiding the birth year).ShouldR2[Proposed]
FR-ENG-008Manager-awarded points with redeemable rewards.Won'tR2[Proposed] (future, §15)

7.13.5 Key entities​

announcement (topic, title, body, audience_rule, from, to, status, ack_required), announcement_receipt (read_at, ack_at), recognition_type, recognition (from, to[], type, message, visibility), reaction, comment.

7.13.6 Configuration settings​

recognition.message_max_chars (280), recognition.default_visibility (public), eng.birthday_posts (on, with employee opt-out), announcement.default_channels (in-app + push).

7.13.7 User stories​

US-ENG-01 — Targeted policy notice. As an hr_manager, I want to send the new safety policy to Plant 1 and track acknowledgements.

  • AC1: Given audience Location = Plant 1 (412 employees), when I publish with acknowledgement required, then 412 employees receive it and the report shows acknowledged vs pending.

US-ENG-02 — Recognise a colleague. As an employee, I want to thank a colleague publicly.

  • AC1: When I choose "Job Well Done", write a message within the limit and send, then it appears on the wall and the colleague gets a push.

US-ENG-03 — Stop an announcement. Given a published announcement, when I stop it, then it disappears from feeds and its status becomes Stopped; it can be republished later.

7.13.8 Permissions​

ActionOWNHRAHRMLMEMPAUD
Create/publish announcementsORGORGLOC*TEAM (if enabled)——
View announcementstargetedtargetedtargetedtargetedtargetedORG(R)
Send recognition✓✓✓✓✓—
Moderate wall, manage typesORGORGLOC*———
Recognition reportsORGORGLOC*TEAMSELFORG(R)

7.13.9 UI/UX​

Home feed card for unread announcements; announcement detail with Acknowledge; recognition composer as a bottom sheet with type chips; wall as a scrollable feed. Empty state: "No announcements yet". Accessibility: rich text renders with headings and alt text for images.

7.13.10 Notifications and automation​

Announcement published (targeted channels), acknowledgement reminder (after 3 days), recognition received, birthday/anniversary (to the employee and optionally the team).

7.13.11 Reports and analytics​

Announcement reach (delivered, read, acknowledged), recognition counts per type per employee [Observed], top recognisers and recipients by department.

7.13.12 Edge cases​

Audience changes after publish (new joiner in Plant 1) → new eligible employees see active announcements; acknowledgement reports count them from their joining date. Recognition to an exited employee is blocked.

7.14 FFM — Field Force & Sales CRM​

Traces to: BR-FFM-* · Release: R3 (paid add-on, per tracked user)

7.14.1 Purpose and scope​

FFM lets field teams punch, record visits and activities against accounts, move leads through a configurable pipeline, collect payments, and get travel reimbursed, while managers see location and activity with privacy safeguards.

In scopeOut of scope
Consent-gated location tracking (two modes) between punch-in and punch-out; live map and route replay; kms with snap-to-road; visits with geo-verification; accounts, contacts and associates (shared with TSM); configurable pipeline; activities and follow-ups; lead ageing; payment collection; assignments and beat plans; travel → CLM mileage; offline captureProduct catalogue, quotes, orders and invoicing (Could, post-R4); territory optimisation; dealer management; marketing automation

7.14.2 Reference product summary​

  • GPS modes: Point-to-Point (route from punch-in, punch-out and visit activities) and GPS Monitoring (continuous from punch-in to punch-out); Google Maps; requires login, location permission and internet [Observed] (research §21.7). Manager GPS monitoring with battery % and punch counts [Observed] (M: CRM Field Force Management).
  • Pipeline: Leads, Call for Demo, Demo Pending, Demo Completed, Future Leads, with lead-age colours green 0–7 days, amber 8–14, red 15+ [Observed] (M: CRM Field Force Management; research §21.7). A second client status set: Interested, Follow-up, Won, Lost, Not Interested [Observed] (E: Sales CRM Web Application).
  • Activities: types VISIT, CALL, MESSAGE, MAIL; follow-up date/time; final price on Won [Observed] (research §21.7). Client associates (type, qualification, specialization) with sample data Doctor/MBBS/Cardiology, i.e. pharma field sales [Observed] (research §21.7). Client payments (method, collected amount; pending amount) [Observed] (research §21.7).
  • Visit location verification indicator: matched, not matched, not available (first visit sets the client location) [Observed] (research §21.7). Travel approvals Pending → Verified → Approved → Claimed with an editable KM Revised field [Observed] (research §21.7).
  • Reports: employee activity (visits, kms), tracking log (start/stay/travel durations, kms), employee summary [Observed] (M: CRM Field Force Management). Device approvals for new phones [Observed]. Leave and shift screens duplicated inside CRM [Observed] (research §21.7).
  • No documented consent, work-hours limits or retention for tracking [Inferred] (research §11).

7.14.3 What we change and why [Proposed]​

  • Privacy first: explicit consent, tracking only between punch-in and punch-out, visible indicator, raw GPS retention 90 days.
  • Configurable pipeline with industry templates (demo-led SaaS, pharma detailing, distribution) instead of two hard-coded status systems.
  • Geo-verification with enforcement choice (block, flag or allow) rather than an indicator only.
  • One Account/Contact model shared with TSM, and travel paid through CLM.
  • No duplicated ATT/LVE screens: the field app uses the same ATT/LVE features.

7.14.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-FFM-001Tracking consent (FR-IAM-018) with plain-language disclosure before OS permission prompts; tracking runs only between punch-in and punch-out; a persistent on-screen/notification indicator while tracking.MustR3[Proposed]
FR-FFM-002Tracking modes per policy: point_to_point (punches + visits only) and continuous (adaptive sampling: default every 60 s or 100 m when moving, paused when stationary).MustR3[Observed] research §21.7
FR-FFM-003Device telemetry with each batch: battery %, location permission state, GPS on/off, mock-location detection; gaps explained on the map ("GPS off 11:02–11:40").MustR3[Observed] battery % + [Proposed]
FR-FFM-004Manager live map (last known position, status, battery) and route replay for a date; Google Maps or Mappls through the maps provider interface.MustR3[Observed]
FR-FFM-005Distance: snap-to-road with outlier filtering (speed > 150 km/h, accuracy > 100 m discarded); daily kms per employee; manager revised km with mandatory reason, original kept.MustR3[Observed] KM Revised + [Proposed]
FR-FFM-006Accounts (organisations), contacts and associates with configurable associate types, qualifications and specialisations; account geo-location; custom fields; import; shared with TSM clients.MustR3[Observed] research §21.7 + [Proposed]
FR-FFM-007Visits: check-in and check-out at an account with photo (optional), notes and outcome; geo-verification against the account location within visit.match_radius_m (default 200); enforcement block, flag or allow; first verified visit can set a missing account location (with manager confirmation).MustR3[Observed] visit verification + [Proposed]
FR-FFM-008Configurable pipeline: stages per tenant (name, order, probability, won/lost flags) with templates; one status system; stage history.MustR3[Observed] redesigned
FR-FFM-009Activities (Visit, Call, Message, Mail + tenant types) with follow-up date/time, scheduled vs exceeded status, image-only activity option, final value on Won.MustR3[Observed] research §21.7
FR-FFM-010Lead ageing colours with configurable thresholds (default 0–7 green, 8–14 amber, 15+ red).ShouldR3[Observed] research §21.7
FR-FFM-011Payment collection against a won deal: method, amount, reference, receipt photo; pending amount; daily collection summary.ShouldR3[Observed] research §21.7
FR-FFM-012Assignments and beat plans: planned visits per day/week per executive; plan vs actual; reassignment of accounts and activities when an executive is unavailable.ShouldR3[Observed] reassignment + [Proposed]
FR-FFM-013Travel: daily travel record (kms, visits) → manager verify (revised km) → mileage claim in CLM (FR-CLM-011); minimum-visits rule for eligibility.MustR3[Observed] travel approvals merged
FR-FFM-014Offline: visits, activities and new accounts are queued offline with device time and synced later; GPS points are buffered up to 24 h.MustR3[Proposed]
FR-FFM-015Web add-client toggle and field-only creation options.CouldR3[Observed]
FR-FFM-016Retention: raw GPS points kept 90 days (configurable lower), then only daily aggregates (kms, durations); visit locations kept with the visit.MustR3[Proposed] (architecture.md §7)
FR-FFM-017Products, quotes and orders.Won'tR3[Proposed] (§15)

7.14.5 Key entities​

tracking_session (employee, punch refs, mode, consent_id), gps_point (monthly partitions: ts, lat, lng, accuracy, speed, battery), daily_travel (km_computed, km_revised, reason, status), account, contact, associate, associate_type, pipeline / pipeline_stage, deal (account, stage, value, owner), activity, visit (check-in/out, location, match_result), payment_collection, beat_plan / planned_visit.

7.14.6 Configuration settings​

tracking.mode (point_to_point / continuous), tracking.interval_s (60), tracking.distance_m (100), visit.match_radius_m (200), visit.enforcement (flag), lead_age.thresholds (7, 14), travel.min_visits (0), gps.retention_days (90, max 90), pipeline.template (selected at set-up).

7.14.7 User stories​

US-FFM-01 — Tracking only on duty. As a field_executive, I want tracking to stop when I punch out.

  • AC1: Given consent and continuous mode, when I punch in, then tracking starts and the indicator shows; when I punch out, then no further points are recorded.

US-FFM-02 — Geo-verified visit. As a field_executive, I want to check in at a hospital.

  • AC1: Given the account location and a 200 m radius with flag, when I check in 450 m away, then the visit is saved as "Location not matched" and my manager sees the flag.

US-FFM-03 — Revise kms. As a sales_manager, I want to correct inflated kms.

  • AC1: When I revise 84 km to 62 km with a reason, then the mileage claim uses 62 km and the record shows both values and my reason.

US-FFM-04 — Configure the pipeline. As a sales_admin, I want stages Prospect → Detailing → Sample given → Prescribing.

  • AC1: When I save the stages, then deals move through them and the pipeline board shows them in order with ageing colours.

US-FFM-05 — Battery gap explained. Given an executive's phone dies at 15:10, when the manager replays the route, then the map shows "No data 15:10–16:30 (battery 2%)".

7.14.8 Permissions​

ActionOWNSLASLMLMFEXHRAAUD
CRM masters, pipeline, tracking policyORGORGORG(R)——tracking policy ORGORG(R)
Live map, routesORG—TEAM / LOC*TEAMSELF——
Accounts, deals, activitiesORGORGTEAM—own + assigned—ORG(R)
Revise km, verify travelORG—TEAMTEAM———
Reassign accountsORGORGTEAM————

7.14.9 UI/UX​

Field app tab: Today (plan, follow-ups due, punch state), Accounts (search, nearby), Visit check-in (one tap, photo, outcome), Pipeline (list by stage), Collections. Manager web: map with team list (battery, last seen, status), route replay timeline, pipeline board, travel verification grid with a selected-records summary. Empty states guide to "Add your first account". Errors: permission denied shows how to enable location "while using the app" and the consequences.

7.14.10 Notifications and automation​

Follow-up due and exceeded, visit plan published, lead ageing to red, device pending approval, tracking stopped unexpectedly during duty (to employee and, optionally, manager), travel pending verification, payment recorded.

7.14.11 Reports and analytics​

Employee activity report (punches, visits, kms), tracking log, employee summary (first login, last logout, worked hours, new visits, new accounts, total visits, kms, activities) [Observed], visits vs plan, geo-verification exceptions, pipeline by stage and age, win rate, collections, travel and mileage cost.

7.14.12 Edge cases​

Mock-location apps detected → points flagged and manager alerted. iOS background limits → significant-change mode fallback with lower accuracy, labelled on the map. Two executives visiting the same account → both visits recorded; the account owner unchanged.


7.15 TSM — Timesheets & Projects​

Traces to: BR-TSM-* · Release: R3 (add-on)

7.15.1 Purpose and scope​

TSM records time against projects and tasks, with approvals, defaulter nudges and effort-variance reporting for services teams.

In scopeOut of scope
Clients (shared Accounts), projects, team assignment and project roles, tasks with estimates; weekly timesheet entry; attendance-hours cap; approvals; defaulters; period lock; dashboards; effort variance; billable-hours exportInvoicing and rates-to-invoice; resource capacity planning; Gantt charts

7.15.2 Reference product summary​

  • Admin: Clients (contact, designation, number, email, start date, address), Projects, Assign Team, Tasks, Project Roles with no duplicates [Observed] (A: Time Sheet Management).
  • Manager: dashboard (active projects, assigned employees, bench count, hours by project, status summary with and without variance, estimated vs consumed hours); Pending Approvals (bulk), History, Defaulters with "Send Notification" [Observed] (M: Time Sheet Management).
  • Employee: Submit Timesheet rows (date, project, task, description, hours, %, task completed) and a "limit timesheet hours to attendance hours" rule [Observed] (E: Time Sheet Management), which is not in the HR policy list [Observed doc defect] (research §17 D11).
  • Effort variance = (Actual − Planned) / Planned [Observed] (research §21.8).

7.15.3 What we change and why [Proposed]​

Shared Accounts with FFM; a weekly grid entry (faster than per-row forms); billable flag; period lock; reminders through NTF.

7.15.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-TSM-001Projects: client (Account), project manager, start/end dates, estimated hours or days, status, billable default; project roles; team assignment with allocation %.MustR3[Observed] A: Time Sheet Management
FR-TSM-002Tasks with estimate, assignee(s), dates, status, % complete.MustR3[Observed]
FR-TSM-003Weekly timesheet grid (rows = project/task, columns = days) with notes, billable flag, copy last week; daily entry on mobile.MustR3[Proposed]
FR-TSM-004Attendance cap: optional rule that daily logged hours ≤ ATT worked hours (+ tolerance); leave and holidays prefilled as non-working.ShouldR3[Observed] E: Time Sheet Management
FR-TSM-005Submit per week; approval by project manager or line manager (configurable) with bulk approve/reject; history.MustR3[Observed]
FR-TSM-006Defaulters list (missing or unsubmitted timesheets) with one-click reminders and scheduled automatic reminders.MustR3[Observed]
FR-TSM-007Period lock (monthly) after approval; corrections after lock need HR/PM unlock with reason.ShouldR3[Proposed]
FR-TSM-008Dashboards: active projects, bench count (employees with < N% allocation), hours by project, estimated vs consumed.MustR3[Observed]
FR-TSM-009Effort variance report (planned vs actual hours, actual dates, variance %).MustR3[Observed] research §21.8
FR-TSM-010Billable-hours export by client and project (CSV) for external invoicing.ShouldR3[Proposed]
FR-TSM-011Invoicing.Won'tR3[Proposed]

7.15.5 Key entities​

project, project_role, project_member (allocation), task, timesheet_week (employee, week, status), timesheet_entry (date, project, task, hours, billable, note), timesheet_period (lock).

7.15.6 Configuration settings​

timesheet.approver (project_manager / line_manager), timesheet.attendance_cap (off), timesheet.cap_tolerance_min (30), timesheet.reminder (Friday 16:00), bench.threshold_pct (20).

7.15.7 User stories​

US-TSM-01 — Weekly entry. As an employee, I want to fill my week in one grid.

  • AC1: Given two assigned tasks, when I enter hours per day and submit, then the week shows Submitted with total hours and goes to my approver.
  • AC2: Given the attendance cap is on and I worked 7 h on Tuesday, when I log 9 h, then I see "Exceeds attendance hours (7 h)".

US-TSM-02 — Defaulter nudge. As a line_manager, when I open Defaulters on Monday, then I see who has not submitted last week and can remind all with one action.

US-TSM-03 — Effort variance. As an org_owner, when I open Effort variance for Project X (planned 400 h, actual 460 h), then variance shows +15%.

7.15.8 Permissions​

ActionOWNHRAProject manager (role)LMEMPAUD
Projects, tasks, rolesORGORGown projects——ORG(R)
Log timeSELFSELFSELFSELFSELF—
Approve timesheetsORGORGown projectsTEAM (if approver)——
ReportsORGORGown projectsTEAMSELFORG(R)

7.15.9 UI/UX​

Web weekly grid with keyboard navigation and totals; mobile daily entry. Manager approvals in the unified inbox. Empty: "You are not assigned to any project". Locked weeks shown read-only.

7.15.10 Notifications and automation​

Weekly reminder; defaulter reminders; submitted/approved/rejected; project end approaching; task assigned.

7.15.11 Reports and analytics​

Timesheet summary (by employee, project, client), effort variance, bench report, billable vs non-billable hours, defaulters history.

7.15.12 Edge cases​

Employee removed from a project mid-week → existing entries stay; new entries blocked. Holiday in the week → prefilled; logging time on it is allowed only if attendance shows HP.


7.16 LMS — Learning Management​

Traces to: BR-LMS-* · Release: R4 (narrow scope)

7.16.1 Purpose and scope​

LMS delivers mandatory and optional courses, tracks completion and issues certificates, with priority on compliance training (POSH, safety, induction).

In scopeOut of scope
Course catalogue; simple course builder (modules → sections → content); SCORM 1.2 import; quizzes; mandatory assignments by applicability with due dates; completion tracking; certificates; reminders; reports; badges (Could)Authoring tools beyond the simple builder; live virtual classrooms; marketplace content; xAPI LRS

7.16.2 Reference product summary​

  • Instructor Course Builder (title, tags, description, difficulty, category, prerequisites, image) → Module → Section → Content → review → submit; dashboard with leaderboard, progress, badges by category, recommended courses; reports (enrolled, completed, badges, points, certificates) [Observed] (I: LMS Instructor).
  • Employee: Course Library, assessments, Learning Sphere, My Badges, My Certificates [Observed] (E: Learning Management System (LMS)). Certificate shows recipient, course, date, tenant, instructor signature and a Certificate ID such as CERT250811174612SELE10, with no score or duration [Observed] (research §21.10).
  • No mandatory assignment, due dates, compliance training or SCORM is documented [Inferred] (research §12).

7.16.3 What we change and why [Proposed]​

Start with mandatory compliance courses tied to onboarding and completion evidence, because that is what SMEs must prove; keep gamification optional.

7.16.4 Functional requirements​

IDRequirementPriorityReleaseLabel
FR-LMS-001Course with title, category, tags, description, difficulty, prerequisites, image, estimated duration; structure modules → sections → content (video URL, PDF, rich text).MustR4[Observed] I: LMS Instructor
FR-LMS-002SCORM 1.2 package import with completion and score tracking.ShouldR4[Proposed]
FR-LMS-003Quizzes (single/multiple choice) with pass mark and attempts limit.MustR4[Observed] assessments + [Proposed]
FR-LMS-004Mandatory assignment by applicability (location, department, designation, new joiners) with due date (absolute or days after joining), recurrence (e.g. yearly POSH refresher); linkable as an onboarding checklist item.MustR4[Proposed]
FR-LMS-005Progress and completion tracking with resume; completion evidence (date, score, time spent).MustR4[Proposed]
FR-LMS-006Certificates with a unique verifiable ID, recipient, course, completion date, score (optional) and signatory; public verification link (opt-in).MustR4[Observed] research §21.10 + [Proposed]
FR-LMS-007Reminders before due date and escalation to line manager when overdue.MustR4[Proposed]
FR-LMS-008Course review/publish workflow for instructors (draft → review → published → archived).ShouldR4[Observed]
FR-LMS-009Badges and points; leaderboard (opt-in).CouldR4[Observed]
FR-LMS-010Recommended courses by role.CouldR4[Observed]

7.16.5 Key entities​

course, course_module, course_section, content_item, scorm_package, quiz / question / attempt, assignment_rule, enrolment (status, due, progress, completed_at, score), certificate (code, issued_at), badge (Could).

7.16.6 Configuration settings​

lms.certificate_id_pattern (CERT-{YYYY}-{NNNNNN}), lms.overdue_escalation_days (7), lms.leaderboard (off), lms.public_verification (off).

7.16.7 User stories​

US-LMS-01 — Mandatory POSH course. As an hr_admin, I want every new joiner to complete POSH within 30 days.

  • AC1: Given an assignment rule "new joiners, due 30 days after joining", when an employee is activated, then the course appears in their Learning tab with the due date and in their onboarding checklist.
  • AC2: Given it is overdue by 7 days, then the line manager is notified.

US-LMS-02 — Certificate. As an employee, when I pass the quiz, then a certificate with a unique ID is issued and downloadable.

US-LMS-03 — Compliance report. As an hr_manager, when I open the POSH report for Plant 1, then I see assigned, completed, overdue and completion % by department.

7.16.8 Permissions​

ActionOWNHRAHRMINSLMEMPAUD
Create/publish coursesORGORG—own courses———
Assignment rulesORGORGLOC*————
Learn, take quizzesSELFSELFSELFSELFSELFSELF—
ReportsORGORGLOC*own coursesTEAMSELFORG(R)

7.16.9 UI/UX​

Employee Learning tab: Assigned (with due chips), Library, Certificates. Course player with progress, works on mobile, resumes offline-downloaded PDFs. Instructor web builder with outline tree and preview. Empty: "No courses assigned".

7.16.10 Notifications and automation​

Course assigned, due soon (7 days, 1 day), overdue (employee, manager), certificate issued, course published (to targeted audience).

7.16.11 Reports and analytics​

Enrolment and completion by course, department and location; overdue mandatory training; quiz scores; certificates issued; badges and points (if enabled).

7.16.12 Edge cases​

Course content updated after completion → existing completions remain valid unless the instructor marks the change "requires re-completion". Employee transfers → new mandatory rules apply from the transfer date; completed courses carry over.


8. Non-functional requirements​

Targets use the SLOs, RPO/RTO and controls in architecture.md §6–§13. "Stage A/B" refers to the hosting stages in architecture.md §10.2. Each NFR names how it is verified.

8.1 Performance (PERF)​

IDRequirementTargetVerification
NFR-PERF-01API latency per cell under normal loadp95 < 300 ms for reads, < 800 ms for writes (excluding exports and file generation)k6 load tests in CI on staging; production RED metrics
NFR-PERF-02Punch acceptance (server acknowledgement of an online punch, selfie ≤ 300 KB)p95 < 2 sSynthetic punch check every 5 min; API metrics
NFR-PERF-03Web front end on a mid-range device over 4GLCP ≤ 2.5 s (p75), INP ≤ 200 ms, initial JS ≤ 300 KB gzippedLighthouse CI, real-user monitoring
NFR-PERF-04Payroll calculation1,000 employees in < 5 min; 5,000 in < 20 minGolden-data performance test per release
NFR-PERF-05Attendance day recompute after an input changep95 ≤ 5 min; full-period recompute of 1,000 employees ≤ 10 minQueue-age metrics; load test
NFR-PERF-06Notification sending from domain event to provider hand-offp95 ≤ 60 sOutbox-to-sent latency metric
NFR-PERF-07Reports≤ 10,000 rows: first page ≤ 5 s p95; larger exports asynchronous, ready ≤ 15 minReport job metrics
NFR-PERF-08Mobile app on a 2 GB RAM Android deviceCold start ≤ 3 s; punch screen interactive ≤ 1 s from HomeDevice-lab tests per release
NFR-PERF-09Import dry-run5,000 rows ≤ 2 minAutomated test
NFR-PERF-10Payslip publication after lock1,000 PDFs generated and emails queued ≤ 15 minJob metrics

8.2 Security (SEC)​

IDRequirementTargetVerification
NFR-SEC-01Application security baselineOWASP ASVS Level 2; external penetration test before R1 GA and annually; no open critical or high findings at any GAPentest report; ASVS checklist
NFR-SEC-02Tenant isolationFORCE ROW LEVEL SECURITY on 100% of tenant-owned tables; cross-tenant tests for 100% of repository methods; app DB role cannot bypass RLS; zero cross-tenant data incidentsCI policy-coverage check; isolation test suite
NFR-SEC-03Authenticationargon2id hashing; 15-min access tokens; rotating refresh tokens with reuse detection; MFA enforced for admin and payroll roles (100% coverage); zero default or emailed passwordsAutomated tests; MFA coverage report
NFR-SEC-04EncryptionTLS 1.2+ with HSTS; KMS encryption at rest for DB, storage and backups; envelope encryption for Aadhaar, PAN, bank account and face templatesConfig scans; key-usage audit
NFR-SEC-05SecretsAll secrets in AWS Secrets Manager/SSM; rotation ≤ 90 days; zero secrets in images or repositoriesSecret scanning in CI; rotation report
NFR-SEC-06Vulnerability managementSAST, dependency and container scanning on every build; fix SLAs critical ≤ 7 days, high ≤ 30 days, medium ≤ 90 daysScanner dashboards
NFR-SEC-07Abuse protectionPer-IP and per-tenant rate limits (default 600 requests/min per user); login lockout per FR-IAM-004; WAF managed rulesWAF and rate-limit metrics
NFR-SEC-08File handlingType allow-list, size limits, malware scan before a file becomes downloadable; presigned URLs scoped to the tenant prefix with TTL ≤ 15 minAutomated tests
NFR-SEC-09Audit integrityAppend-only audit store with a hash chain; any tampering is detectable; platform access to tenant data only through audited break-glass grants (100%)Daily chain verification job
NFR-SEC-10Outbound integrationsWebhooks are SSRF-safe (no private IP ranges), HMAC-signed, with retries and DLQSecurity tests

8.3 Availability and recovery (AVL)​

IDRequirementTargetVerification
NFR-AVL-01Availability of web and API (monthly)99.5% in Stage A; 99.9% in Stage B and for Enterprise SLAs; planned maintenance ≤ 4 h/month, announced 72 h ahead, between 22:00 and 06:00 IST, never in the payroll window (25th–5th) except for emergency fixesSynthetic monitoring; SLO reports
NFR-AVL-02Database RPO≤ 5 min (PITR); ≤ 24 h for a regional disasterQuarterly DR drill
NFR-AVL-03Database RTO≤ 1 h for an AZ or cell failure (automatic failover ~2 min); ≤ 8 h for a regional disasterQuarterly DR drill
NFR-AVL-04Object storageRPO ≤ 15 min, RTO ≤ 4 h (versioning, cross-region replication, Object Lock for payroll artefacts)DR drill
NFR-AVL-05Single-tenant restore≤ 2 h into a staging cell from per-tenant export or PITR extractionRunbook test twice a year
NFR-AVL-06Graceful degradationMobile punches continue offline during outages and sync later; queues rebuild from the outbox; SMS provider failover; read-only mode for suspended tenantsChaos test in staging per quarter
NFR-AVL-07DR drillsQuarterly, with measured RPO/RTO recordedDrill reports

8.4 Scalability (SCL)​

IDRequirementTargetVerification
NFR-SCL-01Pooled cell capacityUp to 300 tenants or 30,000 active employees per pooled cell within PERF targets; new cell when architecture.md §13 triggers fireCapacity dashboards
NFR-SCL-02Tenant size in a pooled cellUp to 5,000 active employees; larger tenants are offered a dedicated cellLoad test with a 5,000-employee tenant
NFR-SCL-03Peak patternsMonth-end at 10× average job volume; 30% of a tenant's workforce punching within 10 minutes of shift startLoad tests
NFR-SCL-04GPS ingest (R3)≥ 200 points/s sustained per cell (e.g. 10,000 tracked users at one point per minute with headroom) before extracting the ingest serviceLoad test before R3 GA
NFR-SCL-05FairnessPer-tenant job concurrency quotas so that one tenant's payroll or export cannot delay another tenant's jobs by more than 2× their normal durationQueue metrics per tenant
NFR-SCL-06Data growthPunches and GPS points in monthly partitions; partitions older than retention are dropped, not deleted row by rowPartition maintenance job

8.5 Observability (OBS)​

IDRequirementTargetVerification
NFR-OBS-01TelemetryOpenTelemetry traces, metrics and logs with tenant.id and cell.id on every request and job; errors traced 100%, normal traffic sampled (default 10%)Telemetry coverage check
NFR-OBS-02Synthetic checksLogin, punch and leave-apply flows every 5 min per cellCheckly/Grafana synthetic
NFR-OBS-03AlertingSLO burn-rate alerts page on-call within 5 min; runbook link on every alertAlert reviews
NFR-OBS-04Business SLOs per tenantPayroll run success, payslip delivery, punch ingest lag, notification latency visible on the platform consoleConsole
NFR-OBS-05PII in telemetryZero salary, Aadhaar, PAN or bank values in logs and traces; redaction at the loggerAutomated log-scan tests
NFR-OBS-06Client stabilityMobile crash-free sessions ≥ 99.5%; web error rate < 0.5% of sessionsSentry

8.6 Privacy (PRV)​

IDRequirementTargetVerification
NFR-PRV-01Notice and consent (DPDP Act 2023 and Rules; verify with counsel)Purpose shown for each personal-data category; recorded consent for face and location; withdrawal effective ≤ 24 hPrivacy review per release
NFR-PRV-02Location minimisationLocation captured only at punch (ATT) or between punch-in and punch-out (FFM); never outside dutyAutomated tests on the mobile app
NFR-PRV-03RetentionRaw GPS 90 days; punch photos 180 days; payroll records 8 years; face templates deleted ≤ 30 days after exit or consent withdrawal; automated purge with evidence logsPurge job reports
NFR-PRV-04Data-subject requestsFulfilled within the tenant-configured SLA (default 30 days) with a machine-readable exportDSAR register
NFR-PRV-05Data residencyAll tenant data, backups and processing in India regions (ap-south-1, ap-south-2) unless the tenant consents otherwiseInfrastructure review
NFR-PRV-06Breach handlingRunbook supports notifying affected tenants without undue delay and within 72 h of confirmation (verify DPDP Rules timelines)Annual tabletop exercise
NFR-PRV-07Non-production dataNo production personal data in dev, UAT or preview; synthetic seed data onlyEnvironment audits
NFR-PRV-08FairnessNo eligibility rule based on marital status; gender used only for statutory gender-specific benefitsPolicy schema review

8.7 Accessibility (ACC)​

IDRequirementTargetVerification
NFR-ACC-01ConformanceWCAG 2.1 AA for web and mobileaxe in CI (zero serious/critical violations); manual audit of top 20 flows per release
NFR-ACC-02KeyboardAll web functions operable by keyboard with visible focus and logical orderManual test
NFR-ACC-03ContrastText ≥ 4.5:1, large text and UI components ≥ 3:1; tenant brand colours validated on save (FR-ORG-015)Automated checks
NFR-ACC-04Touch targets≥ 44×44 pt (iOS) and 48×48 dp (Android)Design review
NFR-ACC-05Screen readersVoiceOver and TalkBack labels for all controls; status never conveyed by colour alone (codes and text accompany colours)Manual test
NFR-ACC-06Text scalingUsable at 200% text size / OS large fonts without loss of contentDevice tests
NFR-ACC-07TimeoutsUsers are warned before session timeout and can extend; kiosk result screens give ≥ 3 s and no unextendable time limits for inputManual test

8.8 Internationalisation and localisation (I18N)​

IDRequirementTargetVerification
NFR-I18N-01LanguagesEnglish in R1; Hindi, Telugu and Tamil for ESS/MSS in R2; 100% of UI strings externalised from R0String-extraction lint
NFR-I18N-02Formatsen-IN number grouping (₹1,23,45,678.00), INR only; dates DD-MMM-YYYY by default; 12/24-hour per tenantUnit tests
NFR-I18N-03TimeStored in UTC; displayed in the location's time zone (default Asia/Kolkata)Unit tests
NFR-I18N-04ScriptsUnicode names in Indic scripts accepted and rendered correctly in UI, PDFs (payslips, letters) and exportsPDF rendering tests

8.9 Maintainability (MNT)​

IDRequirementTargetVerification
NFR-MNT-01Module boundariesZero cross-module table access; lint and dependency-cruiser checks in CICI
NFR-MNT-02Test coveragePayroll engine golden tests cover every statutory rule in the pack and every lifecycle transition; ≥ 80% line coverage on domain modules; e2e tests for every Must user storyCI reports
NFR-MNT-03DeploymentsZero-downtime expand/contract migrations; rollback by redeploying the previous image in ≤ 15 minRelease checklist
NFR-MNT-04CadenceWeekly releases; payroll-impacting changes frozen 25th–5th except reviewed patchesRelease calendar
NFR-MNT-05API stabilityPublic /v1 API changes are additive; deprecations announced ≥ 6 months aheadAPI changelog
NFR-MNT-06Self-describing configurationEvery policy setting has a schema, help text and an example; docs generated from the schemaSchema lint
NFR-MNT-07Statutory agilityA statutory rate change is published as a pack (data, not code) within 1 business day of being verifiedPack publishing log
NFR-MNT-08Mobile support windowiOS 15+ and Android 9+; minimum app version enforcedAPI version checks

8.10 Compliance (CMP)​

IDRequirementTargetVerification
NFR-CMP-01Statutory file formatsECR, ESI, PT and LWF outputs pass the current portal or utility validation; re-tested monthly and whenever a format changesSample uploads / validators
NFR-CMP-02No hard-coded ratesZero statutory rates or thresholds in code; all from the effective-dated statutory packCode scan rule
NFR-CMP-03Payroll record retentionLocked runs, payslips and statutory files retained 8 years with Object Lock (compliance mode) and byte-identical regenerationRetention audit
NFR-CMP-04Tax correctnessTDS calculations validated against a reviewed test-case set for each new tax year before the April release; Form 16/24Q (R2) outputs validated with the official validation utilityTest reports
NFR-CMP-05Statutory registersWage, attendance, overtime and leave registers exportable in formats aligned with applicable central/state rules under the Labour Codes (formats to verify)Should, R2
NFR-CMP-06AuditabilityAuditors can be given time-boxed read-only access (auditor role) and audit-log exportsFeature test
NFR-CMP-07Commercial complianceGST-compliant subscription invoices; data-processing agreement available to every tenantFinance and legal review

9. Global permissions model​

9.1 Model​

  • A permission is {module}.{resource}.{action} (e.g. lve.request.approve). A role is a set of permissions. A role assignment binds a user to a role with a data scope and optional filters and validity dates (architecture.md §6.2).
  • Every check is the pair (permission, scope): att.request.approve@TEAM. Scopes: SELF → TEAM (direct + indirect reports via effective reports_to) → DEPARTMENT → LOCATION → ORG.
  • Sensitive classes (compensation, bank, Aadhaar, PAN, health, biometric) need an extra *.sensitive.read permission and are masked otherwise (FR-IAM-012).
  • Segregation of duties: never approve your own request; payroll editors cannot approve their own run when SoD is on (FR-PAY-036).
  • Entitlements first: a permission has no effect if the tenant's plan does not include the module (FR-PLT-004).
  • Tenants clone seeded roles; seeded originals stay read-only (FR-IAM-010).

9.2 Roles × modules (seeded defaults)​

Legend: C configure, O operate (create/edit records, run processes), A approve, R read, S self-service only, — none. The scope follows in brackets.

ModuleOWNHRAHRMFNAPRMLMSLASLMEMPFEXKIOINSAUD
PLT (tenant side)C (ORG)——R billingR statutory pack———————R
ORGC (ORG)C (ORG)R (LOC*)C legal entitiesRR (TEAM)——R holidaysR holidays——R (ORG)
IAMC (ORG)C (ORG, limited)O invites (LOC*)——A devices (TEAM)—A devices (TEAM)SS——R audit
EMPC/O/A (ORG)C/O/A (ORG)O/A (LOC*)RR bank/PANR (TEAM)—R (TEAM)SS——R
ATTC/O/A (ORG)C/O/A (ORG)O/A (LOC*)—R, lock (ORG)O/A (TEAM)—O/A (TEAM)SSO punch (LOC)—R
LVEC/O/A (ORG)C/O/A (ORG)O/A (LOC*)—RO/A (TEAM)—A (TEAM)SS——R
PAYA (ORG)——C/A (ORG)O (ORG)A advances L1 (TEAM)——SS——R (masked)
NTFC (ORG)C (ORG)R logs (LOC*)C payroll workflows—A tasks—A tasksSS———
RPTR (ORG)R (ORG)R (LOC*)R pay (ORG)R pay (ORG)R (TEAM)R CRM (ORG)R (TEAM)SS—R own coursesR (ORG)
MOBas rolesas rolesas rolesas rolesas rolesMSS—MSS + mapESSESS + FieldKiosk——
CLM (R2)C/A (ORG)C (ORG)—C/A (ORG)A/O pay (ORG)A verify (TEAM)—A verify (TEAM)SS——R
EXT (R2)A (ORG)O/A (ORG)O/A (LOC*)—O F&F (ORG)A L1 (TEAM)—A L1 (TEAM)SS——R
ENG (R2)C/O (ORG)C/O (ORG)O (LOC*)——O optional (TEAM)——SS——R
FFM (R3)C (ORG)C tracking policy———R (TEAM)C (ORG)O/A (TEAM/LOC*)—S——R
TSM (R3)C (ORG)C (ORG)———A (TEAM)——SS——R
LMS (R4)C (ORG)C (ORG)O (LOC*)——R (TEAM)——SS—C/O own coursesR

Platform roles (platform_admin, support_engineer, billing_admin, release_manager) act only in the control plane; their access to tenant data is through break-glass grants (FR-PLT-012).

9.3 Scope resolution rules​

  1. TEAM is computed from the effective reports_to hierarchy on the date of the record (a manager sees a former report's days from when they were in the team).
  2. LOCATION and DEPARTMENT scopes use the employee's effective job assignment on the record date.
  3. Multiple role assignments are unioned per permission; the widest scope wins for that permission only.
  4. Lists, reports, exports, search and API responses apply the same scope filter; there is no "export bypass".

10. Global UI/UX requirements​

10.1 Design system​

ElementRequirement
FoundationShared design tokens in packages/ui (colour, type, spacing, radius, elevation) used by web (Tailwind 4 + shadcn/ui) and mobile (Expo) (CONVENTIONS.md §6)
ComponentsData table (sort, filter, column chooser, bulk select, sticky header), filter bar (§7.9), form generator from policy schemas, stepper, timeline (effective-dated history), status chip, approval card, money field, date-range picker aware of week-offs and holidays, file uploader with camera, empty state, toast, confirmation dialog with consequence text
Status semanticsOne colour + text label per state family across modules: neutral (Draft), info (Submitted / In approval), success (Approved / Paid / Present), warning (Pending action / Late / Flagged), danger (Rejected / Absent / Failed), muted (Cancelled / Withdrawn). Attendance codes always show the code letters, not colour alone
NumbersRight-aligned money with en-IN grouping and ₹; tabular numerals in grids; decimals for days shown as halves (14.5)
ExplainabilityComputed values (day status, balance, payslip line, TDS) have a "How calculated" affordance that opens inputs, policy version and formula
HelpContextual help on every setting, generated from its schema (description, example, effect); links to the documentation site
CopyPlain, specific, action-oriented; errors say what happened, why and what to do ("You are 600 m from Plant 1. Move closer or ask your manager")

10.2 Navigation per role​

PersonaWeb (left navigation)Mobile (bottom tabs)
employeeHome, Attendance, Leave, Pay, Claims (R2), Learning (R4), MeHome, Attendance, Leave, Pay, Me (Inbox via header)
line_manager+ Team (today, calendar, roster), Approvals+ Team tab; Inbox badge
hr_managerPeople, Attendance workbench, Leave, Onboarding, Exits (R2), Reports, InboxESS + Team + approvals
hr_admin+ Settings (Organisation, Time, Leave, Notifications, Security)ESS
payroll_manager / finance_adminPayroll workbench, Compensation, Tax, Statutory, Reports, Settings → PayESS + run approvals
org_ownerDashboard, all modules, Subscription, Security, Support accessDashboard, approvals (payroll), ESS
field_executive(web optional) Accounts, PipelineHome, Field, Attendance, Leave, Me
sales_managerMap, Pipeline, Travel, Team, ReportsTeam, Map, Approvals
kiosk_operator—Kiosk only
auditorRead-only dashboard, Reports, Audit log—

Global elements: tenant logo, global search (people, requests, runs within scope), notifications bell, help, profile menu with language and theme. A user with several roles sees a merged menu, never a role switcher.

10.3 Responsive behaviour​

BreakpointBehaviour
≥ 1280 px (desktop)Full admin workbenches, multi-column forms, side panels for detail
768–1279 px (tablet)Collapsible navigation; grids scroll horizontally with frozen first column; all admin tasks usable
< 768 px (mobile web)ESS and approvals fully usable (for users without the app); admin configuration shows a "best on a larger screen" note but remains functional; candidate pre-onboarding is mobile-web-first

10.4 Accessibility​

WCAG 2.1 AA (NFR-ACC-01..07): semantic HTML and ARIA where needed, keyboard paths, focus management in dialogs, labelled form fields with inline errors linked to inputs, charts with data-table alternatives, captions or transcripts for LMS videos (R4).

10.5 Localisation​

All strings in resource bundles; English in R1; Hindi, Telugu, Tamil in R2 for ESS/MSS; user-selectable language with tenant default; notification templates per locale; tenant label overrides (FR-ORG-017, R2); layouts tolerate 40% text expansion.

10.6 Offline behaviour on mobile​

CapabilityOffline behaviour
Punch (personal device)Queued with device time + elapsed-time proof; synced ≤ 72 h; flagged offline (FR-ATT-005)
Kiosk punch (R2)PIN punches with photo queued; face verification on sync where possible (FR-MOB-016)
Field visits and activities (R3)Queued and synced; GPS buffered up to 24 h (FR-FFM-014)
Read dataLast 3 payslips, balances, holidays, current-month calendar cached with "last updated"
Requests and approvalsNeed connectivity; drafts saved locally; clear message "You're offline. We'll keep your draft."
Sensitive cacheEncrypted at rest on device; cleared on logout or user switch

10.7 Kiosk mode (R2)​

Location-scoped enrolment; full-screen camera with guide oval and live clock; face + liveness or code + PIN; large confirmation (name, photo, In/Out, time) for 3 s; no access to other screens; admin PIN to exit; offline queue; device health heartbeat; high-contrast and audio feedback options (FR-MOB-012..017).

10.8 Standard states​

  • Empty: explain what the area is for and give the primary action.
  • Loading: skeletons for lists and cards; no spinner-only pages over 1 s.
  • Errors: inline for fields; banner for page-level problems with retry; a support reference code on unexpected errors.
  • Permission denied: say which permission or scope is missing and who can grant it.
  • Locked data: lock icon with who locked it and when; actions disabled with a reason.

11. Integrations​

Aligned with architecture.md §16. Every external provider sits behind an interface so it can be replaced without changing modules. All integrations are tenant-configurable, use India-region processing where available, and fail safely.

IntegrationPurposePatternReleaseRequirementsFailure behaviour
Biometric devices (ZKTeco, eSSL and similar)Punch captureR1: CSV/Excel upload and authenticated punch-batch API with device-user mapping. R2: ADMS-style push gateway to ingest with per-device secrets, plus a Windows/Linux sync agent for pull-only devicesR1 / R2FR-ATT-006, -007, -008Idempotent re-delivery; unmapped punches queued; device-offline alerts
Face verificationKiosk 1:N and personal 1:1 verification with livenessFaceProvider.enroll/verify/liveness; first implementation AWS Rekognition (ap-south-1) or an on-device SDK; consent-gatedR2FR-MOB-013..015, FR-IAM-018Fallback to PIN or selfie + manager review; no punch lost
Maps and geocodingLocation picker, address lookup, distance, map viewsProvider interface; Google Maps Platform or Mappls; snap-to-road for kms (R3)R1 (geocode) / R3 (tracking)FR-ORG-004, FR-ATT-003, FR-FFM-004/005Geo-fence checks are computed locally (no provider needed); maps degrade to coordinates
EmailTransactional emailNTF adapter for Amazon SES (ap-south-1); bounce and complaint webhooksR0FR-NTF-002, -006Retries; bounces mark the address and alert HR
SMSOTP, activation, critical alertsNTF adapters for MSG91 and Gupshup with DLT-registered templates; provider failoverR1FR-NTF-002, -003Failover to the secondary provider
WhatsAppOptional notifications (metered add-on)Meta WhatsApp Cloud API through a BSP; approved templates; recorded opt-inR1 (Should)FR-NTF-002, -003Falls back to SMS/push
PushMobile notificationsExpo push → FCM/APNsR0FR-NTF-002, FR-MOB-006In-app inbox always holds the message
Statutory portals (EPFO, ESIC, state PT/LWF, income-tax)Compliance filingFile generation only (ECR, ESIC upload, PT/LWF data, 24Q data, Form 16); no portal automation (legal and fragility risk)R1 (ECR/ESI/PT/LWF) / R2 (24Q, Form 16)FR-PAY-045..048, -055, -056Validation before generation; versioned revised files
BanksSalary and reimbursement paymentsBank-file adapters (generic NEFT/RTGS CSV + bank-specific formats); response/UTR import; host-to-host APIs laterR1 (files) / post-R4 (H2H)FR-PAY-044, -038Control totals and checksums; failed transfers re-issued
AccountingPayroll journalR2: CSV and Tally XML export with ledger mapping. R4: API connectors (Zoho Books, ERPs)R2 / R4FR-PAY-058, -059Export is regenerable from the locked snapshot
SSOWorkforce identityOIDC (Google Workspace, Microsoft Entra ID) on Standard+; SAML 2.0 on EnterpriseR1 / R2FR-IAM-007, -008Owner break-glass password login
Public API and webhooksCustomer integrations (HRIS sync, BI, access control)REST /v1 (OpenAPI 3.1), OAuth2 client credentials per tenant, per-client scopes and rate limits; signed webhooks (HMAC SHA-256) with retries and DLQR2FR-IAM-023, FR-NTF-016Replay from DLQ; 6-month deprecation policy
CalendarLeave as out-of-office eventsGoogle/Microsoft calendar APIs, per-user opt-inR3FR-LVE-027Best-effort; no impact on leave status
BillingSubscriptions and invoicesRazorpay Subscriptions (control plane)R1FR-PLT-011Grace period and dunning; payroll never blocked in the window
Identity verification (optional)PAN/bank verificationThird-party verification APIs with consentR3 (Could)FR-EMP-020Manual verification remains possible

Public API scope (R2, Must): employees and job assignments (read/write), org masters (read/write), attendance punches (write) and days (read), leave requests and balances (read; create with workflow), payroll run summaries and payslip metadata (read, sensitive scopes separately granted), claims (read). No API writes to locked payroll data.


12. Notifications and automation catalogue​

Channels: IA in-app, E email, P push, S SMS, W WhatsApp (add-on). "Configurable" means the tenant can edit the template and enable/disable the event; Mandatory events cannot be disabled (the template can still be edited).

EventTemplate keyDefault channelsRecipientsConfigurable?Release
Tenant trial ending (7/3/1 days)plt.trial.endingE, IAOwnerNo (platform)R1
Payment failed / suspension noticeplt.billing.failedE, IAOwner, billing contactNoR1
Support access requested / started / endedplt.support.accessE, IAOwnerMandatoryR0
Statutory pack published (affects tenant)plt.statpack.publishedIA, EPRM, FNAYes (channels)R0
Tenant export readyplt.export.readyERequesterNoR1
Import completed / failedorg.import.doneIA, EUploaderYesR0
Policy version activatedorg.policy.activatedIAHRA, FNAYesR0
Holiday calendar changedorg.holiday.changedIA, PAffected employeesYes (off by default)R1
Account activation linkiam.inviteE or S (W optional)New userMandatoryR0
Activation reminder (48 h)iam.invite.reminderE/SUser, HR (cc)YesR1
Password changed / MFA reset / new-device loginiam.security.*E, PUserMandatoryR0/R1
Device pending approvaliam.device.pendingP, IALine manager / HRYesR1
Consent withdrawniam.consent.withdrawnIA, EHRMandatoryR1
DSAR received / due in 5 daysiam.dsar.*IA, EHRA, OwnerMandatoryR1
Pre-onboarding link / reminders (day 2, day 5)emp.preboarding.*E, SCandidateYesR1
Pre-onboarding submitted / section reopenedemp.preboarding.submitted / .reopenedIA, E / E, SHR / CandidateYesR1
Document approved / rejected / expiring (30 days)emp.document.*IA, P, EEmployee (and HR for expiry)YesR1
Checklist task assigned / overdueemp.task.*IA, ETask ownerYesR1
Induction invite / changed / cancelledemp.induction.*E (with .ics), IAAttendeesYesR1
Probation ending (15 days)emp.probation.dueIA, ELine manager, HRYesR1
Profile change request decidedemp.change.decidedIA, PEmployeeYesR1
Punch reminder (not punched by shift start + grace)att.punch.reminderPEmployeeYes (user opt-out)R1
Missed punch-out reminderatt.punchout.reminderPEmployeeYesR1
Attendance alerts digestatt.alerts.digestP, IAEmployeeYesR1
Attendance / regularization / permission / shift-change request submittedatt.request.submittedIA, PApproverYesR1
Request decidedatt.request.decidedIA, PEmployeeYesR1
Swap consent requestedatt.swap.consentP, IACounterpart employeeMandatoryR1
OT claims pending (daily digest)att.ot.pendingIA, ELine managerYesR1
Roster published / changedatt.roster.changedP, IAAffected employeesYesR1
Device offlineatt.device.offlineE, IAHR of locationYesR2
Period close reminder / lockedatt.period.*IA, EHRM, PRMYesR1
Leave submitted / decided / cancellation requested / decidedlve.request.*IA, P (E optional)Approver / employeeYesR1
Comp-off expiring (7 days)lve.compoff.expiringP, IAEmployeeYesR1
Year-end summarylve.yearend.summaryIA, EEmployeeYesR1
Leave document pending after returnlve.document.pendingP, IAEmployee, HRYesR1
Approval task assignedntf.task.assignedIA, PApproverMandatory (in-app)R0
Approval reminder / escalatedntf.task.reminder / .escalatedIA, P, EApprover, escalation targetYes (timings)R1
Delegation started / endedntf.delegation.*IA, EDelegate, delegatorYesR1
Approver changed (tasks reassigned)ntf.task.reassignedIAOld and new approverYesR0
Payroll run calculated with warningspay.run.calculatedIA, EPRMYesR1
Payroll approval requested / approved / sent backpay.run.approval.*IA, P, EApprover / PRMMandatoryR1
Payroll locked (files ready)pay.run.lockedIA, EPRM, FNA, OwnerYesR1
Payslip publishedpay.payslip.publishedP, E (password-protected PDF), IAEmployeeMandatoryR1
Payment failed for employeepay.payment.failedIA, EPRMMandatoryR1
Declaration window opens / closes in 7 and 1 dayspay.itd.windowP, E, IAEmployeesYesR1
Proof deadline / proof verified / rejectedpay.proof.*P, E, IAEmployeeYesR1
Advance / loan decided, disbursed, EMI pausedpay.advance.*IA, PEmployeeYesR1
Statutory due-date reminder (EPF, ESI, TDS, PT, LWF)pay.statutory.dueIA, EPRM, FNAYes (dates from pack)R1
Form 16 publishedpay.form16.publishedE, P, IAEmployee (incl. alumni)YesR2
Export ready / scheduled report deliveredrpt.export.ready / rpt.schedule.deliveredIA, ERequester / recipientsYesR1
Forced app upgrademob.upgrade.requiredPUsers on old versionsNoR1
Claim submitted / verified / approved / paid / rejectedclm.claim.*IA, PVerifier / finance / employeeYesR2
Resignation submitted / decided; LWD reminders; clearance overdue; F&F ready / paid; letters issuedext.*IA, E, PEmployee, LM, HR, clearance owners, PRMYesR2
Announcement published / acknowledgement remindereng.announcement.*IA, P (E optional)Target audienceYesR2
Recognition received; birthday / anniversaryeng.recognition.*IA, PRecipient (team optional)YesR2
Follow-up due / exceeded; lead ageing red; tracking stopped on duty; travel pendingffm.*P, IAField executive / managerYesR3
Timesheet reminder / defaulter / decidedtsm.*P, E, IAEmployee / approverYesR3
Course assigned / due / overdue / certificate issuedlms.*IA, E, PLearner, LM (overdue)YesR4

Automation jobs (scheduled, idempotent): leave accrual (daily check, posts per frequency), comp-off expiry (daily), attendance auto-resolution at period close, document expiry scan (daily), probation due scan (daily), absconding detection (daily, R2), punch reminder (per shift), statutory due-date reminders (per pack calendar), SLA escalation (every 15 min), retention purges (daily), metering snapshot (daily, control plane), scheduled reports (cron per schedule).


13. Reporting and analytics catalogue​

Filters use the standard bar (Legal entity → Location → Department → Manager → Employee → Period) unless noted. Exports: X Excel, C CSV, P PDF. Persona scope follows §9.

#ReportModulePersonasKey filtersExportRelease
1Owner dashboard (headcount, joiners/leavers, attendance today, payroll cost trend, approvals pending, compliance due)RPTOWNLegal entity, locationPR1
2Org widgets: employees by location, by department by location, attendance by work type, on leave by department, shift-wise headcount, payroll by department by monthRPTOWN, HRA, HRMLocation, periodX, PR1
3Employee master (column chooser incl. custom fields)EMPHRA, HRM, AUDStatus, type, standard barX, CR1
4Joiners and leaversEMPHRM, OWNPeriodX, PR1
5Probation due / confirmationsEMPHRM, LMDue windowXR1
6Document compliance (missing, pending, expired)EMPHRMDocument type, statusXR1
7Job change history (transfers, promotions)EMPHRM, AUDChange reason, periodXR1
8Monthly attendance register (code grid + counts)ATTHRM, LM, PRM, AUDPeriod, pay groupX, PR1
9Daily attendance / current day (with punch photos)ATTHRM, LMDate, statusX, PR1
10Punch detail (all punches, source, location, fence result)ATTHRM, AUDDate range, source, flagX, CR1
11Late and early-goATTHRM, LMPeriod, thresholdXR1
12Missed punchATTHRM, LMPeriodXR1
13Overtime (claimed vs approved, by multiplier, cost estimate)ATTHRM, LM, PRMPeriod, statusXR1
14Extra days and penaltiesATTHRM, PRMPeriodXR1
15Shift-wise attendance and coverageATTHRM, LMDate, shiftXR1
16Out-of-fence and anomaly reviewATTHRM, LMFlag type, periodXR1
17Payable-days summaryATTPRM, HRMPeriod, pay groupX, CR1
18Device health and unmapped punchesATTHRMDevice, locationXR2
19Leave balance (as on date)LVEHRM, LM, PRMDate, leave typeXR1
20Leave register (employee-, date-, type-, designation-wise)LVEHRM, LMPeriod, type, statusX, PR1
21Leave summary (worked vs leave days)LVEHRM, LMPeriodXR1
22Comp-off register (credited, availed, expired)LVEHRM, LMPeriodXR1
23Leave payroll bridge (approved leave, LOP, absent)LVEPRM, HRMPeriod, pay groupXR1
24Year-end carry-forward / lapse / encashmentLVEHRM, PRMCycleXR1
25Salary register (payroll register)PAYPRM, FNA, OWN, AUDRun, pay groupX, PR1
26Bank-wise salary summaryPAYPRM, FNARun, debit bankX, PR1
27EPF report + ECR filePAYPRM, FNA, AUDPeriod, establishmentX, ECR textR1
28ESI report + upload filePAYPRM, FNAPeriod, employer codeXR1
29PT report by statePAYPRM, FNAPeriod, stateX, PR1
30LWF report by statePAYPRM, FNAPeriod, stateXR1
31TDS deduction register and projectionPAYPRM, FNATax year, monthXR1
32IT declarations and proofs statusPAYPRMTax year, statusXR1
33CTC and compensation historyPAYFNA, PRM, OWNEffective date, structureXR1
34Payroll cost by department / location / cost centre / legal entityPAYOWN, FNAPeriod rangeX, PR1
35Variance report (run vs previous)PAYPRM, OWNRun, thresholdXR1
36Arrears reportPAYPRMPeriod, source monthXR1
37Advance and loan recoveryPAYPRM, FNAStatus, periodXR1
38Held salariesPAYPRMRunXR1
39Statutory payment register (challans)PAYPRM, FNA, AUDPeriod, typeXR1
40Form 16 status / 24Q validationPAYPRMTax year, quarterXR2
41Approval turnaround and SLA breachesNTFOWN, HRARequest type, approverXR1
42Notification delivery and usage (SMS/WhatsApp)NTFHRA, OWNChannel, statusXR1
43Users, roles, MFA coverage, inactive users, audit exportIAMOWN, HRA, AUDRole, statusX, CR0/R1
44DSAR registerIAMHRA, OWNStatusXR1
45App adoption (DAU/MAU by role, versions)MOBOWN, HRAPeriodXR1
46Claims register; claims by category; settlement ratio; policy exceptionsCLMPRM, FNA, LMPeriod, status, categoryX, PR2
47Attrition (by reason, tenure, department); notice compliance; clearance ageing; F&F turnaroundEXTHRM, OWNPeriod, typeX, PR2
48Announcement reach and acknowledgements; recognition counts per type per employeeENGHRM, OWNAnnouncement, periodXR2
49Employee activity, tracking log, employee summary, visits vs plan, geo-verification exceptionsFFMSLM, OWNDate range, executiveX, PR3
50Pipeline by stage and age; win rate; collections; travel and mileage costFFMSLM, SLA, OWNPeriod, stageXR3
51Timesheet summary, effort variance, bench, billable hours, defaultersTSMLM, OWNProject, client, weekX, CR3
52Course completion, overdue mandatory training, certificatesLMSHRM, LM, INSCourse, due statusXR4
53KPI pack: attrition rate, absenteeism %, late %, OT cost, payroll cost per employee, leave utilisationRPTOWN, HRAPeriodX, PR1 (Should)
54Custom reports and advanced analyticsRPTOWN, HRA, FNABuilder-definedX, CR4

14. Assumptions, dependencies and open questions​

#ItemTypeImpact / handling
1Statutory values (EPF, ESI, PT, LWF, TDS, gratuity, minimum wages) and file formats are verified by a payroll/compliance expert before each releaseDependencyBlocks R1 GA; owned by the compliance SME; delivered as statutory pack versions
2Income-tax Act, 2025 section/form renumbering and Labour Codes rules (central and state) are mapped before R1 GADependencyAffects TDS labels, Form 16/24Q (R2), wage-definition check (FR-PAY-015)
3DPDP Act 2023 and Rules obligations (notice, consent, DSAR timelines, breach notification) are confirmed by counselDependencyAffects FR-IAM-018/019, NFR-PRV-*
4Three pilot tenants (one office, one factory with shifts, one multi-state) run one parallel payroll each before GAAssumptionMVP acceptance (§16.2)
5Bank-specific file formats for the first 3 banks are obtained from pilot customers' banksDependencyFR-PAY-044
6Biometric devices at pilots can export CSV or call an API in R1; push gateway arrives in R2AssumptionFR-ATT-007/008
7Spryple internals (permission granularity, multi-level approvals, TDS computation, device protocols, face provider, GPS sampling, pricing, multi-company, run locking, API) are unknown (research §20)Open questionOur design does not depend on them; parity claims are limited to documented behaviour
8Face verification provider choice (cloud vs on-device) and cost per verificationOpen questionDecide before R2 build start; affects add-on pricing
9Maps provider (Google vs Mappls) for R3 tracking costsOpen questionDecide before R3; geo-fence checks in R1 do not need a provider
10Payslip default password pattern acceptable to customers (PAN + DOB)Open questionConfigurable; validate with pilots

15. Future enhancements (post-R4)​

Value and effort are relative (H/M/L). These are candidates, not commitments; each needs a business case in brd.md before planning.

EnhancementDescriptionValueEffortNotes (honest assessment)
Recruitment / ATSJob requisitions, careers page, candidate pipeline, interviews, offers with e-sign, hand-off to EMP pre-onboardingMHValuable for growing SMEs but a crowded market (many cheap ATS tools). Integration with existing job portals is the hard part. Start with an offer-letter + hand-off flow, not a full ATS.
Performance managementGoals/OKRs, review cycles, 360 feedback, ratings feeding incrementsMHFrequently requested, rarely used well by SMEs. A light "goals + annual review" with a link to bulk salary revision (FR-PAY-017) gives most of the value.
Surveys and eNPSPulse surveys, anonymous feedback, exit-interview analyticsML–MCheap to build on ENG and NTF; anonymity guarantees need care for small teams (minimum response thresholds).
Asset managementAsset register, assignment to employees, return at exit, depreciation exportMMSpryple lists it as a solution [Observed] (research §21.1). Fits EXT clearance well; keep it simple (no procurement).
Helpdesk / HR casesEmployee queries with categories, SLAs, knowledge baseMMReduces HR load in 200+ employee tenants; could reuse the NTF workflow engine.
AI assistants(a) Policy Q&A for employees grounded only in the tenant's own policies and their resolved settings; (b) payroll variance explanations in plain language; (c) attendance anomaly detection; (d) receipt OCR for claimsM–HMHighest-value use is explanation, not automation: "why is my LOP 1.5?" and "why did net pay drop?" must cite the computed inputs (P8). Requires strict tenant isolation of context, no training on tenant data, opt-in per tenant, and human approval for any action. Payroll numbers must never be produced by a model.
Earned wage accessEmployees draw part of earned salary mid-month, recovered in payrollMMNeeds a regulated lending/NBFC partner; compliance and credit risk sit with the partner. Advance salary (FR-PAY-023) covers the basic need.
Host-to-host bank paymentsDirect salary disbursement via bank APIsMM–HRemoves manual uploads but each bank differs; demand from larger tenants only.
CRM quotes, orders and product catalogueExtend FFM for distribution businessesMHRisks turning Spyrl into a full CRM; prefer integrations with existing order systems.
SCIM provisioning and FIDO2 keysEnterprise identity lifecycle and phishing-resistant MFAL–MMNeeded only for Enterprise deals; SAML (R2) comes first.
Multi-country payrollPayroll outside IndiaLHOut of scope for the SME India focus; would need partners.

16. Traceability and MVP acceptance​

16.1 Traceability matrix (module level)​

BRD links are at module level (BR--*) until brd.md is baselined; requirement-level links are then maintained in the requirements tool. Research references are to research/spryple-analysis.md.

ModulePRD sectionFR range (count)US range (count)BRDResearchFirst release
PLT§7.1FR-PLT-001..022 (22)US-PLT-01..05 (5)BR-PLT-*§3.2, §19, §21.1R0
ORG§7.2FR-ORG-001..018 (18)US-ORG-01..05 (5)BR-ORG-*§4, SP-ORG-*R0
IAM§7.3FR-IAM-001..025 (25)US-IAM-01..06 (6)BR-IAM-*§4, SP-IAM-*, §21.2R0
EMP§7.4FR-EMP-001..022 (22)US-EMP-01..07 (7)BR-EMP-*§4, SP-EMP-*, §21.2R1
ATT§7.5FR-ATT-001..040 (40)US-ATT-01..11 (11)BR-ATT-*§5, SP-ATT-*, §21.3R1
LVE§7.6FR-LVE-001..028 (28)US-LVE-01..08 (8)BR-LVE-*§6, SP-LVE-*, §21.4R1
PAY§7.7FR-PAY-001..065 (65)US-PAY-01..11 (11)BR-PAY-*§7, SP-PAY-*, §21.5R1
NTF§7.8FR-NTF-001..018 (18)US-NTF-01..05 (5)BR-NTF-*SP-X-02/03/04/09R0
RPT§7.9FR-RPT-001..013 (13)US-RPT-01..04 (4)BR-RPT-*§14, SP-X-05/06R1
MOB§7.10FR-MOB-001..019 (19)US-MOB-01..05 (5)BR-MOB-*§15, §21.1, §21.3R1
CLM§7.11FR-CLM-001..014 (14)US-CLM-01..04 (4)BR-CLM-*§9, §21.6R2
EXT§7.12FR-EXT-001..012 (12)US-EXT-01..04 (4)BR-EXT-*§8R2
ENG§7.13FR-ENG-001..008 (8)US-ENG-01..03 (3)BR-ENG-*§13, §21.9R2
FFM§7.14FR-FFM-001..017 (17)US-FFM-01..05 (5)BR-FFM-*§11, §21.7R3
TSM§7.15FR-TSM-001..011 (11)US-TSM-01..03 (3)BR-TSM-*§10, §21.8R3
LMS§7.16FR-LMS-001..010 (10)US-LMS-01..03 (3)BR-LMS-*§12, §21.10R4
Total342 FRs89 user stories

NFRs: PERF 10, SEC 10, AVL 7, SCL 6, OBS 6, PRV 8, ACC 7, I18N 4, MNT 8, CMP 7 (73 NFRs, §8).

16.2 MVP (R0 + R1) acceptance checklist​

R1 GA requires every item below to pass on the production Stage A cell, demonstrated with three pilot tenants (§14 item 4).

Platform, security and data

  • A new tenant is provisioned self-serve in < 2 minutes with seeded roles, templates and the current statutory pack (FR-PLT-002, FR-PLT-009).
  • Isolation suite green: RLS on 100% of tenant tables; tenant B cannot read tenant A through any API, report, export or search (NFR-SEC-02).
  • No default or emailed passwords; activation by invite only; MFA enforced on all admin and payroll accounts (FR-IAM-001, FR-IAM-006, NFR-SEC-03).
  • Seeded roles and one custom role behave per §9, including TEAM scope after a manager change (FR-IAM-010/011, FR-NTF-008).
  • Audit log records every write, approval, sensitive reveal and support access; tenant can view and export it (FR-IAM-016, FR-PLT-012).
  • Consent records exist for location capture; withdrawal disables mobile punch with a working alternative (FR-IAM-018).
  • External pentest has no open critical/high findings; OWASP ASVS L2 checklist complete (NFR-SEC-01).
  • Backups, PITR and one DR drill completed with measured RPO ≤ 5 min and RTO ≤ 1 h (NFR-AVL-02/03/07).
  • SLO dashboards, synthetic checks and on-call alerting live (NFR-OBS-01..03).

Set-up and people

  • Setup wizard takes a tenant from empty to payroll-ready, with the readiness score showing no blocking items (FR-ORG-014).
  • Employees, opening leave balances, compensation and YTD figures import with dry-run and no duplicates on re-upload (FR-ORG-012, FR-LVE-018).
  • New hire → pre-onboarding → activation creates the code, user invite, policies and checklist automatically (FR-EMP-001..005, -010).
  • A back-dated promotion changes policies and approver from its effective date and produces arrears for locked months (FR-EMP-006, FR-PAY-040).

Attendance and leave

  • Mobile selfie punch inside and outside a 200 m fence behaves per geofence.mode; offline punches sync with drift flags (FR-ATT-002/003/005).
  • Biometric CSV/API import is idempotent and handles unmapped users (FR-ATT-007).
  • Day engine produces all codes in §7.5.4 correctly on a golden data set (incl. night shift, half days, WP/HP, week-off penalty, late deduction) and recomputes within 5 min of a change (FR-ATT-019..022, -029, -030, NFR-PERF-05).
  • Rotations, week-off patterns, shift change and swap with consent work end to end (FR-ATT-013/016/017).
  • Regularization, permissions and attendance requests flow through approval, including on-behalf (FR-ATT-023..026).
  • OT is paid only after approval, with rounding, caps and multipliers (FR-ATT-027/028).
  • Period close shows exceptions, locks, and post-lock corrections become next-period adjustments (FR-ATT-032..034).
  • Leave types created from templates and one custom type; accrual, pro-rata, sandwich, cancellation, comp-off expiry and year-end run produce correct ledger entries (FR-LVE-001..016).
  • An effective-dated leave policy change applies to existing employees with a previewed adjustment (FR-LVE-024).

Payroll and compliance

  • Structure template + effective-dated compensation compute correct monthly breakups, including the balancing component check (FR-PAY-001..004).
  • A full run passes through Draft → Calculated → Reviewed → Approved → Locked → Paid with SoD enforced and every transition audited (FR-PAY-028..038).
  • A reversal and a correction off-cycle run work and regenerate revised statutory files (FR-PAY-039, -041).
  • 1,000-employee payroll calculates in < 5 minutes (NFR-PERF-04).
  • EPF, ESI, PT, LWF and TDS match the compliance SME's expected results on the golden test set for every pilot state (FR-PAY-007..010, -050; NFR-CMP-04).
  • Employees choose a tax regime, declare investments, upload proofs, and TDS reflects verified amounts after the deadline (FR-PAY-051..053).
  • ECR, ESI, PT and LWF files pass portal/utility validation; bank files for the pilot banks are accepted by the banks (FR-PAY-044..048, NFR-CMP-01).
  • Payslips are published in the app and by password-protected email, and a locked run regenerates byte-identical artefacts (FR-PAY-042/043/065).
  • Advance salary request → approval → disbursement → recovery ledger works across 4 months (FR-PAY-023/025).
  • Each pilot's parallel run matches its legacy payroll, with every difference explained and signed off.

Experience

  • Every R1 employee and line-manager story is doable in the mobile app on a 2 GB Android device and on iOS (FR-MOB-001..009, NFR-PERF-08).
  • Unified approvals inbox handles all R1 request types with bulk actions, delegation and escalation (FR-NTF-007..011).
  • Standard reports in §13 marked R1 are available with scope filtering and governed exports (FR-RPT-001..006).
  • WCAG 2.1 AA automated checks pass with zero serious/critical issues; manual audit of top flows done (NFR-ACC-01).

17. Glossary​

TermMeaning
Applicability ruleCondition (location, department, designation, grade, employment type, named list) deciding which policy version applies to an employee
ArrearsDifference paid in a later run for a back-dated change to a locked period
CTCCost to company: annual total of salary and employer contributions
Day codeAttendance status of an employee-day (P, A, HD, L, HL, W, H, WP, HP, OD, MP, NE)
ECRElectronic Challan cum Return file for EPFO
F&FFull-and-final settlement at exit
LOPLoss of pay (unpaid day)
LWDLast working day
LWFLabour Welfare Fund (state-specific)
ODOn duty / remote work approved through an attendance request
Pay groupEmployees processed together: one legal entity and one pay schedule
PEPMPer employee per month (pricing metric)
PTProfessional Tax (state-specific)
Sandwich ruleCounting week-offs/holidays between or adjacent to leave days as leave
SoDSegregation of duties
Statutory packCentrally published, versioned, effective-dated statutory reference data
Structure templateReusable definition of salary components and calculations, independent of an employee's CTC
TDSTax deducted at source on salary
UANUniversal Account Number (EPF)

Synced from /prd.md in the repository root. Edit the root file, not this page.