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

    Bank dashboard memberships across every bank, for callers with no dashboard user: CFX operators, and a sign-in accepting its invites.

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

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

    • Accepts the proven address's recent PENDING invites for the user (see decideMembership), keeping a live row's status. bankIds limits it to those banks' invites; a sign-in passes none and takes them all.

      Parameters

      • __namedParameters: {
            bankIds?: string[];
            email: string;
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
            userId: string;
        }

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

    • An operator's removal: the row is soft-deleted. No rank rule applies, but the last ACTIVE holder of the top role cannot be removed (LAST_OWNER). removed is false when the row was already removed (a concurrent removal, or a retry); the removal is published either way. With a caller's tx nothing is published: the caller publishes after its commit.

      Parameters

      • __namedParameters: {
            bankId: string;
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
            userId: string;
        }

      Returns Promise<
          | { ok: true; value: AdminMemberSnapshot & { removed: boolean } }
          | { error: ServiceError; ok: false },
      >

    • Parameters

      • __namedParameters: {
            bankIds?: string[];
            emails?: string[];
            includeDeleted?: boolean;
            page?: number;
            pageSize?: number;
            statuses?: ("ACTIVE" | "DELETED" | "DISABLED")[];
            userIds?: string[];
        } = {}
        • OptionalbankIds?: string[]
        • Optionalemails?: string[]

          Matched case-insensitively.

        • OptionalincludeDeleted?: boolean
        • Optionalpage?: number

          Defaults to 1

        • OptionalpageSize?: number

          Defaults to 100

        • Optionalstatuses?: ("ACTIVE" | "DELETED" | "DISABLED")[]
        • OptionaluserIds?: string[]

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

    • Dashboard users across every bank, newest first with membership-less users last, each with their live memberships: whoever has joined or been synced, with or without one now.

      Parameters

      • __namedParameters: {
            ids?: string[];
            page?: number;
            pageSize?: number;
            query?: string;
            standings?: ("ACTIVE" | "DISABLED" | "NONE")[];
        } = {}
        • Optionalids?: string[]
        • Optionalpage?: number

          Defaults to 1

        • OptionalpageSize?: number

          Defaults to 50

        • Optionalquery?: string

          Case-insensitive substring of the email, the full name or the id.

        • Optionalstandings?: ("ACTIVE" | "DISABLED" | "NONE")[]

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

    • An operator's role change, enable or disable. A role must be in the bank's current set; only confirmed CFX staff hold its internal role. No rank rule applies, but the last ACTIVE holder of the top role cannot be moved off it or disabled (LAST_OWNER). changed is false when nothing differed; the requested move is published either way. Nothing is recorded in the workspace's own feed, as for an operator's role change: the caller keeps the admin activity log. With a caller's tx nothing is published: the caller publishes after its commit.

      Parameters

      • __namedParameters: {
            bankId: string;
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
            userId: string;
        } & (
            | { roleId: string; status?: WritableStatus | undefined }
            | { roleId?: undefined; status: WritableStatus }
        )

      Returns Promise<
          | {
              ok: true;
              value: AdminMemberSnapshot & {
                  changed: boolean;
                  previousRoleId: string
                  | null;
                  previousRoleIsInternal: boolean;
                  previousRoleName: string | null;
                  previousStatus: "ACTIVE" | "DELETED" | "DISABLED";
                  roleIsInternal: boolean;
                  status: "ACTIVE" | "DELETED" | "DISABLED";
              };
          }
          | { error: ServiceError; ok: false },
      >