handle failed porting jobs
Phillip Davis
created 3 weeks ago
customers without tels are no longer considered unknown.
the only other sensible definition of an unknown customer would
be "doesn't have a customer id," but the customer info command
will never return data that didnt come from a CustomerRepo.
anyway, this causes failed registrations to retry
Change summary
lib/porting_step_repo.rb | 32 --------------------------------
test/test_porting_step.rb | 4 +---
2 files changed, 1 insertion(+), 35 deletions(-)
Detailed changes
@@ -96,36 +96,6 @@ class PortingStepRepo
"key `jmp_port_freeze-#{port.id}`"
end
- class NoCustomer < self
- attr_reader :port
-
- NO_GRACE_PERIOD = 0
-
- def initialize(port:, **kwargs)
- @port = port
- super(**kwargs)
- end
-
- def self.for(port:, **kwargs)
- Alert.for(
- port,
- grace_period: NO_GRACE_PERIOD,
- real_step: new(port: port, **kwargs),
- output: kwargs[:output],
- msg: msg(port),
- key: :port_for_unknown_customer
- )
- end
-
- def self.msg(port)
- "⚠ Freezing port #{port.id} for unknown customer: #{port.customer_id}."
- end
-
- def perform_next_step
- redis.set("jmp_port_freeze-#{port.id}", 1)
- end
- end
-
class AdminCommand < self
def initialize(exe:, **kwargs)
@exe = exe
@@ -139,8 +109,6 @@ class PortingStepRepo
def find(port)
h = to_h
@exe.fetch_and_submit(q: port.customer_id).then do |form|
- next NoCustomer.for(port: port, **h.except(:exe)) unless form.tel
-
if port.tel == form.tel && form.route == port.backend_sgx.to_s
GoodNumber.new(**h).find(port)
else
@@ -319,9 +319,7 @@ class PortingStepTest < Minitest::Test
Blather::JID.new("testroute")
)).sync
- assert_kind_of PortingStepRepo::Alert, step
- assert_equal :port_for_unknown_customer, step.key
- assert_kind_of PortingStepRepo::Complete::NoCustomer, step.real_step
+ assert_kind_of PortingStepRepo::Complete::AdminCommand::WrongNumber, step
assert_mock redis
assert_mock notify
end