@@ -, +, @@ --- Koha/ERM/EUsage/CounterLog.pm | 15 +++++++++++++++ api/v1/swagger/definitions/erm_counter_log.yaml | 5 +++-- api/v1/swagger/paths/erm_counter_logs.yaml | 9 +++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) --- a/Koha/ERM/EUsage/CounterLog.pm +++ a/Koha/ERM/EUsage/CounterLog.pm @@ -31,6 +31,21 @@ Koha::ERM::EUsage::CounterLog - Koha ErmCounterLog Object class =cut + +=head3 borrowernumber + +Return the borrower for this counter_file + +=cut + +sub borrowernumber { + my ($self) = @_; + my $borrowers_rs = $self->_result->borrowernumber; + return unless $borrowers_rs; + return Koha::Patron->_new_from_dbic($borrowers_rs); +} + + =head2 Internal methods =head3 _type --- a/api/v1/swagger/definitions/erm_counter_log.yaml +++ a/api/v1/swagger/definitions/erm_counter_log.yaml @@ -11,9 +11,10 @@ properties: - integer - "null" borrowernumber: - description: borrowernumber of the counter_log + type: object + description: patron object type: - - integer + - object - "null" importdate: type: string --- a/api/v1/swagger/paths/erm_counter_logs.yaml +++ a/api/v1/swagger/paths/erm_counter_logs.yaml @@ -13,6 +13,15 @@ name: usage_data_provider_id required: false type: integer + - name: x-koha-embed + in: header + required: false + description: Embed list sent as a request header + type: array + items: + type: string + enum: + - borrowernumber - $ref: "../swagger.yaml#/parameters/match" - $ref: "../swagger.yaml#/parameters/order_by" - $ref: "../swagger.yaml#/parameters/page" --