feat(ce): Sprint G — data model + admin validation #81

Merged
tarzzan merged 1 commit from feat/ce-sprint-g into main 2026-06-02 22:56:28 +00:00
Owner

Sprint G — Data model + admin validation

Première brique du plan CE (Comités d'Entreprise) défini dans ~/.claude/plans/logical-pondering-hummingbird.md.

Schéma

  • Organization gagne approved / approvedAt / approvedBy / contactEmail. Migration backfille toutes les orgs existantes (CMCK) → approved=true pour ne casser personne.
  • Nouveau OrganizationCarbetMembership (manyToMany Org↔Carbet) — la table de jointure qui supporte la co-gestion CE. Invariant : un Carbet a un ownerId (créateur initial) + 0..n memberships. Un hôte individuel = aucun membership ; un carbet CE = au moins 1 membership.
  • RentalProvider.organizationId (nullable, SetNull on delete) — un CE peut posséder son provider rental dédié.

Migration appliquée à la DB prod, CMCK confirmé approved=true.

Plugin

ce-management ajouté au registry (catégorie business, off par défaut). Quand off : signup CE caché + dashboard /espace-ce 404. Permet de shipper la feature sans la rendre visible tant que System D n'est pas prêt à embarquer des CE.

Admin

  • Tab statut sur /admin/organizations (Toutes / À valider [count] / Validées) avec compteur des pending dans l'en-tête.
  • Badge statut sur la liste et la page détail.
  • Bouton « Valider l'organisation » → action approveOrganizationAction (flip approved=true + audit organization.approve). Idempotent.
  • Détail montre carbetMemberships._count et rentalProviders._count.

Test plan

  • npm test → 53/53 ✓
  • npm run typecheck
  • npm run lint
  • npm run build
  • /admin/organizations : voir les 3 tabs, CMCK en « Validée »
  • Créer une nouvelle org via + Nouvelle organisation → arrive dans tab « À valider »
  • Cliquer « Valider l'organisation » → flip + audit log
  • Vérifier que CMCK reste en approved=true après migration (déjà confirmé en SQL)

🤖 Generated with Claude Code

## Sprint G — Data model + admin validation Première brique du plan CE (Comités d'Entreprise) défini dans `~/.claude/plans/logical-pondering-hummingbird.md`. ### Schéma - `Organization` gagne `approved` / `approvedAt` / `approvedBy` / `contactEmail`. **Migration backfille toutes les orgs existantes (CMCK) → approved=true** pour ne casser personne. - Nouveau `OrganizationCarbetMembership` (manyToMany Org↔Carbet) — la table de jointure qui supporte la co-gestion CE. Invariant : un Carbet a un `ownerId` (créateur initial) + 0..n memberships. Un hôte individuel = aucun membership ; un carbet CE = au moins 1 membership. - `RentalProvider.organizationId` (nullable, SetNull on delete) — un CE peut posséder son provider rental dédié. Migration appliquée à la DB prod, CMCK confirmé `approved=true`. ### Plugin `ce-management` ajouté au registry (catégorie business, off par défaut). Quand off : signup CE caché + dashboard `/espace-ce` 404. Permet de shipper la feature sans la rendre visible tant que System D n'est pas prêt à embarquer des CE. ### Admin - Tab statut sur `/admin/organizations` (Toutes / À valider [count] / Validées) avec compteur des pending dans l'en-tête. - Badge statut sur la liste et la page détail. - Bouton « Valider l'organisation » → action `approveOrganizationAction` (flip approved=true + audit `organization.approve`). Idempotent. - Détail montre `carbetMemberships._count` et `rentalProviders._count`. ### Test plan - [x] `npm test` → 53/53 ✓ - [x] `npm run typecheck` ✓ - [x] `npm run lint` ✓ - [x] `npm run build` ✓ - [ ] `/admin/organizations` : voir les 3 tabs, CMCK en « Validée » - [ ] Créer une nouvelle org via `+ Nouvelle organisation` → arrive dans tab « À valider » - [ ] Cliquer « Valider l'organisation » → flip + audit log - [ ] Vérifier que CMCK reste en `approved=true` après migration (déjà confirmé en SQL) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tarzzan added 1 commit 2026-06-02 22:56:16 +00:00
feat(ce): Sprint G — data model + admin validation
All checks were successful
CI / test (pull_request) Successful in 2m38s
946dd8d5d2
Schema:
- Organization gagne le workflow d'approbation (approved + approvedAt +
  approvedBy + contactEmail). Backfill : toutes les orgs existantes
  (CMCK) → approved=true via migration.
- Nouveau OrganizationCarbetMembership (manyToMany Org↔Carbet) pour la
  co-gestion CE : un Carbet a un ownerId (créateur initial) + 0..n
  memberships ; chaque CE_MANAGER d'une org liée peut gérer le carbet
  en plus de l'owner. Pour un hôte individuel = pas de membership.
- RentalProvider.organizationId (nullable, SetNull on delete) : un CE
  peut posséder son provider ; les CE_MANAGERs membres de l'org y ont
  accès en plus du manager nominal.

Plugin ce-management ajouté au registry (catégorie business, off par
défaut). Quand off : signup CE caché + dashboard /espace-ce 404.

Admin organizations :
- Tab statut (Toutes / À valider [count] / Validées) avec compteur des
  organisations pending dans l'en-tête.
- Badge statut sur la liste et la page détail.
- Bouton « Valider l'organisation » sur le détail (action
  approveOrganizationAction → flip approved=true + approvedAt + audit
  log organization.approve). Idempotent : un re-appel sur une org déjà
  validée ne re-loggue pas.
- Détail montre les compteurs carbetMemberships + rentalProviders.

Migration appliquée à la DB prod (CMCK backfill validé).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tarzzan merged commit 8609c3c98b into main 2026-06-02 22:56:28 +00:00
tarzzan deleted branch feat/ce-sprint-g 2026-06-02 22:56:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tarzzan/karbe#81
No description provided.