Skip to main content

Community Workers API (Cuidadoras)

The Community Workers API manages community agents (cuidadoras) of the social protection program.

Overview​

The Community Workers module manages field agents who perform activities such as: household registration, awareness campaigns, verification, GRM data collection, and vulnerable population monitoring.

Module Architecture​

┌─────────────────────────────────────────────────────────────────────────┐
│ COMMUNITY WORKER │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Personal info: first name, last name, phone, email, etc. │ │
│ │ Assignment zone: region, sector, locality │ │
│ │ Contract: type (volunteer/contracted), dates, status │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────┼─────────────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ ASSIGNMENTS │ │ ACTIVITIES │ │ TRAINING │ │
│ │ Zone │ │ Activity │ │ Certifications│ │
│ │ history │ │ reports │ │ Evaluations │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ PAYMENTS │ │
│ │ Monthly slips│ │
│ │ + Batches │ │
│ └──────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘

Main Endpoints​

EndpointMethodDescription
/api/community-workersGETList community workers
/api/community-workersPOSTCreate a community worker
/api/community-workers/{id}GETGet community worker details
/api/community-workers/{id}PUT/PATCHUpdate a community worker
/api/community-workers/{id}DELETEDelete a community worker
/api/community-workers/statsGETGlobal statistics
/api/community-workers/bulk-statusPOSTBulk status update
/api/community-workers/check-duplicatesPOSTCheck for duplicates
/api/community-workers/{id}/affectationsGETAssignment history
/api/community-workers/{id}/change-affectationPOSTChange assignment
/api/community-workers/{id}/activitesGETActivity reports
/api/community-workers/{id}/certificationsGETCertifications
/api/community-workers/{id}/evaluationsGETEvaluations
/api/community-workers/{id}/photoPOSTUpload photo
/api/community-workers/{id}/photoDELETEDelete photo

Required Permissions​

PermissionDescription
ROLE_USERView, create, update
ROLE_ADMINDelete

Data Model​

CommunityWorker​

FieldTypeDescription
idUUIDUnique identifier
codestringUnique code (format: CW-REGION-SEQ)
prenomstringFirst name
nomstringLast name
nomCompletstringFull name (computed)
sexestringM or F
dateNaissancedateDate of birth
lieuNaissancestringPlace of birth
telephonestringPhone number
emailstringEmail address
niveauInstructionstringEducation level
pieceIdentitestringID document type
numeroPieceIdentitestringID document number
adressetextFull address
languePrincipalestringPrimary language
languesSecondairesarraySecondary languages
typeContratstringvolontaire or contractuel
dateRecrutementdateRecruitment date
dateFinContratdateContract end date
statutstringCurrent status
photostringPhoto path
regionobjectAssigned region
secteurobjectAssigned sector
localiteobjectAssigned locality
superviseurobjectSupervisor (another CW)
createdAtdatetimeCreation date
updatedAtdatetimeLast update date

Statuses​

StatusDescription
actifActive community worker
en_formationIn initial training
suspenduTemporarily suspended
inactifInactive or departed

Contract Types​

TypeDescription
volontaireVolunteer agent, unpaid
contractuelContracted agent, paid

Statistics​

The /api/community-workers/stats endpoint returns:

{
"success": true,
"data": {
"total": 150,
"actifs": 120,
"enFormation": 15,
"suspendus": 5,
"inactifs": 10,
"parSexe": {
"M": 45,
"F": 105
},
"tauxValidation": 85.5,
"tauxCertification": 72.3,
"parRegion": [
{"region": "Oio", "count": 45},
{"region": "Bafata", "count": 35}
]
}
}

Error Codes​

CodeHTTP StatusDescription
NOT_FOUND404Community Worker not found
VALIDATION_ERROR400Invalid data (first/last name required)
INVALID_STATUS400Invalid status
FORBIDDEN403Insufficient permission