Skip to main content
Petanque Life
← Back to all features
01

Federation & Governance

87 features · 8 subsystems

Management of the global petanque organizational hierarchy from FIPJP down to individual clubs, including governance structures, commissions, elections, and inter-federation coordination.

Federation Hierarchy Management

F01.01
Shipped

Management of the federation structure using **standalone tenants** — every federation (national, continental, FIPJP) is independent. Combined with **OrgNodes** for clubs within each national tenant.

How it works
  • F01.01.01 Shipped

    Standalone tenant per federation (national, continental, world)

    ✅ PL-F0101a
  • F01.01.02 Shipped

    Tenant creation, configuration, branding

    ✅ PL-F0101a
  • F01.01.03 Shipped

    Federation profile pages (logo, address, contacts, statutes, history)

    ✅ PL-F0101a
  • F01.01.04 Shipped

    Federation type classification (continental, national, world)

    ✅ PL-F0101a
  • F01.01.05 Shipped

    Public API for cross-tenant interactions (license verification, ITC, squad submission)

    ✅ PL-F0101a
  • F01.01.06 Shipped

    Federation status tracking (active, suspended, provisional, expelled)

    ✅ PL-F0101a
  • F01.01.07 Shipped

    Federation founding date, affiliation date, recognition history — founding_date, affiliation_date och recognition_history (FederationRecognitionEvent-kronologi) exponerat på admin-CRUD + publik directory

    ✅ PL-F0101b
  • F01.01.08 Shipped

    Federation directory (public listing of known federations and their API endpoints) — lean GET /public/federations/directory med filter på typ/status/kontinent/with_api_endpoint/fipjp_only

    ✅ PL-F0101b
  • F01.01.09 Shipped

    Federation map visualization (geographic boundaries) — GET /public/federations/map returnerar GeoJSON Polygon/MultiPolygon + Point-center + map_zoom_default, expelled-federationer exkluderade

    ✅ PL-F0101b
  • F01.01.10 Shipped

    Federation statistics dashboard (members, clubs, competitions per level) — GET /federations/{id}/statistics aggregerar klubbar/distrikt/medlemmar/tävlingar per nivå, zero-valued för federationer utan tenant-länk (aldrig cross-tenant)

    ✅ PL-F0101b
  • F01.01.11 Shipped

    Clubs as OrgNodes under their district in the OrgNode hierarchy — Club.district_id kopplar klubbar till distrikt-subtree, verifierat via publik GET /public/clubs

    ✅ PL-F0101b
  • F01.01.12 Shipped

    District management (OrgNodes with authority — sanction, DM, boards) — DistrictCapabilities overrides layered on tenant OrgNodeTypeConfig defaults, GET/PUT /districts/{id}/capabilities

    ✅ PL-F0101b / PL-F0101c
  • F01.01.13 Shipped

    Configurable district hierarchy depth per tenant (0 levels: Norway; 1 level: Sweden/Germany; 2+ levels: France ligue→comité) — exposed via GET /org-nodes/hierarchy

    ✅ PL-F0101c
  • F01.01.14 Shipped

    District-based scope filtering (district admin sees clubs in their OrgNode subtree) — X-District-Scope header / scope_district_id query on /clubs and /districts, BFS subtree resolver

    ✅ PL-F0101c
  • F01.01.15 Shipped

    Configurable OrgNode capabilities per level — each OrgNode level can be granted: can_sanction (+ sanction_levels), can_set_license_price, has_discipline_body, can_issue_licenses, has_own_league. Exposed via POST /org-nodes/check-capability.

    ✅ PL-F0101c
  • F01.01.16 Shipped

    OrgNode type registry per tenant — CRUD under /org-nodes/tenant-configs/{id}/types, atomic TenantConfig-validator re-run, localized names via Accept-Language

    ✅ PL-F0101c
  • F01.01.17 Shipped

    Multi-tenant admin access — operatörer med åtkomst till flera federationer listas via GET /auth/me/tenants (home-tenant först, övriga från RoleAssignment/scope), växling via POST /auth/switch-tenant som mintar ny JWT. UI: avatar-dropdown i admin top-nav (specs/admin/views/tenant-switcher.md).

    ✅ PL-1902
  • F01.01.18 Shipped

    Standalone club tenant — TenantType.CLUB enum, self-service POST /public/tenants/club skapar tenant + klubb + admin-användare med magic-link, platt hierarki (0-1 nivåer), migration_source={"created_as":"standalone_club"}.

    ✅ PL-T001
  • F01.01.19 Shipped

    Club-to-federation migration — POST /admin/tenants/{id}/migrate-to-federation flyttar Club/License/Match/Membership/Ranking/CalendarEvent till mål-tenant, arkiverar käll-tenant, GET .../migration-preflight ger räknar-rapport + duplikat-detektering. Admin-UI: 3-stegs-wizard i TenantMigration.tsx.

    ✅ PL-T001
  • F01.01.20 Shipped

    Affiliate tenant type — TenantType.AFFILIATE för icke-förbundsorganisationer (Korpen, SPF, handisport, skolidrott). €999/år, platt hierarki (depth=0), fritt definierade medlemskategorier, hårdkodade restriktioner (ej licenser, ej rankade tävlingar, ej ITC). POST /admin/tenants/affiliate, CapabilityProfile med hårdkodade+konfigurerbara fält. PL-T302: hybrid signup-flöde — public intake /contact-sales?topic=affiliate → POST /public/contact-sales/affiliate med Turnstile + rate-limit 5/h/IP, sys_support kvalificerar via /customer-base/affiliate-signups innan Stripe Payment Link skickas, webhook driver provisionering via existerande PL-T003-handler.

    ✅ PL-T003 / PL-T302
  • F01.01.21 Shipped

    Affiliate bridge link — AffiliateBridgeLink kopplar affiliate-medlem till förbundslicens via opt-in per spelare. POST /affiliate/{id}/bridge verifierar licensnummer mot förbundets publika licens-API. Status: pending→verified→expired/revoked. PL-T302: vid signup med bridge_to_federation=true skickas notifikation + audit-event till nationella federationens sys_engineer post-provisionering.

    ✅ PL-T003 / PL-T302
  • F01.01.22 Shipped

    Affiliate consolidated history — GET /affiliate/{id}/members/{user_id}/consolidated-history slår ihop matcher från affiliate- och förbundstenant, sorterade kronologiskt, taggade med source_tenant_id och source_type. Kräver aktiv brygglänk för förbundsdata.

    ✅ PL-T003
  • F01.01.23 Shipped

    Multi-discipline club support — Club.disciplines array (min 1 required, default [petanque]). GET/PUT /clubs/{id}/disciplines sub-resource. ?discipline= query param on GET /clubs. Removal blocked by 409 if active competitions/licenses exist. Admin toggle UI.

    ✅ PL-T013

