Skip to content

Commit

Permalink
[MODFIN-391]. Minimize amount of requests to retrieve transactions fo…
Browse files Browse the repository at this point in the history
…r ledger
  • Loading branch information
BKadirkhodjaev committed Jan 3, 2025
1 parent 38ee053 commit b12a8be
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
21 changes: 21 additions & 0 deletions mod-finance/examples/transaction_total_collection.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"transactionTotals": [
{
"fiscalYearId": "4438bc3b-4b4a-4e5e-9886-5f69b48a7a32",
"transactionType": "Allocation",
"currency": "USD",
"fromFundId": "27f27438-3197-4281-a353-511829421d6e",
"toFundId": "2e51c019-97f3-4523-87e9-59250e3b48bc",
"amount": 50000
},
{
"fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
"transactionType": "Transfer",
"currency": "USD",
"fromFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
"toFundId": "69640328-788e-43fc-9c3c-af39e243f3b7",
"amount": 1000,
}
],
"totalRecords": 2
}
45 changes: 45 additions & 0 deletions mod-finance/schemas/transaction_total.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A financial transaction total",
"type": "object",
"javaName": "transactionTotal",
"properties": {
"fiscalYearId": {
"$ref": "../../common/schemas/uuid.json",
"description": "UUID of the fiscal year that the transaction is taking place in"
},
"transactionType": {
"description": "This describes the type of transaction",
"enum": [
"Allocation",
"Credit",
"Encumbrance",
"Payment",
"Pending payment",
"Rollover transfer",
"Transfer"
],
"type": "string"
},
"fromFundId": {
"$ref": "../../common/schemas/uuid.json",
"description": "UUID of the fund money is moving from"
},
"toFundId": {
"$ref": "../../common/schemas/uuid.json",
"description": "UUID of the fund money is moving to"
},
"amount": {
"description": "The amount of this transaction",
"type": "number"
}
},
"required": [
"fiscalYearId",
"transactionType",
"fromFundId",
"toFundId",
"amount"
],
"additionalProperties": true
}
25 changes: 25 additions & 0 deletions mod-finance/schemas/transaction_total_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of transaction totals",
"type": "object",
"properties": {
"transactionTotals": {
"description": "The list of objects contained in this collection",
"type": "array",
"id": "transactionTotals",
"items": {
"type": "object",
"$ref": "transaction_total.json"
}
},
"totalRecords": {
"description": "The number of objects in this collection",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"transactionTotals",
"totalRecords"
]
}

0 comments on commit b12a8be

Please sign in to comment.