@cfxlabsinc/b2b-services
    Preparing search index...

    Customer dashboard role sets, for CFX operators: authoring, and which set a customer subscribes to. Roles within a set are CustomerDashboardRoleAdminService's. Records no activity: the admin dashboard records it from what each write returns. Each write publishes with publish, as config; with a caller's tx nothing is published.

    Index
    instance: (...args: []) => CustomerDashboardRoleSetAdminService = ...

    The process service: the shared database and the internal event bus.

    • Moves a customer onto a role set. Every live membership and PENDING invite moves to the role of the same name and internal flag in the new set, in one transaction; a held role the new set lacks refuses the move and writes nothing. A no-op when the customer is already on the set. Role writers lock the customer's workspace FOR SHARE, so none lands mid-switch. With a caller's tx nothing is published: the caller publishes after its commit.

      Parameters

      • __namedParameters: {
            customerId: string;
            roleSetId: string;
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
        }

      Returns Promise<
          | { ok: true; value: CustomerDashboardRoleSetAssignment }
          | {
              error:
                  | ServiceError<"CUSTOMER_NOT_FOUND" | "ROLE_SET_NOT_FOUND">
                  | ServiceError<"ROLE_SET_MISSING_ROLES", { missingRoleNames: string[] }>;
              ok: false;
          },
      >

    • A blank set has no roles. copyFromRoleSetId duplicates every role of that set (name, description, rank, flags and grants) and its default.

      Parameters

      • __namedParameters: {
            data: { copyFromRoleSetId?: string; description?: string; name: string };
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
        }

      Returns Promise<
          | { ok: true; value: CustomerDashboardRoleSet }
          | { error: ServiceError; ok: false },
      >

    • Customers with the role set each is on, by name: every customer, soft-deleted and set-less ones included, unless a filter narrows it.

      Parameters

      • __namedParameters: {
            customerIds?: string[];
            page?: number;
            pageSize?: number;
            roleSetIds?: string[];
        } = {}
        • OptionalcustomerIds?: string[]
        • Optionalpage?: number

          Defaults to 1

        • OptionalpageSize?: number

          Defaults to 50

        • OptionalroleSetIds?: string[]

      Returns Promise<
          {
              ok: true;
              value: {
                  hasNext: boolean;
                  items: CustomerDashboardWorkspace[];
                  total: number;
              };
          },
      >

    • defaultRoleId must name a non-internal role of this set.

      Parameters

      • __namedParameters: {
            data: { defaultRoleId?: string; description?: string; name?: string };
            id: string;
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
        }

      Returns Promise<
          | { ok: true; value: CustomerDashboardRoleSet }
          | { error: UpdateError; ok: false },
      >