Governance Bodies & Commissions

F01.02
Shipped

F01.02.01–04 levererade i **PL-F0102a**, F01.02.05–08 levererade i **PL-F0102b**. API: `specs/api/endpoints/commissions.md`, `specs/api/endpoints/meetings.md`, `specs/api/endpoints/governance-audit.md`.

How it works
  • F01.02.01 Shipped

    Commission/committee registry (disciplinary, umpire, medical, selection, etc.) — /commissions CRUD + filter på typ/status/jurisdiction/authority_level

    ✅ PL-F0102a
  • F01.02.02 Shipped

    Commission membership management (chair, members, terms) — add/update/remove + expiring-terms

    ✅ PL-F0102a
  • F01.02.03 Shipped

    Commission mandate and scope definition — strukturerad CommissionScope (jurisdiction × authority_level × authority_areas × reports_to) med org_node-invariant

    ✅ PL-F0102a
  • F01.02.04 Shipped

    Meeting management (agenda, minutes, decisions) — /meetings CRUD + agenda/minutes/decisions-sub-endpoints

    ✅ PL-F0102a
  • F01.02.05 Shipped

    Decision tracking and publication — lifecycle draft → adopted → published → rescinded, röstningssammanfattning, auto-genererat {YYYY}-{NNN}-referensnummer och tvärmötes-listning på /meetings/published/decisions

    ✅ PL-F0102b
  • F01.02.06 Shipped

    Term limits and rotation tracking — term_limit_months, max_consecutive_terms, rotation_policy, konsekutiv-term med 120-dagars gap-reset och /commissions/{id}/rotation-report

    ✅ PL-F0102b
  • F01.02.07 Shipped

    Conflict of interest declarations — strukturerad ConflictOfInterestDeclaration (typ × status) på ledamot, /commissions/{id}/conflicts listning + member-scoped CRUD med lifecycle-invarianter

    ✅ PL-F0102b
  • F01.02.08 Shipped

    Audit trail on all governance actions — append-only GovernanceAuditLog skrivs från samtliga muterande endpoints, read-only /governance/audit-router med filter och /actions-taxonomi, tenant-isolerad

    ✅ PL-F0102b

