@cfxlabsinc/b2b-services
    Preparing search index...
    interface CreateCustomerWorkflowArgs {
        adoptedPeople?: AdoptedPerson[];
        customer: Omit<Parameters<typeof createCustomer>[1], "id">;
        customerId: string;
        monthlyFeeAmount?: string;
        monthlyFeeStartDate?: string;
        organization: Omit<
            Extract<
                Parameters<typeof createMainOrganization>[1],
                { verificationProfileId: string },
            >,
            "customerId" | "relatedPeople" | "adoptedPeople" | "preApproved",
        >;
        owner?: { email: string };
        relatedPeople: NewRelatedPerson[];
    }
    Index
    adoptedPeople?: AdoptedPerson[]

    People AiPrise already holds linked to the organization's business profile, adopted with their AiPrise ids rather than created there.

    customer: Omit<Parameters<typeof createCustomer>[1], "id">

    Customer-record inputs (mirrors the synchronous form fields). workspaceId names an applicant's existing workspace for the customer to take.

    customerId: string

    Pre-generated external customer id (cust_…); also the workflow id.

    monthlyFeeAmount?: string

    Optional AUTO monthly FIXED platform fee (MOVEUSD), configured once the Operating account exists.

    No actor travels with it: the audit entry for an onboarding-set fee is recorded by the dashboard action that starts this workflow, which is the only place that knows who asked. See lib/adminActivities.ts.

    monthlyFeeStartDate?: string

    YYYY-MM-DD: the first day the fee can be charged, and the day of the month it is charged on. Optional only so runs started before it existed replay; the activity uses the 1st of the current month when it is absent.

    organization: Omit<
        Extract<
            Parameters<typeof createMainOrganization>[1],
            { verificationProfileId: string },
        >,
        "customerId" | "relatedPeople" | "adoptedPeople" | "preApproved",
    >

    Primary-organization inputs, derived from the AiPrise profile in the action. customerId / isMainOrg / relatedPeople are supplied by the workflow itself.

    verificationProfileId is REQUIRED here even though OrganizationService.create takes it as optional: the org-api path can create an org that AiPrise has not seen yet and let the async verify() catch up, but onboarding cannot. It gates on the profile being APPROVED so the primary org is ACTIVE at insert time — there is no profile to check without an id.

    owner?: { email: string }

    The customer's first dashboard user, invited as the workspace's owner. Absent when customer.workspaceId names a workspace that already has its owner, and on runs started before it existed.

    relatedPeople: NewRelatedPerson[]

    Control persons / beneficial owners for the primary org. Required — at least one CONTROL person across these and adoptedPeople (validateCustomerOnboardingInput rejects otherwise, before any write).