Skip to content

Refactor models and methods for batches

Andreas Ellewsen requested to merge cleanup/models-batch-search into master

Står som draft siden den er avhengig av at SETRA tilbyr id feltet som introduseres i https://git.app.uib.no/it-bott-integrasjoner/setra/-/merge_requests/125

Instead of mixing the Batch model for batches sent to with batches received from SETRA, we switch to using an InputBatch and an OutputBatch. The InputBatch contains the fields that can be used when sending a Batch (with Vouchers and Transactions), and the OutputBatch contains all the information one receives from SETRA when fetching a single batch from the batch/ endpoint, or multiple using the search functionality.

The get_batch method is reduced to only fetch a single batch, while the new search_batches method takes the role of searching based on creation date and interface. In addition, the return_list_of_obj parameter is removed in favor of the return_objects class attribute.

This commit expects that SETRA includes the id field in Batches.

Edited by Andreas Ellewsen

Merge request reports