diff --git a/sgx_jmp.rb b/sgx_jmp.rb index ddcb48ade0e96fcfe0027eac5b6f3b70ccc4728c..7e978f3a36f597e319be8f46bfdf950e0bbe7639 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -471,10 +471,18 @@ Command.new( "./ns:userId", ns: "https://ns.cheogram.com/google-play" )&.first&.content end - Command.customer.catch_only(CustomerRepo::NotFound) { - Sentry.add_breadcrumb(Sentry::Breadcrumb.new(message: "Customer.create")) - Command.execution.customer_repo.create(Command.execution.iq.from.stripped) - }.then { |customer| + if Command.execution.iq.from.stripped.to_s == CONFIG[:web_register][:from] + Customer.new( + "__web_register", Command.execution.iq.from.stripped, + sgx: TrivialBackendSgxRepo.new.get("__web_register") + .with(registered?: false) + ) + else + Command.customer.catch_only(CustomerRepo::NotFound) { + Sentry.add_breadcrumb(Sentry::Breadcrumb.new(message: "Customer.create")) + Command.execution.customer_repo.create(Command.execution.iq.from.stripped) + } + end.then { |customer| Sentry.add_breadcrumb(Sentry::Breadcrumb.new(message: "Registration.for")) Registration.for(customer, google_play_userid, TEL_SELECTIONS).then(&:write) }.then {