Skip to content

Commit

Permalink
Merge pull request #387 from ioki-mobility/change-access-for-vehicle-…
Browse files Browse the repository at this point in the history
…resources

Operator Api | Change access for `default_resource_configuration`
  • Loading branch information
tom-ioki authored Jun 3, 2024
2 parents 30e6163 + 05d60a7 commit 4222b32
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 31 deletions.
22 changes: 11 additions & 11 deletions lib/ioki/model/operator/vehicle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Vehicle < Base
type: :string

attribute :default_resource_configuration,
on: :read,
on: [:create, :read, :update],
type: :object,
class_name: 'ResourceConfiguration'

Expand Down Expand Up @@ -106,6 +106,16 @@ class Vehicle < Base
on: [:create, :read, :update],
type: :string

attribute :telemetry,
on: :read,
type: :object,
class_name: 'Telemetry'

attribute :version,
on: [:update, :read],
omit_if_nil_on: [:update],
type: :integer

deprecated_attribute :seats,
on: [:create, :read, :update],
omit_if_nil_on: [:create, :update],
Expand All @@ -125,16 +135,6 @@ class Vehicle < Base
on: [:create, :read, :update],
omit_if_nil_on: [:create, :update],
type: :integer

attribute :telemetry,
on: :read,
type: :object,
class_name: 'Telemetry'

attribute :version,
on: [:update, :read],
omit_if_nil_on: [:update],
type: :integer
end
end
end
Expand Down
21 changes: 5 additions & 16 deletions lib/ioki/model/platform/vehicle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class Vehicle < Base
on: :read,
type: :string

attribute :default_resource_configuration,
on: [:create, :read, :update],
type: :object,
class_name: 'ResourceConfiguration'

attribute :description,
on: [:read, :create, :update],
type: :string
Expand Down Expand Up @@ -70,29 +75,13 @@ class Vehicle < Base
on: [:read, :create, :update],
type: :string

attribute :seats,
on: [:read, :create, :update],
type: :integer

attribute :storage_spaces,
on: [:read, :create, :update],
type: :integer

attribute :vehicle_type,
on: [:read, :create, :update],
type: :string

attribute :version,
on: [:read, :update],
type: :integer

attribute :walker_bays,
on: [:read, :create, :update],
type: :integer

attribute :wheelchair_bays,
on: [:read, :create, :update],
type: :integer
end
end
end
Expand Down
4 changes: 0 additions & 4 deletions spec/ioki/model/operator/vehicle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,5 @@
it { is_expected.to define_attribute(:num_wheelchair_bays_as_storages).as(:integer) }
it { is_expected.to define_attribute(:operator_id).as(:string) }
it { is_expected.to define_attribute(:phone_number).as(:string) }
it { is_expected.to define_attribute(:seats).as(:integer) }
it { is_expected.to define_attribute(:storage_spaces).as(:integer) }
it { is_expected.to define_attribute(:walker_bays).as(:integer) }
it { is_expected.to define_attribute(:wheelchair_bays).as(:integer) }
it { is_expected.to define_attribute(:telemetry).as(:object).with(class_name: 'Telemetry') }
end

0 comments on commit 4222b32

Please sign in to comment.