From 09086906fe83403d4512668a891b0d8cfda7c2b6 Mon Sep 17 00:00:00 2001 From: y0wel Date: Thu, 1 Oct 2026 17:11:08 +0200 Subject: [PATCH 1/3] add .tool-versions to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ac94a43a..f780a56f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ # Cached common rubocop config .rubocop-https---dbdrive-github-io-triebwerk-rubocop-common-yml + +.tool-versions \ No newline at end of file From b600478410c311ef1889c0d0f51b03909ee9a52c Mon Sep 17 00:00:00 2001 From: y0wel Date: Thu, 1 Oct 2026 17:11:28 +0200 Subject: [PATCH 2/3] add endpoints for driver batch deletion requests --- lib/ioki/apis/operator_api.rb | 13 +++++++++++++ spec/ioki/operator_api_spec.rb | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/lib/ioki/apis/operator_api.rb b/lib/ioki/apis/operator_api.rb index b552d199..b9425524 100644 --- a/lib/ioki/apis/operator_api.rb +++ b/lib/ioki/apis/operator_api.rb @@ -795,6 +795,19 @@ class OperatorApi base_path: nil, path: [API_BASE_PATH, 'products', :id, 'lines', 'batch_deletion_requests', :id], model_class: Ioki::Model::Operator::BatchDeletionRequest + ), + Endpoints::Create.new( + :driver_batch_deletion_request, + base_path: [API_BASE_PATH, 'products', :id, 'drivers'], + path: 'batch_deletion_requests', + model_class: Ioki::Model::Operator::BatchDeletionRequest, + outgoing_model_class: Ioki::Model::Operator::DriverBatch + ), + Endpoints::ShowSingular.new( + :driver_batch_deletion_request, + base_path: nil, + path: [API_BASE_PATH, 'products', :id, 'drivers', 'batch_deletion_requests', :id], + model_class: Ioki::Model::Operator::BatchDeletionRequest ) ].freeze end diff --git a/spec/ioki/operator_api_spec.rb b/spec/ioki/operator_api_spec.rb index fb006114..b001793d 100644 --- a/spec/ioki/operator_api_spec.rb +++ b/spec/ioki/operator_api_spec.rb @@ -3395,4 +3395,31 @@ expect(operator_client.vehicle_state('0815', options)).to be_a Ioki::Model::Operator::VehicleState end end + + describe '#create_driver_batch_deletion_request(product_id)' do + let(:driver_batch) { Ioki::Model::Operator::DriverBatch.new } + + 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/drivers/batch_deletion_requests') + expect(params[:method]).to eq(:post) + [result_with_data, full_response] + end + + expect(operator_client.create_driver_batch_deletion_request('0815', driver_batch, options)) + .to be_a(Ioki::Model::Operator::BatchDeletionRequest) + end + end + + describe '#driver_batch_deletion_request(product_id, batch_deletion_request_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/drivers/batch_deletion_requests/4711') + [result_with_data, full_response] + end + + expect(operator_client.driver_batch_deletion_request('0815', '4711', options)) + .to be_a(Ioki::Model::Operator::BatchDeletionRequest) + end + end end From d0b47e9d1dfaef45dad66844ba7a7f710329bcbf Mon Sep 17 00:00:00 2001 From: y0wel Date: Thu, 1 Oct 2026 17:12:31 +0200 Subject: [PATCH 3/3] add DriverBatch model for operator api --- lib/ioki/model/operator/driver_batch.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/ioki/model/operator/driver_batch.rb diff --git a/lib/ioki/model/operator/driver_batch.rb b/lib/ioki/model/operator/driver_batch.rb new file mode 100644 index 00000000..e5263e4d --- /dev/null +++ b/lib/ioki/model/operator/driver_batch.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Ioki + module Model + module Operator + class DriverBatch < Base + def self.schema_path + 'operator_api--v20210101--driver_batch_archive_schema' + end + + attribute :driver_ids, + on: :create, + type: :array + end + end + end +end