Aller au contenu principal

API Community Workers (Cuidadoras)

L'API Community Workers permet de gerer les agents communautaires (cuidadoras) du programme de protection sociale.

Vue d'ensemble​

Le module Community Workers gere les agents communautaires qui effectuent des activites sur le terrain : enregistrement de menages, sensibilisation, verification, collecte GRM, et suivi des vulnerables.

Architecture du module​

┌─────────────────────────────────────────────────────────────────────────┐
│ COMMUNITY WORKER │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Informations personnelles: nom, prenom, telephone, email, etc. │ │
│ │ Zone d'affectation: region, secteur, localite │ │
│ │ Contrat: type (volontaire/contractuel), dates, statut │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────┼─────────────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ AFFECTATIONS │ │ ACTIVITES │ │ FORMATIONS │ │
│ │ Historique │ │ Rapports │ │ Certifications│ │
│ │ des zones │ │ d'activite │ │ Evaluations │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ PAIEMENTS │ │
│ │ Fiches mensu-│ │
│ │ elles + Lots │ │
│ └──────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘

Endpoints principaux​

EndpointMethodeDescription
/api/community-workersGETListe des community workers
/api/community-workersPOSTCreer un community worker
/api/community-workers/{id}GETDetail d'un community worker
/api/community-workers/{id}PUT/PATCHModifier un community worker
/api/community-workers/{id}DELETESupprimer un community worker
/api/community-workers/statsGETStatistiques globales
/api/community-workers/bulk-statusPOSTModification en masse du statut
/api/community-workers/check-duplicatesPOSTVerifier les doublons
/api/community-workers/{id}/affectationsGETHistorique des affectations
/api/community-workers/{id}/change-affectationPOSTChanger l'affectation
/api/community-workers/{id}/activitesGETRapports d'activite
/api/community-workers/{id}/certificationsGETCertifications
/api/community-workers/{id}/evaluationsGETEvaluations
/api/community-workers/{id}/photoPOSTUpload photo
/api/community-workers/{id}/photoDELETESupprimer photo
/api/community-workers/paiementsGETListe des paiements cuidadors
/api/community-workers/paiements/statsGETStatistiques des paiements
/api/community-workers/kobo/formsGETFormulaires Kobo disponibles
/api/community-workers/kobo/syncPOSTSynchroniser depuis Kobo
/api/community-workers/kobo/importPOSTImporter des soumissions
/api/community-workers/kobo/recentGETCW importes recemment
/api/community-workers/kobo/statsGETStatistiques d'import Kobo

Modele de donnees​

CommunityWorker​

ChampTypeDescription
idUUIDIdentifiant unique
codestringCode unique (format: CW-REGION-SEQ)
prenomstringPrenom
nomstringNom
nomCompletstringNom complet (calcule)
sexestringM ou F
dateNaissancedateDate de naissance
lieuNaissancestringLieu de naissance
telephonestringNumero de telephone
emailstringAdresse email
niveauInstructionstringNiveau d'instruction
pieceIdentitestringType de piece d'identite
numeroPieceIdentitestringNumero de la piece
adressetextAdresse complete
languePrincipalestringLangue principale
languesSecondairesarrayLangues secondaires
typeContratstringvolontaire ou contractuel
dateRecrutementdateDate de recrutement
dateFinContratdateDate de fin de contrat
statutstringStatut actuel
photostringChemin vers la photo
regionobjectRegion d'affectation
secteurobjectSecteur d'affectation
localiteobjectLocalite d'affectation
superviseurobjectSuperviseur (autre CW)
programmeobjectProgramme associe
koboSubmissionIdstringID de la soumission Kobo (si importe)
koboSubmissionTimedatetimeDate de soumission Kobo
agentCollectestringNom de l'agent ayant collecte les donnees
createdAtdatetimeDate de creation
updatedAtdatetimeDate de mise a jour

Statuts​

StatutDescription
actifCommunity worker en activite
suspenduTemporairement suspendu
inactifInactif ou sorti

Types de contrat​

TypeDescription
volontaireAgent benevole, non remunere
contractuelAgent sous contrat, remunere

Statistiques​

L'endpoint /api/community-workers/stats retourne :

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

Codes d'erreur​

CodeStatut HTTPDescription
NOT_FOUND404Community Worker non trouve
VALIDATION_ERROR400Donnees invalides (nom/prenom requis)
INVALID_STATUS400Statut invalide
FORBIDDEN403Permission insuffisante