1d21a3788d
CI / Contraintes NON-NÉGOCIABLES (CLAUDE.md) (push) Has been cancelled
CI / Validation JSON (schémas Faisabilité) (push) Has been cancelled
CI / Qualité documentaire (liens + 4Big) (push) Has been cancelled
CI / Reproductibilité des artefacts out/ (build == commité) (push) Has been cancelled
CI / Fraîcheur matrice de régression (run == commité) (push) Has been cancelled
CI / Intégrité du câblage CI (gate agrège tout · gates statiques verrouillés) (push) Has been cancelled
CI / Publiciste · parser + schéma + generator (unittest) (push) Has been cancelled
CI / RBAC · 50 rôles + schéma (unittest) (push) Has been cancelled
CI / Faisabilité · générateur 4 volets + round-trip (unittest) (push) Has been cancelled
CI / RBAC · fixtures ERPNext (Role + Custom DocPerm) (push) Has been cancelled
CI / RBAC · plan User Permission (row-level) (push) Has been cancelled
CI / RBAC · Role Profile (bundles par portail) (push) Has been cancelled
CI / RBAC · run-book d'application unifié (agrégat 3 volets) (push) Has been cancelled
CI / Faisabilité · dossier bancable trilingue FR/EN/ES (push) Has been cancelled
CI / CRM · workflow vente ERPNext (lead → CONFOTUR) (push) Has been cancelled
CI / CRM · DocType porteur OTO Dossier Vente (push) Has been cancelled
CI / CRM · barème commissions vendeurs (push) Has been cancelled
CI / Fiscal · e-CF DGII (Compupar) (push) Has been cancelled
CI / Frontend · Workspaces 5 portails rôle (push) Has been cancelled
CI / Legal · DocType CONFOTUR Application (push) Has been cancelled
CI / QA · Audit 5D conformité (push) Has been cancelled
CI / SEO · mots-clés trilingues + schema.org + hreflang (push) Has been cancelled
CI / Chat OTOIA · montage par portail (Custom Block) (push) Has been cancelled
CI / QA · Audit 4Big (95+/100 sur 100% deliverables) (push) Has been cancelled
CI / Démo · Scénarios (run-sheet P07 banquier / P05 client) (push) Has been cancelled
CI / QA · Matrice de régression exhaustive (Sprint 8) (push) Has been cancelled
CI / DevOps · Run-book de déploiement VPS unifié (Sprint 8) (push) Has been cancelled
CI / QA · Matrice d'acceptation / traçabilité MVP (Sprint 8) (push) Has been cancelled
CI / Mobile · config app Expo/EAS (navigation par rôle) (push) Has been cancelled
CI / E2E baseline Playwright (manuel) (push) Has been cancelled
CI / Gate qualité (agrégat) (push) Has been cancelled
94 lines
3.2 KiB
Python
94 lines
3.2 KiB
Python
"""Dépendances partagées du générateur de config app mobile · réutilisation stricte (#5).
|
|
|
|
On NE réimplémente rien qui existe déjà dans le mandat :
|
|
- `validator` (validateur JSON-Schema draft-07 maison) et `branding` (tokens de
|
|
marque #4 + devises #10) sont importés du livrable Publiciste, source unique.
|
|
- la résolution RBAC → rôles par portail est importée du builder des Workspaces
|
|
(`frontend/portails/wslib/builder.py`) : l'app mobile s'ancre sur EXACTEMENT la
|
|
même surface RBAC que les Workspaces et le Chat OTOIA — aucune logique dupliquée.
|
|
|
|
Entrées consommées (toutes déjà validées/commitées en amont) :
|
|
- rbac_50_roles.json (contrat RBAC · portails_business + rôles)
|
|
- frontend/portails/portails_spec.json (labels + icônes des 5 portails · mise en page)
|
|
- seo/seo_spec.json (langues trilingues FR/EN/ES · source unique)
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
_HERE = os.path.dirname(os.path.abspath(__file__))
|
|
_MOBILE = os.path.dirname(_HERE) # mobile/app_config/
|
|
_MOBILE_ROOT = os.path.normpath(os.path.join(_MOBILE, "..")) # mobile/
|
|
_DELIVERABLES = os.path.normpath(os.path.join(_MOBILE_ROOT, "..")) # 05_deliverables_mvp/
|
|
_PUBLICISTE = os.path.join(_DELIVERABLES, "publiciste")
|
|
_PORTAILS = os.path.join(_DELIVERABLES, "frontend", "portails")
|
|
_RBAC_DIR = os.path.join(_DELIVERABLES, "rbac")
|
|
_SEO = os.path.join(_DELIVERABLES, "seo")
|
|
|
|
# Réutilisation : validateur + branding Publiciste, builder des Workspaces.
|
|
for _p in (_PUBLICISTE, _PORTAILS):
|
|
if _p not in sys.path:
|
|
sys.path.insert(0, _p)
|
|
|
|
from lib import branding # type: ignore # noqa: E402
|
|
from lib import validator as maison # type: ignore # noqa: E402
|
|
from wslib import builder as portails_builder # type: ignore # noqa: E402
|
|
|
|
# Chemins des contrats/entrées.
|
|
SPEC_PATH = os.path.join(_MOBILE, "mobile_spec.json")
|
|
SCHEMA_PATH = os.path.join(_MOBILE, "mobile.schema.json")
|
|
CONTRACT_PATH = os.path.join(_RBAC_DIR, "rbac_50_roles.json")
|
|
PORTAILS_SPEC_PATH = os.path.join(_PORTAILS, "portails_spec.json")
|
|
SEO_SPEC_PATH = os.path.join(_SEO, "seo_spec.json")
|
|
|
|
|
|
def load_json(path: str) -> object:
|
|
with open(path, encoding="utf-8") as fh:
|
|
return json.load(fh)
|
|
|
|
|
|
def load_spec() -> dict:
|
|
return load_json(SPEC_PATH)
|
|
|
|
|
|
def load_contract() -> dict:
|
|
return load_json(CONTRACT_PATH)
|
|
|
|
|
|
def load_portails_spec() -> dict:
|
|
return load_json(PORTAILS_SPEC_PATH)
|
|
|
|
|
|
def load_langs() -> tuple[list[str], str]:
|
|
"""Langues + langue par défaut DÉRIVÉES du seo_spec (source unique · #5)."""
|
|
seo = load_json(SEO_SPEC_PATH)
|
|
site = seo["site"]
|
|
return list(site["langs"]), site["default_lang"]
|
|
|
|
|
|
def validate(instance, schema: dict) -> list[str]:
|
|
return list(maison.validate(instance, schema))
|
|
|
|
|
|
# Réexport : surface RBAC des rôles par portail = celle des Workspaces (source unique).
|
|
roles_by_portail = portails_builder.roles_by_portail
|
|
|
|
__all__ = [
|
|
"branding",
|
|
"load_json",
|
|
"load_spec",
|
|
"load_contract",
|
|
"load_portails_spec",
|
|
"load_langs",
|
|
"validate",
|
|
"roles_by_portail",
|
|
"SPEC_PATH",
|
|
"SCHEMA_PATH",
|
|
"CONTRACT_PATH",
|
|
"PORTAILS_SPEC_PATH",
|
|
"SEO_SPEC_PATH",
|
|
]
|