mapping.rb 612 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Kayako::TimeEntry::Mapping < Sequencer::Unit::Base
  3. include ::Sequencer::Unit::Import::Common::Mapping::Mixin::ProvideMapped
  4. uses :resource, :id_map, :created_by_id
  5. provides :action
  6. def process
  7. provide_mapped do
  8. {
  9. time_unit: time_unit,
  10. ticket_id: ticket_id,
  11. created_by_id: created_by_id,
  12. }
  13. end
  14. end
  15. private
  16. def time_unit
  17. resource['time_spent'].to_i / 60
  18. end
  19. def ticket_id
  20. id_map['Ticket'][resource['case']['id']]
  21. end
  22. end