Files
fizzy/saas/app/models/account/queenbee_integration.rb
Donal McBreen 98d06947cb Implement Queenbee account callbacks
Add Account::QueenbeeIntegration concern (SaaS-only) that bridges
Fizzy's external_account_id to Queenbee's find_by_queenbee_id lookup,
and adapts the bang lifecycle methods to Fizzy's Cancellable module.

Remove dead billing conditional from cancellation mailer — Fizzy is
free-only, there's no charge to stop.
2026-03-31 15:14:49 +01:00

59 lines
811 B
Ruby

module Account::QueenbeeIntegration
extend ActiveSupport::Concern
include Queenbee::Client
class_methods do
def find_by_queenbee_id(id)
find_by(external_account_id: id)
end
end
def queenbee_id
external_account_id
end
def cancel!
cancel(initiated_by: system_user)
end
def uncancel!
reactivate
end
def deactivate!
cancel!
end
def reactivate!
reactivate
end
def canceled?
cancelled?
end
def owner_name
users.owner.first&.name
end
def owner_email
users.owner.first&.identity&.email_address
end
def transferred_ownership!
raise NotImplementedError, "Fizzy does not support Queenbee-initiated ownership transfers"
end
def plan
"FreeV1"
end
def comped?
false
end
def comped=(value)
end
end