~singpolyma/sgx-jmp

23200e59e0f9b84a49aff98b6d10177b0fbbd3c8 — Stephen Paul Weber 11 months ago bc55811
Transaction amounts are negative, but cdr charge is positive
2 files changed, 4 insertions(+), 4 deletions(-)

M lib/call_attempt_repo.rb
M test/test_web.rb
M lib/call_attempt_repo.rb => lib/call_attempt_repo.rb +1 -1
@@ 52,7 52,7 @@ protected
				customer_id=$1 AND
				start > DATE_TRUNC('month', LOCALTIMESTAMP)
		SQL
		promise.then { |rows| -(rows.first&.dig("a") || 0) }
		promise.then { |rows| rows.first&.dig("a") || 0 }
	end

	def find_rate(plan_name, other_tel, direction)

M test/test_web.rb => test/test_web.rb +3 -3
@@ 82,9 82,9 @@ class WebTest < Minitest::Test
			db: FakeDB.new(
				["test_usd", "+15557654321", :outbound] => [{ "rate" => 0.01 }],
				["test_usd", "+15557654321", :inbound] => [{ "rate" => 0.01 }],
				["customerid_limit"] => [{ "a" => -1000 }],
				["customerid_low"] => [{ "a" => -1000 }],
				["customerid_topup"] => [{ "a" => -1000 }]
				["customerid_limit"] => [{ "a" => 1000 }],
				["customerid_low"] => [{ "a" => 1000 }],
				["customerid_topup"] => [{ "a" => 1000 }]
			)
		)
		Web.opts[:common_logger] = FakeLog.new