Flatten SIM job pricing config

Amolith created

Update the SIM job's inline Dhall schema to use fixed CAD/USD records
for the annual and per-GB prices it reads.

Change summary

bin/sim_job | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

Detailed changes

bin/sim_job 🔗

@@ -32,8 +32,8 @@ SCHEMA = "{
 	component: { jid: Text },
 	keepgo: Optional { access_token: Text, api_key: Text },
 	sims: {
-		CAD: { per_gb: Natural, annual: Natural },
-		USD: { per_gb: Natural, annual: Natural }
+		annual: { CAD: Natural, USD: Natural },
+		per_gb: { CAD: Natural, USD: Natural }
 	},
 	plans: List {
 		currency: < CAD | USD >,
@@ -69,6 +69,7 @@ require_relative "../lib/expiring_lock"
 require_relative "../lib/low_balance"
 require_relative "../lib/postgres"
 require_relative "../lib/sim_repo"
+require_relative "../lib/sim_pricing"
 require_relative "../lib/transaction"
 
 BRAINTREE = AsyncBraintree.new(**CONFIG[:braintree])
@@ -107,7 +108,7 @@ module SimAction
 	end
 
 	def refill_price
-		(BigDecimal(CONFIG[:sims][customer.currency][:per_gb]) / 100) * 5
+		SIMPricing.five_gb_refill_price(customer.currency, CONFIG)
 	end
 
 	def refill_and_bill(data, price, note)
@@ -206,7 +207,7 @@ class SimAnnual
 	end
 
 	def annual_price
-		BigDecimal(CONFIG[:sims][customer.currency][:annual]) / 100
+		SIMPricing.annual_price(customer.currency, CONFIG)
 	end
 
 	def call