Refactor models and methods for batches
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.
parent
36aa752f
No related branches found
No related tags found
Showing
- setra_client/client.py 48 additions, 28 deletionssetra_client/client.py
- setra_client/models.py 32 additions, 5 deletionssetra_client/models.py
- tests/fixtures/batch_fixture.json 2 additions, 0 deletionstests/fixtures/batch_fixture.json
- tests/fixtures/batch_without_voucher_field.json 2 additions, 0 deletionstests/fixtures/batch_without_voucher_field.json
- tests/test_client.py 23 additions, 27 deletionstests/test_client.py
- tests/test_models.py 6 additions, 7 deletionstests/test_models.py
Please register or sign in to comment