[go: up one dir, main page]

Create Leads::GitlabCom::AddonsController

Summary

Create a new Leads::GitlabCom::AddonsController on CustomersDot to handle addon-related lead creation for GitLab.com.

Problem

The trials_controller.rb#create_addon method currently handles both lead creation and addon trial application. This needs to be separated - this issue extracts the lead creation portion into a dedicated controller.

Implementation Details

New Controller

File: app/controllers/leads/gitlab_com/addons_controller.rb

Responsibilities:

  • Handle addon-related lead creation for GitLab.com users (Duo Pro, Duo Enterprise, etc.)
  • Validate lead parameters
  • Integrate with lead tracking systems (Marketo, Salesforce, etc.)
  • Return appropriate success/error responses

Extract from trials_controller.rb

  • Lead creation logic from create_addon method
  • Related validations for lead data
  • Lead-specific error handling
  • Any lead-specific helper methods

Important: Do NOT extract addon trial application logic - that stays in trials_controller.rb#create_addon until we migrate in another epic

Routes

Add to config/routes.rb:

namespace :leads do
  namespace :gitlab_com do
    resources :addons, only: [:create]
  end
end

New endpoint: POST /leads/gitlab_com/addons

Edited by Doug Stull