Skip to content

Commit 963e2ea

Browse files
committed
feat: interest
1 parent 0be21bb commit 963e2ea

File tree

4 files changed

+157
-0
lines changed

4 files changed

+157
-0
lines changed

openapi.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@
454454
},
455455
"/receivablesreports/balance": {
456456
"$ref": "./schemas/receivables/receivablesPaths.json#/receivablesBalance"
457+
},
458+
"/accrued-interest/total": {
459+
"$ref": "./schemas/interest/interestPaths.json#/getTotalAccruedInterest"
457460
}
458461
},
459462
"components": {

schemas/interest/interest.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"components": {
3+
"schemas": {
4+
"AccruedInterest": {
5+
"title": "Accrued Interest",
6+
"type": "object",
7+
"properties": {
8+
"id": {
9+
"$ref": "../types.json#/components/schemas/Identifier"
10+
},
11+
"type": {
12+
"type": "string",
13+
"const": "accruedInterest"
14+
},
15+
"attributes": {
16+
"type": "object",
17+
"properties": {
18+
"amount": {
19+
"type": "integer",
20+
"description": "The accrued interest amount in cents."
21+
},
22+
"createdAt": {
23+
"type": "string",
24+
"format": "date-time",
25+
"description": "The date and time when the record was created."
26+
}
27+
},
28+
"required": ["amount", "createdAt"],
29+
"additionalProperties": false
30+
},
31+
"relationships": {
32+
"type": "object",
33+
"properties": {
34+
"account": {
35+
"$ref": "../relationships.json#/components/schemas/AccountRelationship"
36+
}
37+
},
38+
"additionalProperties": false,
39+
"required": ["account"]
40+
}
41+
},
42+
"required": ["type", "attributes", "relationships"],
43+
"additionalProperties": false
44+
}
45+
}
46+
}
47+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"getTotalAccruedInterest": {
3+
"get": {
4+
"tags": ["unit"],
5+
"operationId": "getTotalAccruedInterest",
6+
"parameters": [
7+
{
8+
"schema": {
9+
"type": "string"
10+
},
11+
"name": "filter[accountId]",
12+
"in": "query",
13+
"required": false,
14+
"description": "Optional. Filters the results by the specified account id."
15+
},
16+
{
17+
"schema": {
18+
"type": "string",
19+
"format": "date-time"
20+
},
21+
"name": "filter[since]",
22+
"in": "query",
23+
"required": false,
24+
"description": "Optional. Filters the accrued interest after the specified date. e.g. 2024-01-13T16:01:19.346Z. Either a set of [since] & [until] OR a set of [sinceInterestMonth] & [untilInterestMonth] is required."
25+
},
26+
{
27+
"schema": {
28+
"type": "string",
29+
"format": "date-time"
30+
},
31+
"name": "filter[until]",
32+
"in": "query",
33+
"required": false,
34+
"description": "Optional. Filters the account accrued interest before the specified date. e.g. 2024-05-06T16:01:00.123Z. Either a set of [since] & [until] OR a set of [sinceInterestMonth] & [untilInterestMonth] is required."
35+
},
36+
{
37+
"schema": {
38+
"type": "string",
39+
"pattern": "^\\d{4}-\\d{2}$"
40+
},
41+
"name": "filter[sinceInterestMonth]",
42+
"in": "query",
43+
"required": false,
44+
"description": "Optional. Filters the accrued interest after the specified month. e.g. 2024-03. Either a set of [since] & [until] OR a set of [sinceInterestMonth] & [untilInterestMonth] is required."
45+
},
46+
{
47+
"schema": {
48+
"type": "string",
49+
"pattern": "^\\d{4}-\\d{2}$"
50+
},
51+
"name": "filter[untilInterestMonth]",
52+
"in": "query",
53+
"required": false,
54+
"description": "Optional. Filters the accrued interest before the specified month. e.g. 2024-07. Either a set of [since] & [until] OR a set of [sinceInterestMonth] & [untilInterestMonth] is required."
55+
}
56+
],
57+
"summary": "Get Total Accrued Interest",
58+
"description": "The response to this API call includes the sum of customer accrued interest (in cents) for a given period of time.",
59+
"responses": {
60+
"200": {
61+
"description": "Successful Response",
62+
"content": {
63+
"application/vnd.api+json; charset=utf-8": {
64+
"schema": {
65+
"type": "object",
66+
"title": "Unit Total Accrued Interest Response",
67+
"properties": {
68+
"data": {
69+
"$ref": "../types.json#/components/schemas/TotalAccruedInterest"
70+
}
71+
}
72+
}
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
79+
}

schemas/types.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,34 @@
6161
"type": "string",
6262
"nullable": true
6363
},
64+
"TotalAccruedInterest": {
65+
"title": "Total Accrued Interest",
66+
"type": "object",
67+
"properties": {
68+
"type": {
69+
"type": "string",
70+
"const": "totalAccruedInterest"
71+
},
72+
"attributes": {
73+
"type": "object",
74+
"properties": {
75+
"amount": {
76+
"type": "integer",
77+
"description": "The sum of customer accrued interest (in cents) for a given period of time."
78+
}
79+
},
80+
"required": [
81+
"amount"
82+
],
83+
"additionalProperties": false
84+
}
85+
},
86+
"required": [
87+
"type",
88+
"attributes"
89+
],
90+
"additionalProperties": false
91+
},
6492
"Contact": {
6593
"title": "Contact",
6694
"type": "object",

0 commit comments

Comments
 (0)