Elections & Voting

F01.03
Shipped

Implementerat i PL-1601 och utökat i PL-F0103a/b. API: `specs/api/endpoints/elections.md`. PL-F0103a levererade publikt tillkännagivande, röstberättigandeservice och publik listning av tillkännagivna val. PL-F0103b färdigställde subsectionen med enterprise-kvalitet på rösträkning (kvorum + tie-break-detektion), fullmaktsröstning (proxy-kedjespärr, positionsbegränsade fullmakter, `revocation_reason`, konfigurerbar `max_proxies_per_voter`) och append-only granskningslogg (`ElectionAuditLog` + `ElectionAuditAction`-enum där ballot-secrecy upprätthålls av både modellvalidator och service-lagrets `_sanitize_details`). Ny publik resultat-endpoint `GET /public/elections/{id}/results`.

How it works
  • F01.03.01 Shipped

    Election scheduling and announcement

    ✅ PL-F0103a
  • F01.03.02 Shipped

    Candidate registration and profile

    ✅ PL-F0103a
  • F01.03.03 Shipped

    Voter eligibility rules per federation level

    ✅ PL-F0103a
  • F01.03.04 Shipped

    Secure online voting (anonymous, verifiable)

    ✅ PL-F0103a
  • F01.03.05 Shipped

    Vote counting and result publication

    ✅ PL-F0103b
  • F01.03.06 Shipped

    Proxy voting support

    ✅ PL-F0103b
  • F01.03.07 Shipped

    Audit trail on voting processes

    ✅ PL-F0103b
  • F01.03.08 Shipped

    Governance meetings (AGM, board, committee) with quorum, voting, minutes and QES signing via Freja eID/BankID/DocuSign

    ✅ PL-T104

Rules & Regulations

F01.04
Planned

Implemented in PL-1602 and extended in PL-F0104a/b. API: `RuleDocument`, `RuleVersion`, `RuleInterpretation`, `RuleChangeSubscription`, `RuleChangeEvent` models with full CRUD, versioning with diff, workflow (draft→proposed→approved→archived), translation status tracking, multilingual search, BFS cross-reference graph, interpretation database with FAQ/case-law/guidance classification and precedent chains, and a per-tenant rule-change notification fan-out that writes audit events and emits `FEDERATION_CIRCULAR` notifications. Spec: `specs/api/endpoints/rules.md`. PL-F0104a delivered 36 tests for F01.04.01–04; PL-F0104b added 45 more (81 total) covering F01.04.05–07.

How it works
  • F01.04.01 Shipped

    Rule repository with versioning (FIPJP official rules)

    ✅ PL-F0104a
  • F01.04.02 Shipped

    National/regional rule variations and supplements

    ✅ PL-F0104a
  • F01.04.03 Shipped

    Rule change proposal workflow

    ✅ PL-F0104a
  • F01.04.04 Shipped

    Rule translation management (multi-language)

    ✅ PL-F0104a
  • F01.04.05 Shipped

    Rule search and cross-reference (incl. BFS graph walk)

    ✅ PL-F0104b
  • F01.04.06 Shipped

    Rule interpretation database (FAQs, case law, precedent chain)

    ✅ PL-F0104b
  • F01.04.07 Shipped

    Notification of rule changes to affected federations

    ✅ PL-F0104b

