From b07244c84d9fe423c685f15d60233c698213eaa1 Mon Sep 17 00:00:00 2001 From: Tobias Matz Date: Thu, 15 Aug 2024 21:56:59 +0200 Subject: [PATCH 1/2] Add products to Provider and remove version --- lib/ioki/model/operator/provider.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ioki/model/operator/provider.rb b/lib/ioki/model/operator/provider.rb index faa9204c..0ce181f8 100644 --- a/lib/ioki/model/operator/provider.rb +++ b/lib/ioki/model/operator/provider.rb @@ -61,6 +61,11 @@ class Provider < Base on: :read, type: :string + attribute :products, + on: :read, + type: :array, + class_name: 'Product' + attribute :psp, on: :read, type: :string @@ -93,10 +98,6 @@ class Provider < Base attribute :tip_payment_method_types, on: :read, type: :array - - attribute :version, - on: :read, - type: :integer end end end From 50f32cae37e4b4052c14548ad3fe743d9325b68f Mon Sep 17 00:00:00 2001 From: Tobias Matz Date: Thu, 22 Aug 2024 10:35:26 +0200 Subject: [PATCH 2/2] Add provider_id to Product --- lib/ioki/model/operator/product.rb | 4 ++++ spec/ioki/model/operator/product_spec.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/ioki/model/operator/product.rb b/lib/ioki/model/operator/product.rb index 94029320..ad552205 100644 --- a/lib/ioki/model/operator/product.rb +++ b/lib/ioki/model/operator/product.rb @@ -29,6 +29,10 @@ class Product < Base on: :read, class_name: 'Provider' + attribute :provider_id, + type: :string, + on: :read + attribute :area, type: :object, on: :read, diff --git a/spec/ioki/model/operator/product_spec.rb b/spec/ioki/model/operator/product_spec.rb index 245e4c4d..15f6ee1d 100644 --- a/spec/ioki/model/operator/product_spec.rb +++ b/spec/ioki/model/operator/product_spec.rb @@ -8,6 +8,7 @@ it { is_expected.to define_attribute(:version).as(:integer) } it { is_expected.to define_attribute(:name).as(:string) } it { is_expected.to define_attribute(:provider).as(:object).with(class_name: 'Provider') } + it { is_expected.to define_attribute(:provider_id).as(:string) } it { is_expected.to define_attribute(:area).as(:object).with(class_name: 'Geojson') } it { is_expected.to define_attribute(:ad_hoc_bookable).as(:boolean) } it { is_expected.to define_attribute(:available_area_types).as(:array) }