diff --git a/it0-web-admin/src/app/(admin)/layout.tsx b/it0-web-admin/src/app/(admin)/layout.tsx index da4c0b7..a2ad1c0 100644 --- a/it0-web-admin/src/app/(admin)/layout.tsx +++ b/it0-web-admin/src/app/(admin)/layout.tsx @@ -34,10 +34,12 @@ export default function AdminLayout({ children }: { children: React.ReactNode }) const isPlatformAdmin = Array.isArray(user.roles) && (user.roles.includes('platform_admin') || user.roles.includes('platform_super_admin')); if (!isPlatformAdmin) { - apiClient<{ id: string; name: string; plan: string }>('/api/v1/auth/my-org') + apiClient<{ id: string; slug: string; name: string; plan: string }>('/api/v1/auth/my-org') .then((org) => { - setCurrentTenant({ id: org.id, name: org.name, plan: org.plan as any }); - localStorage.setItem('current_tenant', JSON.stringify({ id: org.id, name: org.name, plan: org.plan })); + // Use slug as the tenant identifier (X-Tenant-Id header must be the slug, not UUID) + const tenantId = org.slug || org.id; + setCurrentTenant({ id: tenantId, name: org.name, plan: org.plan as any }); + localStorage.setItem('current_tenant', JSON.stringify({ id: tenantId, name: org.name, plan: org.plan })); }) .catch(() => { /* ignore — token may be expired */ }); } diff --git a/packages/services/billing-service/src/infrastructure/seed/plan-seed.service.ts b/packages/services/billing-service/src/infrastructure/seed/plan-seed.service.ts index 636c0c7..038e05a 100644 --- a/packages/services/billing-service/src/infrastructure/seed/plan-seed.service.ts +++ b/packages/services/billing-service/src/infrastructure/seed/plan-seed.service.ts @@ -29,7 +29,7 @@ const SEED_PLANS = [ maxUsers: 20, maxStandingOrders: 100, hardLimitPercent: 150, - trialDays: 14, + trialDays: 0, isActive: true, }, { @@ -44,7 +44,7 @@ const SEED_PLANS = [ maxUsers: -1, maxStandingOrders: -1, hardLimitPercent: 0, // no hard limit - trialDays: 14, + trialDays: 0, isActive: true, }, ];