From 368b0f1b2b4bd7ff75edae654b3815760424c694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serge=20H=C3=A4nni?= Date: Tue, 17 Feb 2026 09:10:29 +0100 Subject: [PATCH] Add endpoint for "no show blocks" per user to operator API --- lib/ioki/apis/operator_api.rb | 6 ++++++ spec/ioki/operator_api_spec.rb | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/ioki/apis/operator_api.rb b/lib/ioki/apis/operator_api.rb index f28154a1..1035299c 100644 --- a/lib/ioki/apis/operator_api.rb +++ b/lib/ioki/apis/operator_api.rb @@ -661,6 +661,12 @@ class OperatorApi model_class: Ioki::Model::Operator::NoShowBlock, except: [:create, :update, :delete] ), + Endpoints::Index.new( + :no_show_blocks_per_user, + base_path: [API_BASE_PATH, 'providers', :id, 'users', :id, 'products', :id], + path: 'no_show_blocks', + model_class: Ioki::Model::Operator::NoShowBlock + ), Endpoints.custom_endpoints( 'no_show_block', actions: { 'acknowledge' => :patch }, diff --git a/spec/ioki/operator_api_spec.rb b/spec/ioki/operator_api_spec.rb index 392f4000..326182a4 100644 --- a/spec/ioki/operator_api_spec.rb +++ b/spec/ioki/operator_api_spec.rb @@ -2947,6 +2947,18 @@ end end + describe '#no_show_blocks_per_user(provider_id, user_id, product_id)' do + it 'calls request on the client with expected params' do + expect(operator_client).to receive(:request) do |params| + expect(params[:url].to_s).to eq('operator/providers/123/users/456/products/789/no_show_blocks') + result_with_index_data + end + + expect(operator_client.no_show_blocks_per_user('123', '456', '789', options)) + .to all(be_a(Ioki::Model::Operator::NoShowBlock)) + end + end + describe '#create_public_transport_changeover_connection(product_id, station_id)' do let(:public_transport_changeover_connection) { Ioki::Model::Operator::PublicTransportChangeoverConnection.new }