job.rb 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :job do
  4. sequence(:name) { |n| "Test job #{n}" }
  5. condition { { 'ticket.state_id' => { 'operator' => 'is not', 'value' => 4 } } }
  6. perform { { 'ticket.state_id' => { 'value' => 4 } } }
  7. active { true }
  8. created_by_id { 1 }
  9. updated_by_id { 1 }
  10. monday_00
  11. trait :monday_00 do
  12. timeplan do
  13. { days: { Mon: true,
  14. Tue: false,
  15. Wed: false,
  16. Thu: false,
  17. Fri: false,
  18. Sat: false,
  19. Sun: false },
  20. hours: { 0 => true,
  21. 1 => false,
  22. 2 => false,
  23. 3 => false,
  24. 4 => false,
  25. 5 => false,
  26. 6 => false,
  27. 7 => false,
  28. 8 => false,
  29. 9 => false,
  30. 10 => false,
  31. 11 => false,
  32. 12 => false,
  33. 13 => false,
  34. 14 => false,
  35. 15 => false,
  36. 16 => false,
  37. 17 => false,
  38. 18 => false,
  39. 19 => false,
  40. 20 => false,
  41. 21 => false,
  42. 22 => false,
  43. 23 => false },
  44. minutes: { 0 => true,
  45. 10 => false,
  46. 20 => false,
  47. 30 => false,
  48. 40 => false,
  49. 50 => false } }
  50. end
  51. end
  52. trait :always_on do
  53. timeplan do
  54. { days: { Mon: true,
  55. Tue: true,
  56. Wed: true,
  57. Thu: true,
  58. Fri: true,
  59. Sat: true,
  60. Sun: true },
  61. hours: { 0 => true,
  62. 1 => true,
  63. 2 => true,
  64. 3 => true,
  65. 4 => true,
  66. 5 => true,
  67. 6 => true,
  68. 7 => true,
  69. 8 => true,
  70. 9 => true,
  71. 10 => true,
  72. 11 => true,
  73. 12 => true,
  74. 13 => true,
  75. 14 => true,
  76. 15 => true,
  77. 16 => true,
  78. 17 => true,
  79. 18 => true,
  80. 19 => true,
  81. 20 => true,
  82. 21 => true,
  83. 22 => true,
  84. 23 => true },
  85. minutes: { 0 => true,
  86. 10 => true,
  87. 20 => true,
  88. 30 => true,
  89. 40 => true,
  90. 50 => true } }
  91. end
  92. end
  93. trait :never_on do
  94. timeplan do
  95. { days: { Mon: false,
  96. Tue: false,
  97. Wed: false,
  98. Thu: false,
  99. Fri: false,
  100. Sat: false,
  101. Sun: false },
  102. hours: { 0 => false,
  103. 1 => false,
  104. 2 => false,
  105. 3 => false,
  106. 4 => false,
  107. 5 => false,
  108. 6 => false,
  109. 7 => false,
  110. 8 => false,
  111. 9 => false,
  112. 10 => false,
  113. 11 => false,
  114. 12 => false,
  115. 13 => false,
  116. 14 => false,
  117. 15 => false,
  118. 16 => false,
  119. 17 => false,
  120. 18 => false,
  121. 19 => false,
  122. 20 => false,
  123. 21 => false,
  124. 22 => false,
  125. 23 => false },
  126. minutes: { 0 => false,
  127. 10 => false,
  128. 20 => false,
  129. 30 => false,
  130. 40 => false,
  131. 50 => false } }
  132. end
  133. end
  134. end
  135. end