Skip to content
Snippets Groups Projects
  1. May 07, 2021
    • Andreas Ellewsen's avatar
      Refactor models and methods for batches · d987abc4
      Andreas Ellewsen authored
      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.
      d987abc4
  2. Mar 29, 2021
  3. Mar 22, 2021
  4. Feb 26, 2021
    • Andreas Ellewsen's avatar
      Add models and get_batch_errors method · cf89b7fc
      Andreas Ellewsen authored
      - Both get_batch_errors and get_batch_complete now return objects
        unless the client parameter return_objects is set to False
      - Tests for models, endpoints and client methods are included.
      cf89b7fc
  5. Feb 25, 2021
  6. Feb 19, 2021
  7. Feb 04, 2021
  8. Aug 21, 2020
    • Andreas Ellewsen's avatar
      Add client, models and tests · b8d88940
      Andreas Ellewsen authored
      Introduces SetraClient. The client is made
      for use against the SETRA(SEntralt TRAnsaksjonslager) API.
      
      There are models for Batch, Voucher, Transaction and Multi, where Multi is
      a combination of the preceding, The Multi model validates that the batchid
      of the voucher matches the batch included, and that the voucherid of the
      transactions matches one of the included vouchers.
      
      Tests have also been included for the client itself, the endpoints, and
      the models.
      
      Configuration for tox, Jenkins and gitlab-ci are included for running
      tests and building the client.
      b8d88940
Loading