# frozen_string_literal: true

class ParentedDomain
	def self.for(jid)
		config = CONFIG[:parented_domains][Blather::JID.new(jid).domain]
		config ? new(config) : nil
	end

	def initialize(config)
		@config = config
	end

	def plan_kwargs
		{
			plan_name: @config[:plan_name],
			parent_customer_id: @config[:customer_id]
		}
	end
end
