How bcgov/csa works
Child Special Allowance is a web application for managing children’s eligibility and federal benefit processing. Staff review and update contact records, run eligibility, assemble batches, submit them to CRA, and process CRA responses and weekly files. The repository separates the React interface, NestJS API, scheduled/job execution, and integration/synchronization services. The README documents the end-to-end flow; source excerpts provide concrete UI/API and ICM-ingestion relationships. Several domain connections are documented but their internal implementations were not sampled, so those links cite the README.
Main entry points: api-service.ts API client · App.tsx CSA workspace · contacts.controller.ts Contact endpoints · prisma.service.ts Application database
Components 22
Staff interface
- CSA workspace
frontend/src/App.tsx - Weekly processing
frontend/src/components/WeeklyFileProcessingTab.tsx - Job monitoring
frontend/src/components/JobMonitoringTab.tsx - API client
frontend/src/service/api-service.ts
Application API
- Contact endpoints
backend/src/api/contacts/contacts.controller.ts - Batch endpoints
backend/src/api/batches/batches.controller.ts - Weekly-file endpoints
backend/src/api/weekly-files/weekly-files.controller.ts - Access verification
backend/src/api/admin/admin.service.ts - Job endpoints
backend/src/api/jobs/jobs.controller.ts
Jobs and eligibility
- Eligibility rules
backend/src/sync/eligibility/eligibility.service.ts - ICM ingestion job
backend/src/sync/handlers/ingest-icm.handler.ts - Job coordination
backend/src/jobs/jobs.service.ts
External data flows
- ICM synchronization
backend/src/sync/icm/icm.service.ts - MIS synchronization
backend/src/sync/mis/mis.service.ts - CRA file preparation
backend/src/cra/outbound/outbound-file.service.ts - CRA transfer
backend/src/cra/transfer/cra-transfer.service.ts - CRA response processing
backend/src/cra/inbound/inbound-response.service.ts - Weekly record matching
backend/src/cra/inbound/inbound-weekly-response.service.ts
Identity and persistence
- Authentication and guards
backend/src/api/common/guards/csa.guard.ts - Application database
backend/src/common/database/prisma.service.ts
Other components
- Staff user
- Canada Revenue Agency
Connections 29
- Staff user → CSA workspace: uses
README.md - CSA workspace → API client: requests data
frontend/src/App.tsx - CSA workspace → Contact endpoints: loads and updates
- API client → Contact endpoints: sends HTTP requests
- CSA workspace → Batch endpoints: submits contacts
- Weekly processing → API client: requests weekly data
frontend/src/components/WeeklyFileProcessingTab.tsx - API client → Weekly-file endpoints: sends HTTP requests
- Job monitoring → API client: requests job status
- API client → Job endpoints: calls jobs API
- Contact endpoints → Eligibility rules: runs eligibility
- Job endpoints → Job coordination: records job runs
backend/src/api/jobs/jobs.controller.ts - Job endpoints → ICM ingestion job: launches jobs
- ICM ingestion job → Job coordination: reads last success
backend/src/sync/handlers/ingest-icm.handler.ts - ICM ingestion job → ICM synchronization: ingests ICM data
backend/src/sync/handlers/ingest-icm.handler.ts - Staff user → Eligibility rules: runs eligibility
README.md - Staff user → Batch endpoints: creates batch
README.md - Batch endpoints → CRA file preparation: prepares CRA submission
- CRA file preparation → CRA transfer: transfers file
- CRA transfer → Canada Revenue Agency: submits file
- Canada Revenue Agency → CRA response processing: returns response
README.md - CRA response processing → Weekly record matching: processes weekly records
- Weekly record matching → Weekly-file endpoints: provides records
- Authentication and guards → Access verification: verifies CSA access
backend/src/api/common/guards/csa.guard.ts - Contact endpoints → Authentication and guards: guards requests
backend/src/api/contacts/contacts.controller.ts - Weekly-file endpoints → Authentication and guards: guards requests
backend/src/api/weekly-files/weekly-files.controller.ts - ICM synchronization → Application database: persists synced data
- MIS synchronization → Application database: persists synced data
- Eligibility rules → Application database: updates eligibility
- Weekly record matching → Application database: stores processed records