From ad30efe4d992eae09945d0ae53b5135f664514c4 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 24 Oct 2024 13:59:58 +0000 Subject: [PATCH] Bug 38256: Update API specs for new column (cherry picked from commit ca1a85aa8819f9dd24e1bacc285913919f8950d6) --- Koha/ERM/EUsage/UsageDataProvider.pm | 15 +++++++++++++++ Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm | 2 +- .../definitions/erm_usage_data_provider.yaml | 8 ++++++++ .../swagger/paths/erm_usage_data_providers.yaml | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Koha/ERM/EUsage/UsageDataProvider.pm b/Koha/ERM/EUsage/UsageDataProvider.pm index cdb82e31d5f..bedafbb3cf1 100644 --- a/Koha/ERM/EUsage/UsageDataProvider.pm +++ b/Koha/ERM/EUsage/UsageDataProvider.pm @@ -36,6 +36,7 @@ use Koha::ERM::EUsage::UsagePlatforms; use Koha::ERM::EUsage::UsageDatabases; use Koha::ERM::EUsage::MonthlyUsages; use Koha::ERM::EUsage::SushiCounter; +use Koha::Acquisition::Bookseller; use Koha::BackgroundJob::ErmSushiHarvester; =head1 NAME @@ -367,6 +368,20 @@ sub erm_usage_databases { return Koha::ERM::EUsage::UsageDatabases->_new_from_dbic($usage_database_rs); } + +=head3 vendor + +Return the vendor for this provider + +=cut + +sub vendor { + my ($self) = @_; + my $vendor_rs = $self->_result->vendor; + return unless $vendor_rs; + return Koha::Acquisition::Bookseller->_new_from_dbic($vendor_rs); +} + =head2 Internal methods =head3 _build_url_query diff --git a/Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm b/Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm index fd8ad547b42..8c44b617560 100644 --- a/Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm +++ b/Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm @@ -122,7 +122,7 @@ sub get { return try { my $usage_data_provider = - Koha::ERM::EUsage::UsageDataProviders->find( $c->param('erm_usage_data_provider_id') ); + $c->objects->find( Koha::ERM::EUsage::UsageDataProviders->search, $c->param('erm_usage_data_provider_id') ); return $c->render_resource_not_found("Usage data provider") unless $usage_data_provider; diff --git a/api/v1/swagger/definitions/erm_usage_data_provider.yaml b/api/v1/swagger/definitions/erm_usage_data_provider.yaml index ed6bdfe5700..61fa0541d4c 100644 --- a/api/v1/swagger/definitions/erm_usage_data_provider.yaml +++ b/api/v1/swagger/definitions/erm_usage_data_provider.yaml @@ -83,6 +83,14 @@ properties: type: - string - "null" + vendor_id: + description: vendor of the provider + type: + - integer + - "null" + vendor: + type: object + description: embedded vendor counter_files: type: array description: counter files diff --git a/api/v1/swagger/paths/erm_usage_data_providers.yaml b/api/v1/swagger/paths/erm_usage_data_providers.yaml index 238bf37b3f3..6f32845e5e2 100644 --- a/api/v1/swagger/paths/erm_usage_data_providers.yaml +++ b/api/v1/swagger/paths/erm_usage_data_providers.yaml @@ -212,6 +212,7 @@ enum: - counter_files - erm_usage_titles.erm_usage_muses + - vendor collectionFormat: csv responses: 200: -- 2.39.3 (Apple Git-146)