2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-05-28 06:42:04 +00:00
|
|
|
FactoryBot.define do
|
2019-01-17 10:19:20 +00:00
|
|
|
factory :'cti/log', aliases: %i[cti_log] do
|
2018-05-28 06:42:04 +00:00
|
|
|
direction { %w[in out].sample }
|
2019-01-18 02:26:15 +00:00
|
|
|
state { 'newCall' }
|
2019-01-17 10:19:20 +00:00
|
|
|
from { '4930609854180' }
|
|
|
|
to { '4930609811111' }
|
|
|
|
call_id { (Cti::Log.pluck(:call_id).map(&:to_i).max || 0).next } # has SQL UNIQUE constraint
|
2019-08-16 22:24:50 +00:00
|
|
|
done { false }
|
2019-02-05 07:33:40 +00:00
|
|
|
|
|
|
|
trait :with_preferences do
|
|
|
|
preferences { Cti::CallerId.get_comment_preferences(from, 'from')&.last }
|
|
|
|
end
|
2018-05-28 06:42:04 +00:00
|
|
|
end
|
|
|
|
end
|