add riceathon scenario

This commit is contained in:
End 2026-03-13 11:49:43 -07:00
parent f19a8db287
commit 6bc51e3eba
No known key found for this signature in database
5 changed files with 46 additions and 0 deletions

View file

@ -84,6 +84,21 @@ module Backend
@verification.create_activity(key: "verification.approve", owner: current_user, recipient: @verification.identity, parameters: { ysws_eligible: ysws_eligible })
# Auto-promote on verification approval for scenarios that opt in.
begin
ident = @verification.identity
if ident.present? && ident.slack_id.present? && ident.promote_click_count == 0
scenario = ident.onboarding_scenario_instance
if scenario&.promote_on_verification
Tutorial::AgreeJob.perform_later(ident)
Rails.logger.info "Enqueued auto-promotion for identity #{ident.id} (verification #{@verification.id})"
end
end
rescue => e
Rails.logger.error "Auto-promote on verification approval failed: #{e.message}"
Sentry.capture_exception(e) if defined?(Sentry)
end
redirect_to pending_backend_verifications_path
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

View file

@ -50,6 +50,9 @@ module OnboardingScenarios
# Returns array of channel names/IDs to add when promoting guest to full member
def promotion_channels = []
# Whether to auto-promote when identity verification in HCA is approved
def promote_on_verification = false
# Returns :internal_tutorial or :external_program
def slack_onboarding_flow = :external_program

View file

@ -0,0 +1,27 @@
module OnboardingScenarios
class Riceathon < Base
def self.slug = "riceathon"
def title = "ready to start ricing?"
def form_fields
[ :first_name, :last_name, :primary_email, :birthday, :country ]
end
def slack_user_type = :multi_channel_guest
def slack_channels = chans(:riceathon, :announcements, :welcome_to_hack_club, :identity_help)
def promotion_channels = chans(:riceathon, :announcements, :welcome_to_hack_club, :identity_help)
def next_action = :slack
def use_dm_channel? = false
def promote_on_verification = true
def logo_path = "images/riceathon/RiceathonGlow.png"
def card_attributes = { wide_logo: true }
end
end

View file

@ -49,3 +49,4 @@ shared:
hack_club_the_game: C088DT8P7B8
hctg_bulletin: C0A7HQZFFNX
hctg_help: C0A9XULS1SL
riceathon: C07MLF9A8H5