overview.rb 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :overview do
  4. sequence(:name) { |n| "Test Overview #{n}" }
  5. sequence(:prio) { |n| n }
  6. role_ids { Role.where(name: %w[Customer Agent Admin]).pluck(:id) }
  7. out_of_office { false }
  8. updated_by_id { 1 }
  9. created_by_id { 1 }
  10. condition do
  11. {
  12. 'ticket.state_id' => {
  13. operator: 'is',
  14. value: Ticket::State.where(name: %w[new open]).pluck(:id),
  15. },
  16. }
  17. end
  18. order do
  19. {
  20. by: 'created_at',
  21. direction: 'DESC',
  22. }
  23. end
  24. view do
  25. {
  26. d: %w[title customer state created_at],
  27. s: %w[number title state created_at],
  28. m: %w[number title state created_at],
  29. view_mode_default: 's',
  30. }
  31. end
  32. trait :condition_expert do
  33. condition do
  34. {
  35. operator: 'AND',
  36. conditions: [
  37. {
  38. name: 'ticket.state_id',
  39. operator: 'is',
  40. value: Ticket::State.where(name: %w[new open]).pluck(:id),
  41. }
  42. ]
  43. }
  44. end
  45. end
  46. end
  47. end