- Task #6: WebSocket /ws/dashboard + Kafka events (5 topics) * Backend: KafkaEventProducer, KafkaEventConsumer * Mobile: WebSocketService (reconnection, heartbeat, typed events) * DashboardBloc: Auto-refresh depuis WebSocket events - Finance Workflow: approbations + budgets (backend + mobile) * Backend: entities, services, resources, migrations Flyway V6 * Mobile: features finance_workflow complète avec BLoC - Corrections DI: interfaces IRepository partout * IProfileRepository, IOrganizationRepository, IMembreRepository * GetIt configuré avec @injectable - Spec-Kit: constitution + templates mis à jour * .specify/memory/constitution.md enrichie * Templates agent, plan, spec, tasks, checklist - Nettoyage: fichiers temporaires supprimés Signed-off-by: lions dev Team
134 lines
4.7 KiB
Bash
134 lines
4.7 KiB
Bash
#!/bin/bash
|
|
# Création des organisations MUKEFI et MESKA via l'API REST
|
|
|
|
BACKEND_URL="http://localhost:8085"
|
|
KEYCLOAK_URL="http://localhost:8180"
|
|
REALM="unionflow"
|
|
CLIENT_ID="unionflow-server"
|
|
|
|
echo "========================================================================"
|
|
echo "Création des organisations MUKEFI et MESKA via l'API"
|
|
echo "========================================================================"
|
|
|
|
# 1. Obtenir un token JWT avec le compte superadmin
|
|
echo ""
|
|
echo "📡 Obtention du token JWT..."
|
|
TOKEN_RESPONSE=$(curl -s -X POST "$KEYCLOAK_URL/realms/$REALM/protocol/openid-connect/token" \
|
|
-d "client_id=$CLIENT_ID" \
|
|
-d "username=superadmin" \
|
|
-d "password=Test@123" \
|
|
-d "grant_type=password")
|
|
|
|
ACCESS_TOKEN=$(echo $TOKEN_RESPONSE | grep -o '"access_token":"[^"]*' | cut -d'"' -f4)
|
|
|
|
if [ -z "$ACCESS_TOKEN" ]; then
|
|
echo "❌ Erreur: Impossible d'obtenir le token JWT"
|
|
echo " Vérifiez que le backend est démarré sur $BACKEND_URL"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Token JWT obtenu"
|
|
|
|
# 2. Créer MUKEFI (Mutuelle)
|
|
echo ""
|
|
echo "🏦 Création de MUKEFI (Mutuelle)..."
|
|
|
|
MUKEFI_JSON='{
|
|
"nom": "Mutuelle d'\''Épargne et de Crédit des Fonctionnaires et Indépendants",
|
|
"nomCourt": "MUKEFI",
|
|
"description": "Mutuelle d'\''épargne et de crédit dédiée aux fonctionnaires et travailleurs indépendants de Côte d'\''Ivoire",
|
|
"email": "contact@mukefi.org",
|
|
"telephone": "+225 07 00 00 00 01",
|
|
"siteWeb": "https://mukefi.org",
|
|
"typeOrganisation": "MUTUELLE_EPARGNE_CREDIT",
|
|
"statut": "ACTIVE",
|
|
"dateFondation": "2020-01-15",
|
|
"numeroEnregistrement": "MUT-CI-2020-001",
|
|
"devise": "XOF",
|
|
"budgetAnnuel": 500000000,
|
|
"cotisationObligatoire": true,
|
|
"montantCotisationAnnuelle": 50000,
|
|
"objectifs": "Favoriser l'\''épargne et l'\''accès au crédit pour les membres",
|
|
"activitesPrincipales": "Épargne, crédit, micro-crédit, formation financière",
|
|
"partenaires": "Banque Centrale des États de l'\''Afrique de l'\''Ouest (BCEAO)",
|
|
"latitude": 5.3364,
|
|
"longitude": -4.0267
|
|
}'
|
|
|
|
MUKEFI_RESPONSE=$(curl -s -X POST "$BACKEND_URL/api/organisations" \
|
|
-H "Authorization: Bearer $ACCESS_TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
-d "$MUKEFI_JSON")
|
|
|
|
if echo "$MUKEFI_RESPONSE" | grep -q '"id"'; then
|
|
echo "✅ MUKEFI créée avec succès"
|
|
MUKEFI_ID=$(echo $MUKEFI_RESPONSE | grep -o '"id":"[^"]*' | cut -d'"' -f4)
|
|
echo " ID: $MUKEFI_ID"
|
|
else
|
|
echo "⚠️ MUKEFI: $(echo $MUKEFI_RESPONSE | head -c 200)"
|
|
fi
|
|
|
|
# 3. Créer MESKA (Association)
|
|
echo ""
|
|
echo "🤝 Création de MESKA (Association)..."
|
|
|
|
MESKA_JSON='{
|
|
"nom": "Mouvement d'\''Entraide et de Solidarité de Koumassi et Adjamé",
|
|
"nomCourt": "MESKA",
|
|
"description": "Association communautaire d'\''entraide et de solidarité basée à Abidjan",
|
|
"email": "contact@meska.org",
|
|
"telephone": "+225 07 00 00 00 02",
|
|
"siteWeb": "https://meska.org",
|
|
"typeOrganisation": "ASSOCIATION",
|
|
"statut": "ACTIVE",
|
|
"dateFondation": "2018-06-20",
|
|
"numeroEnregistrement": "ASSO-CI-2018-045",
|
|
"devise": "XOF",
|
|
"budgetAnnuel": 25000000,
|
|
"cotisationObligatoire": true,
|
|
"montantCotisationAnnuelle": 25000,
|
|
"objectifs": "Promouvoir la solidarité et l'\''entraide entre les membres des communes de Koumassi et Adjamé",
|
|
"activitesPrincipales": "Aide sociale, événements communautaires, formations, projets collectifs",
|
|
"partenaires": "Mairie de Koumassi, Mairie d'\''Adjamé",
|
|
"latitude": 5.2931,
|
|
"longitude": -3.9468
|
|
}'
|
|
|
|
MESKA_RESPONSE=$(curl -s -X POST "$BACKEND_URL/api/organisations" \
|
|
-H "Authorization: Bearer $ACCESS_TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
-d "$MESKA_JSON")
|
|
|
|
if echo "$MESKA_RESPONSE" | grep -q '"id"'; then
|
|
echo "✅ MESKA créée avec succès"
|
|
MESKA_ID=$(echo $MESKA_RESPONSE | grep -o '"id":"[^"]*' | cut -d'"' -f4)
|
|
echo " ID: $MESKA_ID"
|
|
else
|
|
echo "⚠️ MESKA: $(echo $MESKA_RESPONSE | head -c 200)"
|
|
fi
|
|
|
|
# 4. Vérifier les organisations créées
|
|
echo ""
|
|
echo "📋 Vérification des organisations créées..."
|
|
|
|
ORGS_LIST=$(curl -s -X GET "$BACKEND_URL/api/organisations" \
|
|
-H "Authorization: Bearer $ACCESS_TOKEN")
|
|
|
|
echo "$ORGS_LIST" | grep -o '"nom":"[^"]*' | cut -d'"' -f4
|
|
|
|
echo ""
|
|
echo "========================================================================"
|
|
echo "✅ Création des organisations terminée"
|
|
echo "========================================================================"
|
|
echo ""
|
|
echo "🏦 MUKEFI:"
|
|
echo " → Type: Mutuelle d'épargne et de crédit"
|
|
echo " → Email: contact@mukefi.org"
|
|
echo " → Modules: Cotisations, Épargne/Crédit, Comptabilité, Documents"
|
|
echo ""
|
|
echo "🤝 MESKA:"
|
|
echo " → Type: Association"
|
|
echo " → Email: contact@meska.org"
|
|
echo " → Modules: Cotisations, Événements, Solidarité, Documents"
|
|
echo ""
|