Skip to content

Commit

Permalink
[MODFIN-320] Fixed batch endpoint (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
damien-git authored Jan 24, 2024
1 parent de0e3b3 commit 8df20cd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
56 changes: 28 additions & 28 deletions ramls/transaction.raml
Original file line number Diff line number Diff line change
Expand Up @@ -176,31 +176,31 @@ resourceTypes:
schema: transaction
exampleItem: !include acq-models/mod-finance/schemas/transaction.json

/batch-all-or-nothing:
displayName: Batch processing of transactions
post:
description: Process actions on transactions in a single all-or-nothing operation
is: [validate]
body:
application/json:
type: batch
example:
strict: false
value: !include acq-models/mod-finance/examples/batch.sample
responses:
204:
description: "Transactions processed successfully"
400:
description: "Bad request, for instance with the syntax. Details of the error provided in the response."
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
500:
description: "Internal server error"
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
/batch-all-or-nothing:
displayName: Batch processing of transactions
post:
description: Process actions on transactions in a single all-or-nothing operation
is: [validate]
body:
application/json:
type: batch
example:
strict: false
value: !include acq-models/mod-finance/examples/batch.sample
responses:
204:
description: "Transactions processed successfully"
400:
description: "Bad request, for instance with the syntax. Details of the error provided in the response."
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
500:
description: "Internal server error"
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
2 changes: 1 addition & 1 deletion src/main/java/org/folio/rest/impl/TransactionsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ TransactionType.CREDIT, credit, new RequestContext(vertxContext, okapiHeaders))

@Validate
@Override
public void postFinanceBatchAllOrNothing(Batch batch, Map<String, String> okapiHeaders,
public void postFinanceTransactionsBatchAllOrNothing(Batch batch, Map<String, String> okapiHeaders,
Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
batchTransactionService.processBatch(batch, new RequestContext(vertxContext, okapiHeaders))
.onSuccess(types -> asyncResultHandler.handle(succeededFuture(buildNoContentResponse())))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private ResourcePathResolver() {
apis.put(LEDGER_ROLLOVERS_PROGRESS_STORAGE, "/finance-storage/ledger-rollovers-progress");
apis.put(GROUPS, "/finance-storage/groups");
apis.put(TRANSACTIONS, "/finance-storage/transactions");
apis.put(BATCH_TRANSACTIONS, "/finance/batch-all-or-nothing");
apis.put(BATCH_TRANSACTIONS, "/finance/transactions/batch-all-or-nothing");
apis.put(BATCH_TRANSACTIONS_STORAGE, "/finance-storage/transactions/batch-all-or-nothing");
apis.put(CONFIGURATIONS, "/configurations/entries");
apis.put(ORDER_TRANSACTION_SUMMARIES, "/finance-storage/order-transaction-summaries");
Expand Down

0 comments on commit 8df20cd

Please sign in to comment.