generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NON-312: Update node REST client for new re-open endpoint (#170)
* Refactor request/response types for node REST client * Add all special error codes to node REST client lib * Add new reopen non-association endpoint to node REST client
- Loading branch information
Showing
7 changed files
with
131 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import type { Reason, RestrictionType, Role } from './constants' | ||
|
||
/** | ||
* Request payload for creating a new non-association | ||
* | ||
* Defined in uk.gov.justice.digital.hmpps.hmppsnonassociationsapi.dto.CreateNonAssociationRequest class | ||
* see https://github.com/ministryofjustice/hmpps-non-associations-api | ||
*/ | ||
export interface CreateNonAssociationRequest { | ||
firstPrisonerNumber: string | ||
firstPrisonerRole: keyof Role | ||
secondPrisonerNumber: string | ||
secondPrisonerRole: keyof Role | ||
reason: keyof Reason | ||
restrictionType: keyof RestrictionType | ||
comment: string | ||
} | ||
|
||
/** | ||
* Request payload for updating an existing non-association | ||
* | ||
* Defined in uk.gov.justice.digital.hmpps.hmppsnonassociationsapi.dto.PatchNonAssociationRequest class | ||
* see https://github.com/ministryofjustice/hmpps-non-associations-api | ||
*/ | ||
export interface UpdateNonAssociationRequest { | ||
firstPrisonerRole?: keyof Role | ||
secondPrisonerRole?: keyof Role | ||
reason?: keyof Reason | ||
restrictionType?: keyof RestrictionType | ||
comment?: string | ||
} | ||
|
||
/** | ||
* Request payload for closing an existing open non-association | ||
* | ||
* Defined in uk.gov.justice.digital.hmpps.hmppsnonassociationsapi.dto.CloseNonAssociationRequest class | ||
* see https://github.com/ministryofjustice/hmpps-non-associations-api | ||
*/ | ||
export interface CloseNonAssociationRequest { | ||
closedReason: string | ||
closedAt?: Date | ||
closedBy?: string | ||
} | ||
|
||
/** | ||
* Request payload for deleting an existing non-association | ||
* | ||
* Defined in uk.gov.justice.digital.hmpps.hmppsnonassociationsapi.dto.DeleteNonAssociationRequest class | ||
* see https://github.com/ministryofjustice/hmpps-non-associations-api | ||
*/ | ||
export interface DeleteNonAssociationRequest { | ||
deletionReason: string | ||
staffUserNameRequestingDeletion: string | ||
} | ||
|
||
/** | ||
* Request payload for re-opening an existing closed non-association | ||
* | ||
* Defined in uk.gov.justice.digital.hmpps.hmppsnonassociationsapi.dto.ReopenNonAssociationRequest class | ||
* see https://github.com/ministryofjustice/hmpps-non-associations-api | ||
*/ | ||
export interface ReopenNonAssociationRequest { | ||
reopenReason: string | ||
reopenedAt?: Date | ||
reopenedBy?: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters