terminate account command

Stephen Paul Weber created

Change summary

sgx_jmp.rb | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

Detailed changes

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",