# frozen_string_literal: true

require "bigdecimal"

module SIMPricing
	# SIM refill billing records currency amounts in transactions. Use BigDecimal
	# because the configured per-GB price is stored in cents.
	def self.five_gb_refill_price(currency, config)
		(BigDecimal(config[:sims][currency][:per_gb]) / 100) * 5
	end

	# CustomerRepo#put_monthly_limits stores limits with to_i, so render monthly
	# data limit form steps in that same integer-dollar unit.
	def self.whole_dollars(price)
		price.to_i
	end
end
