From 45a1c2ef505c302ac012fd29abec4362b90ef324 Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Mon, 20 Jul 2026 15:17:11 +0200 Subject: [PATCH 1/3] call new service violation endpoints --- lib/ioki/apis/operator_api.rb | 6 +++--- spec/ioki/operator_api_spec.rb | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/ioki/apis/operator_api.rb b/lib/ioki/apis/operator_api.rb index 6a1c6756..e757e3af 100644 --- a/lib/ioki/apis/operator_api.rb +++ b/lib/ioki/apis/operator_api.rb @@ -710,14 +710,14 @@ class OperatorApi outgoing_model_class: Ioki::Model::Operator::GeocodingReverseSearch ), Endpoints::Index.new( - :no_shows, + :service_violations, base_path: [API_BASE_PATH, 'products', :id], model_class: Ioki::Model::Operator::NoShow ), Endpoints.custom_endpoints( - 'no_show', + 'service_violation', actions: { 'acknowledge' => :patch }, - path: [API_BASE_PATH, 'products', :id, 'no_shows', :id], + path: [API_BASE_PATH, 'products', :id, 'service_violations', :id], model_class: Ioki::Model::Operator::NoShow ), Endpoints.crud_endpoints( diff --git a/spec/ioki/operator_api_spec.rb b/spec/ioki/operator_api_spec.rb index 0a4d8dfd..6b780476 100644 --- a/spec/ioki/operator_api_spec.rb +++ b/spec/ioki/operator_api_spec.rb @@ -3155,27 +3155,27 @@ end end - describe '#no_show_acknowledge(product_id, no_show_id)' do + describe '#service_violation_acknowledge(product_id, service_violation_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/products/0815/no_shows/4711/acknowledge') + expect(params[:url].to_s).to eq('operator/products/0815/service_violations/4711/acknowledge') expect(params[:method]).to eq(:patch) result_with_data end - expect(operator_client.no_show_acknowledge('0815', '4711')) + expect(operator_client.service_violation_acknowledge('0815', '4711')) .to be_a(Ioki::Model::Operator::NoShow) end end - describe '#no_shows(product_id)' do + describe '#service_violations(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/products/0815/no_shows') + expect(params[:url].to_s).to eq('operator/products/0815/service_violations') result_with_index_data end - expect(operator_client.no_shows('0815', options)) + expect(operator_client.service_violations('0815', options)) .to all(be_a(Ioki::Model::Operator::NoShow)) end end From 469149ed74e5e65fd2e9da0deb2689dc1ae26e86 Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Mon, 20 Jul 2026 15:18:20 +0200 Subject: [PATCH 2/3] rename no show block model file --- lib/ioki/model/operator/{no_show.rb => service_violation.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/ioki/model/operator/{no_show.rb => service_violation.rb} (100%) diff --git a/lib/ioki/model/operator/no_show.rb b/lib/ioki/model/operator/service_violation.rb similarity index 100% rename from lib/ioki/model/operator/no_show.rb rename to lib/ioki/model/operator/service_violation.rb From 91b0926c3da87305e88198928d63d6e76e9f8983 Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Mon, 20 Jul 2026 15:21:34 +0200 Subject: [PATCH 3/3] change usages of NoShow to ServiceViolation and include new response attribute --- lib/ioki/apis/operator_api.rb | 4 ++-- lib/ioki/model/operator/service_violation.rb | 6 +++++- spec/ioki/operator_api_spec.rb | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/ioki/apis/operator_api.rb b/lib/ioki/apis/operator_api.rb index e757e3af..b552d199 100644 --- a/lib/ioki/apis/operator_api.rb +++ b/lib/ioki/apis/operator_api.rb @@ -712,13 +712,13 @@ class OperatorApi Endpoints::Index.new( :service_violations, base_path: [API_BASE_PATH, 'products', :id], - model_class: Ioki::Model::Operator::NoShow + model_class: Ioki::Model::Operator::ServiceViolation ), Endpoints.custom_endpoints( 'service_violation', actions: { 'acknowledge' => :patch }, path: [API_BASE_PATH, 'products', :id, 'service_violations', :id], - model_class: Ioki::Model::Operator::NoShow + model_class: Ioki::Model::Operator::ServiceViolation ), Endpoints.crud_endpoints( :service_violation_block, diff --git a/lib/ioki/model/operator/service_violation.rb b/lib/ioki/model/operator/service_violation.rb index 5a21db97..92183be6 100644 --- a/lib/ioki/model/operator/service_violation.rb +++ b/lib/ioki/model/operator/service_violation.rb @@ -3,7 +3,7 @@ module Ioki module Model module Operator - class NoShow < Base + class ServiceViolation < Base attribute :type, on: :read, type: :string @@ -39,6 +39,10 @@ class NoShow < Base attribute :ride_id, on: :read, type: :string + + attribute :service_violation_type, + on: :read, + type: :string end end end diff --git a/spec/ioki/operator_api_spec.rb b/spec/ioki/operator_api_spec.rb index 6b780476..ac2b9abc 100644 --- a/spec/ioki/operator_api_spec.rb +++ b/spec/ioki/operator_api_spec.rb @@ -3164,7 +3164,7 @@ end expect(operator_client.service_violation_acknowledge('0815', '4711')) - .to be_a(Ioki::Model::Operator::NoShow) + .to be_a(Ioki::Model::Operator::ServiceViolation) end end @@ -3176,7 +3176,7 @@ end expect(operator_client.service_violations('0815', options)) - .to all(be_a(Ioki::Model::Operator::NoShow)) + .to all(be_a(Ioki::Model::Operator::ServiceViolation)) end end