Inter-Federation Communication

F01.05
Platform+

Implemented in PL-F0105 on top of the PL-902 scaffolding. Delivers the

How it works
  • F01.05.01 Shipped

    Official correspondence system (federation to federation)

    ✅ PL-F0105
  • F01.05.02 Shipped

    Circular distribution (FIPJP to all members)

    ✅ PL-F0105
  • F01.05.03 Shipped

    Document sharing between federation levels

    ✅ PL-F0105
  • F01.05.04 Shipped

    Calendar synchronization across federation levels

    ✅ PL-F0105
  • F01.05.05 Shipped

    Congress/general assembly management

    ✅ PL-F0105
  • F01.05.06 Shipped

    Resolution tracking and compliance monitoring

    ✅ PL-F0105

Club Management

F01.06
Shipped

Clubs are **OrgNodes** under their district in the OrgNode hierarchy.

How it works
  • F01.06.01 Shipped

    Club registration as OrgNode under district in the OrgNode hierarchy

    ✅ PL-F0106a
  • F01.06.02 Shipped

    Club profile (name, logo, venue, contact, founding year)

    ✅ PL-F0106a
  • F01.06.03 Shipped

    Club board/officers management (president, secretary, treasurer, etc.)

    ✅ PL-F0106a
  • F01.06.04 Shipped

    Club affiliation status and annual renewal

    ✅ PL-F0106a
  • F01.06.05 Shipped

    Club member roster management

    ✅ PL-F0106a
  • F01.06.06 Shipped

    Club statistics (members, competitions hosted, results) — GET /clubs/{id}/statistics aggregerar medlemmar/styrelse/anslutning/värdskap/resultat med tenant-scopad, typad Beanie-query

    ✅ PL-F0106b
  • F01.06.07 Shipped

    Club-to-club communication — trådad meddelandetjänst (ClubMessage) med cross-tenant-block, reply/mark-read/direction-filter

    ✅ PL-F0106b
  • F01.06.08 Shipped

    Club search/directory (by district, facilities, level) — city/level/facility ($all) filter + nya index (level,1), (facilities,1), (venue.city,1)

    ✅ PL-F0106b
  • F01.06.09 Shipped

    Club document management (statutes, insurance, permits) — ClubDocument med sluten kategori-enum, versionskedja, verify/expiring-sweep, soft-delete

    ✅ PL-F0106b
  • F01.06.10 Shipped

    Safeguarding officer designation and tracking — embedded SafeguardingOfficer + append-only safeguarding_history, 6 endpoints, BackgroundCheck-länk

    ✅ PL-F0106b

Per-tenant Hierarchy & OrgNode Configuration

F01.07
Shipped

Per-tenant hierarchy configuration. Every federation chooses its own OrgNode

How it works
  • F01.07.01 Shipped

    Configurable hierarchy depth per tenant (0–3 intermediate levels)

    ✅ PL-F0107a
  • F01.07.02 Shipped

    Sverige — distrikt → klubb (SBF seed uses depth=1 with distrikt as the only intermediate OrgNode type)

    ✅ PL-F0107a
  • F01.07.03 Shipped

    France — ligue → comité → club (FFPJP seed uses depth=2 with ligue and comité)

    ✅ PL-F0107a
  • F01.07.04 Shipped

    Norge — direkt klubb under förbund (NBF seed uses depth=0, no intermediate OrgNodes)

    ✅ PL-F0107a
  • F01.07.05 Shipped

    Deutschland — Landesverband → Bezirk → Verein (DPV seed uses depth=2 with Landesverband and Bezirk; see note below)

    ✅ PL-F0107a
  • F01.07.06 Shipped

    Per-OrgNode capabilities (godkänna tävlingar) — audit-logged PUT /org-nodes/districts/{id}/capabilities replaces per-instance overrides

    ✅ PL-F0107b
  • F01.07.07 Shipped

    Per-OrgNode roles and permissions — craft-easy RoleAssignment scoped to org_node with list/grant/revoke endpoints

    ✅ PL-F0107b
  • F01.07.08 Shipped

    OrgNode tree view with drag-and-drop — nested GET /org-nodes/tree + move endpoints for districts and clubs (cycle detection, level guard)

    ✅ PL-F0107b
  • F01.07.09 Shipped

    OrgNode history and audit trail — append-only OrgNodeAuditLog, per-node history endpoint and tenant-wide audit query

    ✅ PL-F0107b
  • F01.07.10 Shipped

    Merge and split of OrgNodes — POST /org-nodes/districts/merge and POST /org-nodes/districts/{id}/split reassign clubs + sub-districts with paired audit entries

    ✅ PL-F0107b
  • F01.07.11 Shipped

    OrgNode autonomy delegation — four explicit flags (financial, discipline, ranking, pricing) per district/club, no inheritance, federation-admin-only toggling via GET/PUT /admin/orgnodes/{id}/autonomy, guard-based enforcement on finance/disciplinary/ranking/license-fee endpoints, audit-logged with before/after diff

    ✅ PL-T006

Federation Onboarding & Migration

F01.08
Shipped

Self-service onboarding-wizard för nya federationer plus bulk-import av

How it works
  • F01.08.01 Shipped

    Self-service onboarding wizard for new federations

    ✅ PL-F0108a
  • F01.08.02 Shipped

    Bulk import of clubs and players (CSV, XML)

    ✅ PL-F0108a
  • F01.08.03 Shipped

    Business-rule validation of imported rows per tenant

    ✅ PL-F0108a
  • F01.08.04 Shipped

    Dry-run diff report (new/update/unchanged/error)

    ✅ PL-F0108a
  • F01.08.05 Shipped

    Migrationsplan-generator (källsystem → Petanque Life) — POST /federation-onboarding/migration-plans returnerar ordnade steg, källsystemsspecifika varningar och risknivåer (FFBE/SBF/DPV-heuristik, volymbaserad eskalering)

    ✅ PL-F0108b
  • F01.08.06 Shipped

    Sandbox-tenant för pilotinstallation — /federation-onboarding/sandboxes wrappar TenantConfig, lifecycle active → promoted \

    discarded, discard soft-deletar konfigen | ✅ PL-F0108b
  • F01.08.07 Shipped

    Datavalidering och rensning under import — idempotent städpipeline före validering, per-fält-normalisering (whitespace, casing, email, telefon, DD/MM/YYYY → ISO), omskrivningar rapporteras som warnings/cleaned_count

    ✅ PL-F0108b
  • F01.08.08 Shipped

    Rollback av import vid fel — ImportBatch spårar created_ids + pre-mutation update_snapshots, manuell rollback via /imports/batches/{id}/rollback och auto-rollback vid mid-apply-fel (stämplas auto_rolled_back)

    ✅ PL-F0108b
  • F01.09.01 Shipped

    Dry-run migration plan with per-collection document counting and conflict detection

    ✅ PL-T010
  • F01.09.02 Shipped

    Consent flow — one-time token invitation to club admin, acceptance endpoint

    ✅ PL-T010
  • F01.09.03 Shipped

    Migration execution — move documents, update tenant_id, set source read-only

    ✅ PL-T010
  • F01.09.04 Shipped

    30-day rollback window — revert all migrated documents, lift read-only

    ✅ PL-T010
  • F01.09.05 Shipped

    Conflict resolution — license number / club code collision (skip/rename/overwrite)

    ✅ PL-T010
  • F01.09.06 Shipped

    Four-step admin wizard UI with migration dashboard and rollback controls

    ✅ PL-T010