job.rb 4.3 KB

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