• Create change request handler

    Parameters

    • authSecrets: AuthSecrets

      authenticate secrets

    • authenticate: AuthenticationFunction

      injected function used to authenticate the request

    • changeRequestService: Pick<ChangeRequestDataService, "createChangeRequest">

      injected service use to handle the change request related operations

    • organizationService: Pick<OrganizationDataService, "updateOrganization">

      injected service use to handle the organization related operations

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

      • params is required

    Returns Promise<adapter.AdapterHandlerResponse>

    204 No Content

    Description

    This handler will create change request by applying the following steps in sequence:

    1. Authenticate the request with the given token pair

    2. Check if the token is user access token

    3. Create change request (service.createOrganizationChangeRequest)

    4. Update organization audit status to waiting_for_change_review (service.updateOrganization)

    Throws

    403 NBError Forbidden

    • token is not allowed for creating change request

    Throws

    500 NBError Internal Server Error

    • error when creating change request

Generated using TypeDoc