Skip to content

Commit 88040c9

Browse files
Updated schema for totals endpoint
1 parent 03b8e2c commit 88040c9

File tree

6 files changed

+67
-132
lines changed

6 files changed

+67
-132
lines changed

app/uk/gov/hmrc/epayeapi/models/TotalsResponse.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ import uk.gov.hmrc.domain.EmpRef
2020
import uk.gov.hmrc.epayeapi.models.domain.AggregatedTotals
2121

2222
case class TotalsResponse(
23-
empRef: EmpRef,
2423
credit: BigDecimal,
2524
debit: BigDecimal,
2625
_links: TotalsLinks
2726
)
2827

2928
object TotalsResponse {
3029
def apply(empRef: EmpRef, totals: AggregatedTotals): TotalsResponse =
31-
TotalsResponse(empRef, totals.credit, totals.debit, TotalsLinks())
30+
TotalsResponse(totals.credit, totals.debit, TotalsLinks())
3231
}
3332

3433
case class TotalsLinks(

resources/public/api/conf/1.0/application.raml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,29 @@ types:
5656
"code" : "INSUFFICIENT_ENROLMENTS",
5757
"message" : "You are not currently enrolled for ePAYE"
5858
}
59+
60+
/epaye/:EmpRef/total:
61+
get:
62+
is: [ headers.acceptHeader ]
63+
displayName: Total balance
64+
description: This resource returns the outstanding credits and debits on your account.
65+
(annotations.scope): "read:epaye"
66+
securedBy: [ sec.oauth_2_0: { scopes: [ "read:epaye" ] } ]
67+
responses:
68+
200:
69+
body:
70+
application/json:
71+
type: !include schemas/Totals.get.schema.json
72+
example: !include examples/Totals.get.json
73+
401:
74+
body:
75+
application/json:
76+
type: !include schemas/ErrorCodes.schema.json
77+
examples:
78+
notOpenStatus:
79+
description: You don't have currently an ePAYE enrolment on this account.
80+
value: |
81+
{
82+
"code" : "INSUFFICIENT_ENROLMENTS",
83+
"message" : "You are not currently enrolled for ePAYE"
84+
}

resources/public/api/conf/1.0/examples/Totals.get.array.json

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"empRef" : "840/GZ00064",
3+
"credit" : 100,
4+
"debit" : 0,
5+
"_links" : {
6+
"empRefs" : {
7+
"href" : "/"
8+
}
9+
}
10+
}

resources/public/api/conf/1.0/schemas/Totals.get.schema.array.json

Lines changed: 0 additions & 90 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"type": "object",
3+
"description": "An object containing the outstanding debits and outstanding credits",
4+
"properties": {
5+
"_links": {
6+
"type": "object",
7+
"description": "An object of links to explore further data",
8+
"properties": {
9+
"empRefs": {
10+
"type": "object",
11+
"description": "An object holding the link back to the entry endpoint",
12+
"properties": {
13+
"href": {
14+
"type": "string",
15+
"description": "Link to the entry endpoint"
16+
}
17+
}
18+
}
19+
}
20+
},
21+
"credit": {
22+
"type": "integer",
23+
"description": "The currently outstanding credits on your account."
24+
},
25+
"debit": {
26+
"type": "integer",
27+
"description": "The currently outstanding debits on your account."
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)