Skip to content

Commit

Permalink
Merge pull request #429 from ioki-mobility/operator-provider-level
Browse files Browse the repository at this point in the history
Operator Api: Introduce provider level
  • Loading branch information
tom-ioki authored Sep 16, 2024
2 parents 0dd268b + 50f32ca commit 8851261
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions lib/ioki/model/operator/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions lib/ioki/model/operator/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/ioki/model/operator/product_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down

0 comments on commit 8851261

Please sign in to comment.