• Create product-variant handler

    Parameters

    • productVariantService: ProductVariantDataService

      injected service use to handle the catalog related operations

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

      • params.productId is required

    Returns Promise<adapter.AdapterHandlerResponse>

    200 Status Ok

    • data: created product-variant

    Description

    This handler is used to create a product-variant by applying the following steps in sequence:

    1. Get the productId from params

    2. Create the product-variant (productVariantService.createProductVariant)

    3. Get the created product-variant (productVariantService.getProductVariant)

    4. Return the created product-variant

    Throws

    500 NBError Internal Server Error

    • Error happen when create product-variant for product ${productId} from database

Generated using TypeDoc