log.rb 529 B

12345678910111213141516
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :'cti/log', aliases: %i[cti_log] do
  4. direction { %w[in out].sample }
  5. state { 'newCall' }
  6. from { '4930609854180' }
  7. to { '4930609811111' }
  8. call_id { (Cti::Log.pluck(:call_id).map(&:to_i).max || 0).next } # has SQL UNIQUE constraint
  9. done { false }
  10. trait :with_preferences do
  11. preferences { Cti::CallerId.get_comment_preferences(from, 'from')&.last }
  12. end
  13. end
  14. end