~singpolyma/sgx-jmp

f686bfe2db76dd36c911e8c02e6a99f5f69e90f7 — Stephen Paul Weber 2 years ago f7426dd
Allow prev from mail-in registration
1 files changed, 11 insertions(+), 3 deletions(-)

M lib/registration.rb
M lib/registration.rb => lib/registration.rb +11 -3
@@ 399,7 399,9 @@ class Registration
		class Mail
			Payment.kinds[:mail] = method(:new)

			def initialize(_customer, _tel, final_message: nil, **)
			def initialize(customer, tel, final_message: nil, **)
				@customer = customer
				@tel = tel
				@final_message = final_message
			end



@@ 425,9 427,15 @@ class Registration
			end

			def write
				Command.finish(status: :canceled) do |reply|
				Command.reply { |reply|
					reply.allowed_actions = [:prev]
					reply.status = :canceled
					reply.command << form
				end
				}.then { |iq|
					raise "Action not allowed" unless iq.prev?

					Activation.for(@customer, @tel).then(&:write)
				}
			end
		end
	end