2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2018-01-08 15:29:34 +00:00
|
|
|
class Sequencer
|
|
|
|
class Unit
|
|
|
|
module Import
|
|
|
|
module Zendesk
|
|
|
|
module Ticket
|
2021-06-23 11:35:27 +00:00
|
|
|
class StateId < Sequencer::Unit::Common::Provider::Named
|
2018-01-08 15:29:34 +00:00
|
|
|
|
|
|
|
uses :resource
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def state_id
|
|
|
|
::Ticket::State.select(:id).find_by(name: local).id
|
|
|
|
end
|
|
|
|
|
|
|
|
def local
|
|
|
|
mapping.fetch(resource.status, resource.status)
|
|
|
|
end
|
|
|
|
|
|
|
|
def mapping
|
|
|
|
{
|
|
|
|
'pending' => 'pending reminder',
|
|
|
|
'solved' => 'closed',
|
|
|
|
'deleted' => 'removed',
|
2019-01-28 05:56:42 +00:00
|
|
|
'hold' => 'open'
|
2018-01-08 15:29:34 +00:00
|
|
|
}.freeze
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|