Status: 🟡 Phase 2 Complete — 2026-02-27
Last Updated: 2026-02-06 This document describes the integration interfaces between HR-PAY-03 (Direct Deposit & Pay Stubs) and linked systems: FA-20 (Banking / Plaid) and HR-12 (Employee Self-Service).
Integration Summary
FA-20 (Banking / Plaid)
- Usage: Bank account verification (Plaid Link), ACH transfer creation, webhook for transfer status.
- References: FA-20 Plaid Integration, shared Plaid client
supabase/functions/_shared/plaid-client.ts. - Configuration:
PLAID_CLIENT_ID,PLAID_SECRET,PLAID_ENVIRONMENT(Deno.env in edge functions); no hardcoded credentials. - HR-PAY-03 responsibilities: Use shared client for transfer create; persist
plaid_transfer_idand status onhr_payment_items; handle encryption ofplaid_access_token_encryptedandaccount_number_encryptedper HR-PAY-03 security requirements.
Plaid Transfer (programmatic only)
Payroll uses programmatic Plaid Transfer only: for each payment item, thehr-plaid-transfer-create edge function calls /transfer/authorization/create then /transfer/create (two-step flow per Plaid docs), with an idempotency key per item. Transfer UI (one-time user-driven flows) is not used for batch payroll.
HR-12 (Employee Self-Service)
- Usage: Employees manage bank accounts (add/verify via Plaid Link) and view pay stubs in the portal.
- Data flow: HR-PAY-03 provides pay stub data (from
hr_payroll_runs/hr_payroll_line_items) and direct-deposit account CRUD scoped to current user; HR-12 presents UI and enforces self-service permissions.
Phase 2: Check Printing (Complete — 2026-02-27)
- Table:
hr_payment_checks— linked tohr_payment_batchesandhr_payment_items; stores check number, print status, vendor reference, amount, payee name, pay date. - Payment method:
hr_payment_items.payment_methodcolumn (direct_deposit|check);bank_account_idnullable when method ischeck. - PDF generation: Client-side via
jsPDFinsrc/cores/hr/services/check-pdf-generator.ts; single PDF per batch. - Vendor integration: Configurable stub; on failure: toast + inline banner with “Retry” and “Download PDF instead”.
- Permissions:
hr.payment_checks.print,hr.payment_checks.manage(seeded toorg_admin).
CROSS_CORE_INTEGRATIONS.md Entries
The following rows are recorded in CROSS_CORE_INTEGRATIONS.md:- HR → FA (FA-20): Event / Platform — Direct deposit transfers and bank linking (Plaid); HR-PAY-03 consumes FA-20 platform banking layer.
- HR ↔ HR-12: In-App — Direct deposit setup and pay stub access in employee self-service; HR-PAY-03 backs HR-12 flows.