trabajo-afectivo/lib/sequencer/unit/import/zendesk/ticket/comment/mapping.rb
2022-01-01 14:38:12 +01:00

38 lines
1.2 KiB
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
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