Restructure omni services and add Chatwoot research snapshot

This commit is contained in:
Ruslan Bakiev
2026-02-21 11:11:27 +07:00
parent edea7a0034
commit b73babbbf6
7732 changed files with 978203 additions and 32 deletions

View File

@@ -0,0 +1,31 @@
class TestData::AccountCreator
DATA_FILE = 'tmp/test_data_account_ids.txt'.freeze
def self.create!(id)
company_name = generate_company_name
domain = generate_domain(company_name)
account = Account.create!(
id: id,
name: company_name,
domain: domain,
created_at: Faker::Time.between(from: 2.years.ago, to: 6.months.ago)
)
persist_account_id(account.id)
account
end
def self.generate_company_name
"#{Faker::Company.name} #{TestData::Constants::COMPANY_TYPES.sample}"
end
def self.generate_domain(company_name)
"#{company_name.parameterize}.#{TestData::Constants::DOMAIN_EXTENSIONS.sample}"
end
def self.persist_account_id(account_id)
FileUtils.mkdir_p('tmp')
File.open(DATA_FILE, 'a') do |file|
file.write("#{account_id},")
end
end
end