Audience: New engineers picking up EWA work.
Withdrawals, balances, policies, analytics, invoices → EWA service (/v1/*)
Enrolment config, approval, sync workers, payroll hook → core-backend (this repo)
Withdrawal logic, balance calculation and policy evaluation are not here. If a ticket is about how much someone can withdraw, that's the EWA service. (RFD-001)
The same host serves the ATS (/v1/ats/*) — see Hiring. ewa-*.paidhr.com is an "extended platform" service despite the name.
EwaConfigSetting.cs (Entities/Membership/) — the company's enrolment + rules. Note it's MembershipDb, org-scoped, not TenantDb.EwaInitialization.cs / EwaWithdrawal.cs — the two synced tables. Note IsSynchronized and the UserKey/CompanyKey correlation keys.EwaService.cs (147) — read it all; every method is an outbound call.EwaApiModel.cs — the provider contract. Note padeUserId / padeCompanyId / padeParentCompanyId.BackgroundServices/Ewa*SynchronizationService.cs, 118 each) — same shape: fetch unsynced → build items → push/pull → 30s Task.Delay.ControlEwaService.cs (297) — the approve/decline/set-up flow.EwaController.Payroll_Status — the one tenant-facing endpoint, and the payroll integration point.| You want to change… | Go to |
|---|---|
| Withdrawal rules / balances / policies | EWA service (not here) |
| Company enrolment config | EwaConfigSetting, ControlEwaService |
| Approve/decline flow | Control/EwaController, ControlEwaService |
| Sync behaviour | Ewa*SynchronizationService |
| Provider contract | EwaApiModel.cs, EwaService.cs |
| Payroll readiness | EwaController.Payroll_Status, PayrollLedgerSync |
| Admin UI | web-app/.../dashboard/ewa/*; employee UI employee-dashboard/wallet/ewa/* |
OrganisationId — an org-level commercial arrangement. Don't write a CompanyId tenant query. (RFD-002)IsSynchronized is the contract. Stuck flags = stuck employees or unrecovered withdrawals. Check it before anything else when reconciling.UserKey/CompanyKey, not FK ids — you need these to debug against the provider.