-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MTDSA-9541: Add RAML for create marriage allowance endpoint. (#62)
Create RAML documentation for 'Create Marriage Allowance' endpoint.
- Loading branch information
1 parent
1f45bab
commit 16a34e5
Showing
10 changed files
with
218 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"sbt","version":"1.5.0","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/Users/lukejones/Library/Java/JavaVirtualMachines/adopt-openj9-1.8.0_292/Contents/Home/jre/bin/java","-Xms100m","-Xmx100m","-classpath","/Users/lukejones/Library/Application Support/JetBrains/IdeaIC2020.3/plugins/Scala/launcher/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/Users/lukejones/Library/Application%20Support/JetBrains/IdeaIC2020.3/plugins/Scala/launcher/sbt-launch.jar"]} |
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 |
---|---|---|
|
@@ -21,5 +21,5 @@ node_modules/ | |
npm-debug.log | ||
yarn-debug.log | ||
yarn-error.log | ||
|
||
/.bsp | ||
|
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
30 changes: 30 additions & 0 deletions
30
resources/public/api/conf/1.0/endpoints/marriageAllowance/create.raml
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,30 @@ | ||
is: | ||
- headers.acceptJson | ||
- headers.contentTypeJson | ||
- headers.testScenarioHeader | ||
- errors.formatNino | ||
- errors.formatSpouseOrCivilPartnersFirstName | ||
- errors.formatSpouseOrCivilPartnersSurname | ||
- errors.formatSpouseOrCivilPartnersNino | ||
- errors.formatSpouseOrCivilPartnersDateOfBirth | ||
- errors.ruleDeceasedRecipient | ||
- errors.ruleActiveMarriageAllowanceClaim | ||
- errors.clientOrAgentNotAuthorised | ||
- errors.incorrectOrEmptyBody | ||
|
||
displayName: Create Marriage Allowance | ||
description: "This endpoint allows the customer to transfer up to £1,260 of their personal allowance to their spouse or civil partner. A National Insurance Number must be provided." | ||
(annotations.sandboxData): !include ../../scenarios/createMarriageAllowance.md | ||
(annotations.scope): "write:self-assessment" | ||
securedBy: [ sec.oauth_2_0: { scopes: [ "write:self-assessment" ] } ] | ||
body: | ||
application/json: | ||
type: !include ../../schemas/create_marriageAllowance_request.json | ||
example: | ||
value: !include ../../examples/marriageAllowance/create_marriageAllowance_request.json | ||
responses: | ||
201: | ||
headers: | ||
X-CorrelationId: | ||
example: c75f40a6-a3df-4429-a697-471eeec46435 | ||
description: Unique ID for operation tracking <br> String, 36 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
6 changes: 6 additions & 0 deletions
6
...rces/public/api/conf/1.0/examples/marriageAllowance/create_marriageAllowance_request.json
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,6 @@ | ||
{ | ||
"spouseOrCivilPartnerNino": "TC663795B", | ||
"spouseOrCivilPartnerFirstName": "John", | ||
"spouseOrCivilPartnerSurname": "Smith", | ||
"spouseOrCivilPartnerDateOfBirth": "1987-10-18" | ||
} |
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,3 @@ | ||
description: "National Insurance number, in the format AA999999A." | ||
type: string | ||
example: "TC663795B" |
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,3 @@ | ||
description: "The tax year the data applies to, for example, 2021-22. The start year and end year must not span two tax years. The minimum tax year is 2021-22. No gaps are allowed, for example, 2020-22 is not valid. (The minimum tax year in Sandbox is 2019-20.)" | ||
type: string | ||
example: "2021-22" |
23 changes: 23 additions & 0 deletions
23
resources/public/api/conf/1.0/scenarios/createMarriageAllowance.md
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,23 @@ | ||
<p>Scenario simulations using Gov-Test-Scenario headers is only available in the sandbox environment.</p> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Header Value (Gov-Test-Scenario)</th> | ||
<th>Scenario</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><p>N/A - DEFAULT</p></td> | ||
<td><p>Simulates success response.</p></td> | ||
</tr> | ||
<tr> | ||
<td><p>DECEASED_RECIPIENT</p></td> | ||
<td><p>Simulates the scenario in which the supplied spouse or civil partner has been flagged as deceased.</p></td> | ||
</tr> | ||
<tr> | ||
<td><p>CLAIM_ALREADY_EXISTS</p></td> | ||
<td><p>Simulates the scenario in which a Marriage Allowance claim already exists for the supplied NINO. </p></td> | ||
</tr> | ||
</tbody> | ||
</table> |
37 changes: 37 additions & 0 deletions
37
resources/public/api/conf/1.0/schemas/create_marriageAllowance_request.json
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,37 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Create Marriage Allowance Request", | ||
"description": "Create Marriage Allowance Request", | ||
"type": "object", | ||
"properties": { | ||
"spouseOrCivilPartnerNino": { | ||
"type": "string", | ||
"description": "Your spouse or civil partner's National Insurance number.", | ||
"format": "^((?!(BG|GB|KN|NK|NT|TN|ZZ)|(D|F|I|Q|U|V)[A-Z]|[A-Z](D|F|I|O|Q|U|V))[A-Z]{2})[0-9]{6}[A-D]$", | ||
"example": "AA999999A" | ||
}, | ||
"spouseOrCivilPartnerFirstName": { | ||
"type": "string", | ||
"description": "Your spouse or civil partner's first name.", | ||
"minLength": 1, | ||
"maxLength": 35, | ||
"example": "John" | ||
}, | ||
"spouseOrCivilPartnerSurname": { | ||
"type": "string", | ||
"description": "Your spouse or civil partner's surname.", | ||
"minLength": 1, | ||
"maxLength": 35, | ||
"example": "Smith" | ||
}, | ||
"spouseOrCivilPartnerDateOfBirth": { | ||
"type": "string", | ||
"description": "The date of birth of your spouse or civil partner in the format YYYY-MM-DD.", | ||
"format": "[0-9]{4}-[0-9]{2}-[0-9]{2}$", | ||
"example": "1998-04-06" | ||
} | ||
}, | ||
"required": [ | ||
"spouseOrCivilPartnerSurname" | ||
] | ||
} |