mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-19 16:28:21 +00:00
add riceathon scenario
This commit is contained in:
parent
f19a8db287
commit
6bc51e3eba
5 changed files with 46 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
BIN
app/frontend/images/riceathon/RiceathonGlow.png
Normal file
BIN
app/frontend/images/riceathon/RiceathonGlow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 253 KiB |
|
|
@ -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
|
||||
|
||||
|
|
|
|||
27
app/models/onboarding_scenarios/riceathon.rb
Normal file
27
app/models/onboarding_scenarios/riceathon.rb
Normal 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
|
||||
|
|
@ -49,3 +49,4 @@ shared:
|
|||
hack_club_the_game: C088DT8P7B8
|
||||
hctg_bulletin: C0A7HQZFFNX
|
||||
hctg_help: C0A9XULS1SL
|
||||
riceathon: C07MLF9A8H5
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue