From 20fd6a9740856bda8f24f5c2aff05d8b78fa6369 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 11 Apr 2023 12:36:20 -0500 Subject: [PATCH] terminate account command --- sgx_jmp.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sgx_jmp.rb b/sgx_jmp.rb index bcfbb9a209ae9a4696f7e2e6b5bdd95913d23b00..fd5813239b06342ee89d1c446038da9877c4dfde 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -799,6 +799,25 @@ Command.new( end }.register(self).then(&CommandList.method(:register)) +Command.new( + "terminate account", + "❌ Cancel your account and terminate your phone number", + list_for: ->(**) { false }, + customer_repo: CustomerRepo.new(sgx_repo: Bwmsgsv2Repo.new) +) { + Command.reply { |reply| + reply.allowed_actions = [:next] + reply.note_text = "Press next to confirm your account termination." + }.then { Command.customer }.then { |customer| + AdminAction::CancelCustomer.call( + customer, + customer_repo: Command.execution.customer_repo + ) + }.then do + Command.finish("Account cancelled") + end +}.register(self).then(&CommandList.method(:register)) + Command.new( "customer info", "Show Customer Info",