mapping.rb 902 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Zendesk::Ticket::Comment::Mapping < Sequencer::Unit::Base
  3. include ::Sequencer::Unit::Import::Common::Mapping::Mixin::ProvideMapped
  4. uses :instance, :resource, :user_id, :from, :to, :article_sender_id, :article_type_id
  5. provides :mapped
  6. def process
  7. provide_mapped do
  8. {
  9. from: from,
  10. to: to,
  11. ticket_id: instance.id,
  12. body: resource.html_body,
  13. content_type: 'text/html',
  14. internal: !resource.public,
  15. message_id: resource.id,
  16. updated_by_id: user_id,
  17. created_by_id: user_id,
  18. updated_at: resource.created_at,
  19. created_at: resource.created_at,
  20. sender_id: article_sender_id,
  21. type_id: article_type_id,
  22. }
  23. end
  24. end
  25. end