• Is product exists validator

    Parameters

    • productField: TargetField

      injected targetField use to get productId

    • organizationField: TargetField

      injected targetField use to get orgId

    • catalogServiceAPI: CatalogDefaultAdapterAPI

      injected API use to handle catalog related operations

    • logger: Logger

      injected logger use to handle logging

    • context: AdapterHandlerContext

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

    Returns Promise<number>

    200 Status OK

    Description

    This validator checks if the product exists by applying the following steps in sequence:

    1. Get productId from targetField context

    2. Check if productId is provided

    3. Check if product exists

    Throws

    400 NBError Bad Request

    • productId have to be specified in ${productField.type} ${productField.name}
    • orgId have to be specified in ${organizationField.type} ${organizationField.name}

    Throws

    404 NBError Not Found

    • productId ${productId} cannot be found

Generated using TypeDoc