• Check if order with some status between user and organization is exists If not exist the review are not allowed

    Parameters

    • allowedStatus: string[]
    • targetIdFieldInfo: TargetField

      target field info to get the target id

    • orgIdFieldInfo: TargetField

      org field info to get the org id

    • orderAPI: OrderDefaultAdapterAPI

      injected api use to handle the order related operations

      • getOrdersForUser
    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

    Returns Promise<number>

    200 Status OK

    Description

    This validator is used to check if the order is CLOSED by the organization by applying the following steps in sequence:

    1. Get the targetId from context

    2. Get the orgId from context

    3. Get the orders for user (orderAPI.getOrdersForUser), filter by organizationId and status in

    4. If order is exists return 200 else throw error

    Throws

    400 NBError Bad Request

    • cannot found parameter in ${targetIdFieldInfo.type} ${targetIdFieldInfo.name}

    Throws

    400 NBError Bad Request

    • cannot found parameter in ${orgIdFieldInfo.type} ${orgIdFieldInfo.name}

    Throws

    400 NBError Bad Request

    • no order found for organization and user with status ${allowedStatus}

Generated using TypeDoc