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
|
|
|
|
module Comment
|
|
|
|
class Mapping < Sequencer::Unit::Base
|
|
|
|
include ::Sequencer::Unit::Import::Common::Mapping::Mixin::ProvideMapped
|
|
|
|
|
|
|
|
uses :instance, :resource, :user_id, :from, :to, :article_sender_id, :article_type_id
|
|
|
|
provides :mapped
|
|
|
|
|
|
|
|
def process
|
|
|
|
provide_mapped do
|
|
|
|
{
|
|
|
|
from: from,
|
|
|
|
to: to,
|
|
|
|
ticket_id: instance.id,
|
|
|
|
body: resource.html_body,
|
|
|
|
content_type: 'text/html',
|
|
|
|
internal: !resource.public,
|
|
|
|
message_id: resource.id,
|
|
|
|
updated_by_id: user_id,
|
|
|
|
created_by_id: user_id,
|
|
|
|
sender_id: article_sender_id,
|
|
|
|
type_id: article_type_id,
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|