• Get product variant list handler

    Parameters

    • productVariantService: ProductVariantDataService

      injected service use to handle the product related operations

    • paginationConfiguration: PaginationConfigurations
    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query]. Note:

      • params is required
      • params.productId is required

    Returns Promise<adapter.AdapterHandlerResponse>

    200 Status Ok

    • data: product variants list

    Description

    This handler is used to get a list of product variants by applying the following steps in sequence:

    1. Parse the query to get the pagination options (util.parsePaginatedListQuery)

    2. Check if the pagination options are valid

    3. Get the product variants list (productVariantService.listPaginatedProductVariants)

    4. Return the product variants list

    Throws

    Error

    • params is missing
    • productId is missing in params

    Throws

    400 NBError Bad Request

    • error when parse paginated list query, ${error.message}
    • pagination must be set
    • Page size exceeds ${MAXIMUM_PAGE_SIZE} mbs

    Throws

    500 NBError Internal Server Error

    • Error happen when get product variants list from database

Generated using TypeDoc