https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20028

Lari Taskula <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #119977|0                           |1
        is obsolete|                            |

--- Comment #47 from Lari Taskula <[email protected]> ---
Created attachment 120847
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120847&action=edit
Bug 20028: Add Patron Export REST controller

This patch adds a REST controller for patron data exporting.

GET /api/v1/patrons/51/export
GET /api/v1/public/patrons/51/export

Supports pagination parameters "_per_page" and "_page".

Response is an array that contains "_per_page" amount of objects, each
with the following format:

{
  "data": {the object, e.g. patron}
  "type": DBIx source name, e.g. "Borrower"
}

Example response:

[
  {
    "data":{
      "address":null,
      ...,
      "patron_id":1,
      ...
    },
    "type":"Borrower"
  },
  {
    "data":{
      "borrower_message_preference_id":24,
      "borrowernumber":1,
      ...,
      "wants_digest":1
    },
    "type":"BorrowerMessagePreference"
  },
  {
    "data":{
      "auto_renew":false,
      ...,
      "checkout_id":97,
      "due_date":"2021-02-19T23:59:00+00:00",
      ...,
      "patron_id":1,
      ...
    },
    "type":"Issue"
  },
  {
    "data":{
      "auto_renew":false,
      ...,
      "checkout_id":42,
      "due_date":"2021-01-19T23:59:00+00:00",
      ...,
      "patron_id":1,
      ...
    },
    "type":"OldIssue"
  }
]

To test:
1. prove t/db_dependent/api/v1/patrons_export.t

Sponsored-by: The National Library of Finland

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to