2018-08-29 19:50:58 +00:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :sla do
|
2019-02-26 11:00:46 +00:00
|
|
|
calendar
|
|
|
|
sequence(:name) { |n| "SLA #{n}" }
|
|
|
|
created_by_id { 1 }
|
|
|
|
updated_by_id { 1 }
|
|
|
|
|
|
|
|
condition do
|
2018-08-29 19:50:58 +00:00
|
|
|
{
|
|
|
|
'ticket.state_id' => {
|
|
|
|
operator: 'is',
|
|
|
|
value: Ticket::State.by_category(:open).pluck(:id),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
end
|
2021-02-15 13:55:00 +00:00
|
|
|
|
|
|
|
trait :condition_blank do
|
|
|
|
condition do
|
|
|
|
{}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :condition_title do
|
|
|
|
transient do
|
|
|
|
condition_title { nil }
|
|
|
|
end
|
|
|
|
|
|
|
|
condition do
|
|
|
|
{
|
|
|
|
'ticket.title' => {
|
|
|
|
operator: 'contains',
|
|
|
|
value: condition_title
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2018-08-29 19:50:58 +00:00
|
|
|
end
|
|
|
|
end
|