-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ticketing endpoints to the passenger API
- Loading branch information
Showing
12 changed files
with
319 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
class EnumItem < Base | ||
attribute :type, on: :read, type: :string | ||
attribute :slug, on: :read, type: :string | ||
attribute :name, on: :read, type: :string | ||
attribute :description, on: :read, type: :string | ||
attribute :value, on: :read, type: :string | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
module Ticketing | ||
class OptionValue < Base | ||
attribute :type, on: :read, type: :string | ||
attribute :slug, on: :read, type: :string | ||
attribute :value, on: :read, type: :string | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
module Ticketing | ||
class Product < Base | ||
attribute :type, on: :read, type: :string | ||
attribute :id, on: :read, type: :string | ||
attribute :created_at, on: :read, type: :date_time | ||
attribute :updated_at, on: :read, type: :date_time | ||
attribute :provider_id, on: :read, type: :string | ||
attribute :ticketing_vendor_id, on: :read, type: :string | ||
attribute :slug, on: :read, type: :string | ||
attribute :name, on: :read, type: :string | ||
attribute :description, on: :read, type: :string | ||
attribute :purchasable, on: :read, type: :boolean | ||
attribute :purchasable_from, on: :read, type: :date_time | ||
attribute :purchasable_until, on: :read, type: :date_time | ||
attribute :price_type, on: :read, type: :string | ||
attribute :icon_type, on: :read, type: :string | ||
attribute :price, on: :read, type: :object, class_name: 'Ioki::Model::Passenger::Money' | ||
attribute :purchase_options, on: :read, type: :array, class_name: 'PurchaseOption' | ||
attribute :redemption_options, on: :read, type: :array, class_name: 'RedemptionOption' | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
module Ticketing | ||
class ProductPurchase < Base | ||
attribute :purchase_options, on: :create, type: :array, class_name: 'PurchaseOption' | ||
attribute :redemption_options, on: :create, type: :array, class_name: 'RedemptionOption' | ||
attribute :ride_id, on: :create, type: :string | ||
attribute :payment_method, on: :create, type: :object, class_name: 'Ioki::Model::Passenger::PaymentMethod' | ||
attribute :paypal_secure_element, on: :create, type: :string | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
module Ticketing | ||
class PurchaseOption < Base | ||
attribute :type, on: :read, type: :string | ||
attribute :slug, on: [:read, :create], type: :string | ||
attribute :name, on: :read, type: :string | ||
attribute :description, on: :read, type: :string | ||
attribute :data_type, on: :read, type: :string | ||
attribute :data_format, on: :read, type: :string | ||
attribute :data_enum, on: :read, type: :boolean | ||
attribute :required, on: :read, type: :boolean | ||
attribute :enum_items, on: :read, type: :array, class_name: 'Ioki::Model::Passenger::EnumItem' | ||
attribute :value, on: :create, type: :string | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
module Ticketing | ||
class RedemptionOption < Base | ||
attribute :type, on: :read, type: :string | ||
attribute :slug, on: [:read, :create], type: :string | ||
attribute :name, on: :read, type: :string | ||
attribute :description, on: :read, type: :string | ||
attribute :data_type, on: :read, type: :string | ||
attribute :data_format, on: :read, type: :string | ||
attribute :data_enum, on: :read, type: :boolean | ||
attribute :required, on: :read, type: :boolean | ||
attribute :enum_items, on: :read, type: :array, class_name: 'Ioki::Model::Passenger::EnumItem' | ||
attribute :value, on: :create, type: :string | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
module Ticketing | ||
class Ticket < Base | ||
attribute :type, on: :read, type: :string | ||
attribute :id, on: :read, type: :string | ||
attribute :created_at, on: :read, type: :date_time | ||
attribute :updated_at, on: :read, type: :date_time | ||
attribute :voucher_id, on: :read, type: :string | ||
attribute :issuer_slug, on: :read, type: :string | ||
attribute :access_token, on: :read, type: :string | ||
attribute :webview_url, on: :read, type: :string | ||
attribute :validity_information, on: :read, type: :string | ||
attribute :valid_from, on: :read, type: :date_time | ||
attribute :valid_until, on: :read, type: :date_time | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
module Ticketing | ||
class Voucher < Base | ||
attribute :type, on: :read, type: :string | ||
attribute :id, on: :read, type: :string | ||
attribute :created_at, on: :read, type: :date_time | ||
attribute :updated_at, on: :read, type: :date_time | ||
attribute :provider_id, on: :read, type: :string | ||
attribute :user_id, on: :read, type: :string | ||
attribute :ride_id, on: :read, type: :string | ||
attribute :state, on: :read, type: :string | ||
attribute :product, on: :read, type: :object, class_name: 'Product' | ||
attribute :ticket, on: :read, type: :object, class_name: 'Ticket' | ||
attribute :payment_method, on: :read, type: :object, class_name: 'Ioki::Model::Passenger::PaymentMethod' | ||
attribute :price, on: :read, type: :object, class_name: 'Ioki::Model::Passenger::Money' | ||
attribute :purchase_option_values, on: :read, type: :array, class_name: 'OptionValue' | ||
attribute :redemption_option_values, on: :read, type: :array, class_name: 'OptionValue' | ||
attribute :renewal_information, on: :read, type: :object, class_name: 'VoucherRenewalInformation' | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
module Ticketing | ||
class VoucherRenewal < Base | ||
attribute :payment_method, on: :create, type: :object, class_name: 'Ioki::Model::Passenger::PaymentMethod' | ||
attribute :paypal_secure_element, on: :create, type: :string | ||
end | ||
end | ||
end | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
lib/ioki/model/passenger/ticketing/voucher_renewal_information.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ioki | ||
module Model | ||
module Passenger | ||
module Ticketing | ||
class VoucherRenewalInformation < Base | ||
attribute :type, on: :read, type: :string | ||
attribute :renewable, on: :read, type: :boolean | ||
attribute :valid_from, on: :read, type: :date_time | ||
attribute :valid_until, on: :read, type: :date_time | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters