Sha256: da5c9041383c16af219c4dc30cd93ccabe94cdcd3ab98e1919b5b73d0f10fc59

Contents?: true

Size: 1.11 KB

Versions: 25

Compression:

Stored size: 1.11 KB

Contents

class Maestrano::Account::GroupsController < Maestrano::Rails::WebHookController
  
  # DELETE /maestrano/account/groups/cld-1/:tenant
  # Delete an entire group
  def destroy
    group_uid = params[:id]
    tenant = params[:tenant]
    
    # Perform deletion steps here
    # --
    # If you need to perform a final checkout
    # then you can call Maestrano::Account::Bill.create({.. final checkout details ..})
    # --
    # If Maestrano.param('sso.creation_mode') is set to virtual
    # then you might want to delete/cancel/block all users under
    # that group
    # --
    # E.g:
    # organization = Organization.find_by_tenant_and_uid(tenant, group_uid)
    #
    # amount_cents = organization.calculate_total_due_remaining
    # Maestrano::Account::Bill.create({
    #   group_id: group_uid, 
    #   price_cents: amount_cents, 
    #   description: "Final Payout"
    # })
    # 
    # if Maestrano.param('sso.creation_mode') == 'virtual'
    #   organization.members.where(provider:'maestrano').each do |user|
    #   user.destroy
    # end
    #
    # organization.destroy
    # render json: {success: true}
    #
  end
end

Version data entries

25 entries across 18 versions & 1 rubygems

Version Path
maestrano-rails-1.0.4 test/tmp/app/controllers/maestrano/account/groups_controller.rb
maestrano-rails-1.0.4 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.3 test/tmp/app/controllers/maestrano/account/groups_controller.rb
maestrano-rails-1.0.3 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.2 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.2 test/tmp/app/controllers/maestrano/account/groups_controller.rb
maestrano-rails-1.0.0 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.0.pre.RC8 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.0.pre.RC7 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.0.pre.RC6 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.0.pre.RC5 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.0.pre.RC4 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.0.pre.RC3 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.0.pre.RC2 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.0.pre.RC1 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-1.0.0.pre.RC1 test/tmp/app/controllers/maestrano/account/groups_controller.rb
maestrano-rails-0.15.4 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-0.15.2 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-0.15.1 lib/generators/maestrano/templates/groups_controller.rb
maestrano-rails-0.15.0 lib/generators/maestrano/templates/groups_controller.rb