-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(unit-price) add amount_details attribute to Fee object
- Loading branch information
Showing
7 changed files
with
686 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
app/graphql/types/fees/amount_details/graduated_percentage_range.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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Types | ||
module Fees | ||
module AmountDetails | ||
class GraduatedPercentageRange < Types::BaseObject | ||
graphql_name 'FeeAmountDetailsGraduatedPercentageRange' | ||
|
||
field :units, String, null: true | ||
field :from_value, Integer, null: true | ||
field :to_value, Integer, null: true | ||
field :flat_unit_amount, String, null: true | ||
field :rate, String, null: true | ||
field :per_unit_total_amount, String, null: true | ||
field :total_with_flat_amount, String, null: true | ||
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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Types | ||
module Fees | ||
module AmountDetails | ||
class GraduatedRange < Types::BaseObject | ||
graphql_name 'FeeAmountDetailsGraduatedRange' | ||
|
||
field :units, String, null: true | ||
field :from_value, Integer, null: true | ||
field :to_value, Integer, null: true | ||
field :flat_unit_amount, String, null: true | ||
field :per_unit_amount, String, null: true | ||
field :per_unit_total_amount, String, null: true | ||
field :total_with_flat_amount, String, null: true | ||
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,36 @@ | ||
# frozen_string_literal: true | ||
|
||
module Types | ||
module Fees | ||
module AmountDetails | ||
class Object < Types::BaseObject | ||
graphql_name 'FeeAmountDetails' | ||
|
||
# NOTE: Graduated charge model | ||
field :graduated_ranges, [Types::Fees::AmountDetails::GraduatedRange], null: true | ||
|
||
# NOTE: Graduated percentage modle | ||
field :graduated_percentage_ranges, [Types::Fees::AmountDetails::GraduatedPercentageRange], null: true | ||
|
||
# NOTE: Package charge model | ||
field :free_units, String, null: true | ||
field :paid_units, String, null: true | ||
field :per_package_size, Integer, null: true | ||
field :per_package_unit_amount, String, null: true | ||
|
||
# NOTE: Percentage charge model | ||
field :units, String, null: true | ||
field :free_events, Integer, null: true | ||
field :rate, String, null: true | ||
field :per_unit_total_amount, String, null: true | ||
field :paid_events, Integer, null: true | ||
field :fixed_fee_unit_amount, String, null: true | ||
field :fixed_fee_total_amount, String, null: true | ||
field :min_max_adjustment_total_amount, String, null: true | ||
|
||
# NOTE: Volume charge model | ||
field :volume_ranges, [Types::Fees::AmountDetails::VolumeRange], null: true | ||
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 Types | ||
module Fees | ||
module AmountDetails | ||
class VolumeRange < Types::BaseObject | ||
graphql_name 'FeeAmountDetailsVolumeRange' | ||
|
||
field :per_unit_amount, String, null: false | ||
field :flat_unit_amount, String, null: false | ||
field :per_unit_total_amount, String, null: false | ||
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.