feat(auth): add Gilden (guilds) shared Mana pool system

Replace removed B2B org credit system with consumer-friendly shared
Mana pools. Members spend directly from a guild pool managed by the
Gildenmeister (owner). Supports funding from personal balance,
per-member spending limits, and credit source routing.

New endpoints: /gilden/* (guild CRUD) and /credits/guild/* (pool ops).
POST /credits/use now accepts optional creditSource for guild routing.
Delete broken b2b-journey E2E tests that tested phantom endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-27 11:38:19 +01:00
parent 63376c1313
commit 17df7b32f5
19 changed files with 1900 additions and 969 deletions

View file

@ -124,7 +124,8 @@ export class CreditClientService {
operation: string,
amount: number,
description: string,
metadata?: Record<string, any>
metadata?: Record<string, any>,
creditSource?: { type: 'personal' } | { type: 'guild'; guildId: string }
): Promise<boolean> {
const authUrl = this.getAuthUrl();
const serviceKey = this.getServiceKey();
@ -151,6 +152,7 @@ export class CreditClientService {
operation,
...metadata,
},
...(creditSource && { creditSource }),
}),
});