This commit is contained in:
@@ -63,10 +63,10 @@ export async function POST(
|
||||
const isReApproval = tenantRequest.status === "rejected";
|
||||
|
||||
// Build the CR name: see `lib/tenant-naming.ts` for the format spec.
|
||||
// For now all approvals are kind="company" — the personal branch is
|
||||
// wired but unused until Slice 4 introduces the `is_personal` column.
|
||||
// Slice 4: for personal accounts the slug is replaced by the literal
|
||||
// "p-" prefix so no PII is embedded in the K8s namespace name.
|
||||
const tenantName = deriveTenantName(
|
||||
"company",
|
||||
tenantRequest.isPersonal ? "personal" : "company",
|
||||
tenantRequest.companyName,
|
||||
tenantRequest.id
|
||||
);
|
||||
@@ -101,13 +101,17 @@ export async function POST(
|
||||
};
|
||||
|
||||
// Step 4: Create the PiecedTenant CR.
|
||||
// displayName: prefer the customer-chosen instance name; fall back to
|
||||
// the company name. With multi-tenant per org, instanceName is what
|
||||
// distinguishes "Acme Production" from "Acme Dev" on the dashboard.
|
||||
// displayName precedence:
|
||||
// 1. customer-chosen instance name (Slice 3 multi-tenant)
|
||||
// 2. for personal accounts, the contact name (avoids exposing the
|
||||
// synthetic "{name} (Personal)" company name in the OpenClaw UI)
|
||||
// 3. company name otherwise
|
||||
const displayName =
|
||||
tenantRequest.instanceName && tenantRequest.instanceName.trim().length > 0
|
||||
? tenantRequest.instanceName.trim()
|
||||
: tenantRequest.companyName;
|
||||
: tenantRequest.isPersonal
|
||||
? tenantRequest.contactName || "Assistant"
|
||||
: tenantRequest.companyName;
|
||||
|
||||
await createTenant(
|
||||
tenantName,
|
||||
|
||||
Reference in New Issue
Block a user