feat: onboarding account details with enriched data [UPM-17][UPM-18] (#13979)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
14
lib/tasks/onboarding.rake
Normal file
14
lib/tasks/onboarding.rake
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace :onboarding do
|
||||
desc 'Reset onboarding for an account (triggers the onboarding flow again). Usage: rake onboarding:reset[account_id]'
|
||||
task :reset, [:account_id] => :environment do |_task, args|
|
||||
abort 'Error: Please provide an account ID' if args[:account_id].blank?
|
||||
|
||||
account = Account.find_by(id: args[:account_id])
|
||||
abort "Error: Account with ID '#{args[:account_id]}' not found" unless account
|
||||
|
||||
account.custom_attributes['onboarding_step'] = 'account_details'
|
||||
account.save!
|
||||
|
||||
puts "Onboarding has been reset for account '#{account.name}' (ID: #{account.id})"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user