feat(v3.0): implémentation Phases 0-8 — RBAC, lifecycle, multi-org, plans, dashboards

Phase 0 : @RolesAllowed SUPER_ADMIN sur POST/DELETE organisations ; AuthenticationFilter pages super-admin
Phase 2 : OrganisationModuleService, @RequiresModule, ModuleAccessFilter, RoleService, PermissionChecker
Phase 3 : multi-org context switching (OrganisationContextFilter, headers X-Active-Organisation-Id / X-Active-Role)
Phase 4 : feature-gating navigation par typeOrganisation (web MenuBean + mobile MorePage)
Phase 5 : MemberLifecycleService — 8 transitions (activer/suspendre/radier/archiver/inviter/accepter/expirer/rappels)
Phase 6 : FormuleAbonnement Option C (planCommercial, apiAccess, federationAccess, quotas) + SouscriptionOrganisation méthodes quota
Phase 7 : DashboardResource SUPER_ADMIN ajouté ; DashboardBean.checkAccessAndRedirect() ; dashboards distincts par rôle
Phase 8 : MembreResourceLifecycleRbacTest, SouscriptionQuotaOptionCTest, OrganisationContextHolderTest, OrganisationContextFilterMultiOrgTest, MemberLifecycleServiceTest
This commit is contained in:
dahoud
2026-04-06 16:49:47 +00:00
parent 39e98a9cb3
commit aef5548e87
34 changed files with 823 additions and 86 deletions

View File

@@ -503,6 +503,26 @@ public class SouscriptionService {
r.setOrganisationId(s.getOrganisation().getId().toString());
r.setOrganisationNom(s.getOrganisation().getNom());
}
// ── Quota & Option C ──────────────────────────────────────────────────────
r.setQuotaMax(s.getQuotaMax());
r.setQuotaUtilise(s.getQuotaUtilise() != null ? s.getQuotaUtilise() : 0);
r.setQuotaDepasse(s.isQuotaDepasse());
if (s.getQuotaMax() != null && s.getQuotaUtilise() != null) {
r.setQuotaRestant(Math.max(0, s.getQuotaMax() - s.getQuotaUtilise()));
}
if (s.getDateFin() != null) {
r.setJoursAvantExpiration(java.time.LocalDate.now().until(s.getDateFin(), java.time.temporal.ChronoUnit.DAYS));
}
if (s.getFormule() != null) {
FormuleAbonnement f = s.getFormule();
r.setPlanCommercial(f.getPlanCommercial());
r.setApiAccess(Boolean.TRUE.equals(f.getApiAccess()));
r.setFederationAccess(Boolean.TRUE.equals(f.getFederationAccess()));
r.setSupportPrioritaire(Boolean.TRUE.equals(f.getSupportPrioritaire()));
r.setSlaGaranti(f.getSlaGaranti());
r.setMaxAdmins(f.getMaxAdmins());
r.setNiveauReporting(f.getNiveauReporting());
}
return r;
}
@@ -518,6 +538,14 @@ public class SouscriptionService {
r.setPrixMensuel(f.getPrixMensuel());
r.setPrixAnnuel(f.getPrixAnnuel());
r.setOrdreAffichage(f.getOrdreAffichage() != null ? f.getOrdreAffichage() : 0);
// Champs Option C (V19)
r.setPlanCommercial(f.getPlanCommercial());
r.setNiveauReporting(f.getNiveauReporting());
r.setApiAccess(Boolean.TRUE.equals(f.getApiAccess()));
r.setFederationAccess(Boolean.TRUE.equals(f.getFederationAccess()));
r.setSupportPrioritaire(Boolean.TRUE.equals(f.getSupportPrioritaire()));
r.setSlaGaranti(f.getSlaGaranti());
r.setMaxAdmins(f.getMaxAdmins() != null ? f.getMaxAdmins() : -1);
return r;
}