Interface for Organization's Default Adapter's API

Description

This interface is used to define the API for Organization's Default Adapter. Implement this interface to create a custom API for communicating with Organization functionality.

interface OrganizationDefaultAdapterAPI {
    addOrUpdateUsers(args, requestContext?): Promise<void>;
    createOrganization(organizationData, requestContext?): Promise<Organization>;
    getAttachmentByIds(idList, requestContext?): Promise<(null | AttachmentResponse)[]>;
    getOrganizationById(orgId, requestContext?): Promise<undefined | Organization>;
    getOrganizationUsers(orgId, requestContext?): Promise<PaginatedQueryResult<OrganizationUser>>;
    getOrganizations(args, requestContext?): Promise<PaginatedQueryResult<Organization>>;
    getUserOrganizationRole(args, requestContext?): Promise<{
        role: string;
    }>;
    getUserOrganizations(args, requestContext?): Promise<PaginatedQueryResult<Organization>>;
    isUserInOrganization(args, requestContext?): Promise<{
        isUserInOrg: boolean;
    }>;
    updateOrganizationReviewStats(args, requestContext?): Promise<undefined | Organization>;
}

Implemented by

Organization

  • API for adding or updating users in an organization

    Parameters

    • args: {
          orgId: string;
          users: OrganizationUser[];
      }

      Input containing parameters for adding or updating users.

    • Optional requestContext: RequestContext

      request context (requestId, serviceHistory)

    Returns Promise<void>

    void

    Description

    This API is used to add or update users in an organization.

  • API for creating an organization

    Parameters

    • organizationData: Partial<Organization> & {
          ownerId: string;
      }

      Organization data to be created.

    • Optional requestContext: RequestContext

    Returns Promise<Organization>

    Organization data that was created.

    Description

    This API is used to create an organization.

  • API for getting multiple organization attachments

    Parameters

    • idList: string[]

      List of organization attachment IDs to be fetched.

    • Optional requestContext: RequestContext

      request context (requestId, serviceHistory)

    Returns Promise<(null | AttachmentResponse)[]>

    Organization attachments array that fetched if the id is not exist return null.

    Description

    This API is used to get multiple organization attachments from the Organization service. It will return array exactly the same length as the idList, if the id is not exist return null instead in for the specific attachment.

  • API for getting a single organization

    Parameters

    • orgId: string

      Organization ID of the organization to be fetched.

    • Optional requestContext: RequestContext

      request context (requestId, serviceHistory)

    Returns Promise<undefined | Organization>

    Organization data that was fetched.

    Description

    This API is used to get a single organization.

  • API for getting list of organizations

    Parameters

    • args: {
          queryOptions: PaginatedListQueryOptions;
      }

      Input containing parameters for fetching organizations.

      • queryOptions: PaginatedListQueryOptions
    • Optional requestContext: RequestContext

      request context (requestId, serviceHistory)

    Returns Promise<PaginatedQueryResult<Organization>>

    Paginated list of organizations.

    Description

    This API is used to get list of organizations.

  • API for getting role of a user in an organization.

    Parameters

    • args: {
          orgId: string;
          userId: string;
      }

      Input containing parameters for fetching organizations.

      • orgId: string
      • userId: string
    • Optional requestContext: RequestContext

      request context (requestId, serviceHistory)

    Returns Promise<{
        role: string;
    }>

    Object containing the role of the user in the organization.

    Description

    This API is used to get the role a user has in an organization.

  • API for getting list of organizations for a user

    Parameters

    • args: {
          role?: string;
          userId: string;
      }

      Input containing parameters for fetching organizations.

      • Optional role?: string

        Role of the user in the organization.

      • userId: string

        User ID of the user whose organizations are to be fetched.

    • Optional requestContext: RequestContext

      request context (requestId, serviceHistory)

    Returns Promise<PaginatedQueryResult<Organization>>

    Paginated list of organizations for the user.

    Description

    This API is used to get list of organizations that a user belongs to.

  • API for checking if a user belongs to an organization

    Parameters

    • args: {
          orgId: string;
          userId: string;
      }

      Input containing properties for checking if a user belongs to an organization.

      • orgId: string

        Organization ID of the organization.

      • userId: string

        User ID of the user.

    • Optional requestContext: RequestContext

      request context (requestId, serviceHistory)

    Returns Promise<{
        isUserInOrg: boolean;
    }>

    Object containing the boolean result of the check.

    Description

    This API is used to check if a user belongs to an organization.

  • API for updating review statistics for a single organization

    Parameters

    • args: {
          orgId: string;
          reviewStats: {
              averageRate?: number;
              averageSubRates?: Record<string, number>;
              totalCount?: number;
          };
      }

      Input containing properties for updating statistics.

      • orgId: string

        Org ID of the org to be updated.

      • reviewStats: {
            averageRate?: number;
            averageSubRates?: Record<string, number>;
            totalCount?: number;
        }

        Review statistics body.

        • Optional averageRate?: number
        • Optional averageSubRates?: Record<string, number>
        • Optional totalCount?: number
    • Optional requestContext: RequestContext

    Returns Promise<undefined | Organization>

    Organization data that was updated.

    Description

    This API is used to update review statistics for a single org in the Organization service.

Generated using TypeDoc