ticket.rb 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. Zammad::Application.routes.draw do
  3. api_path = Rails.configuration.api_path
  4. # ticket shared drafts
  5. resource api_path + '/tickets/:ticket_id/shared_draft', controller: 'ticket_shared_draft_zoom', except: %w[new edit create] do
  6. collection do
  7. post :import_attachments, as: nil
  8. end
  9. end
  10. resources api_path + '/tickets/shared_drafts', controller: 'tickets_shared_draft_starts', except: %w[new edit] do
  11. member do
  12. post :import_attachments, as: nil
  13. end
  14. end
  15. scope Rails.configuration.api_path do
  16. resources '/tickets/:ticket_id/time_accountings', controller: 'time_accountings', only: %i[index show create update destroy]
  17. end
  18. # tickets
  19. match api_path + '/tickets/search', to: 'tickets#search', via: %i[get post]
  20. match api_path + '/tickets', to: 'tickets#index', via: :get
  21. match api_path + '/tickets/:id', to: 'tickets#show', via: :get
  22. match api_path + '/tickets', to: 'tickets#create', via: :post
  23. match api_path + '/tickets/:id', to: 'tickets#update', via: :put
  24. match api_path + '/tickets/:id', to: 'tickets#destroy', via: :delete
  25. match api_path + '/tickets/mass_macro', to: 'tickets_mass#macro', via: :post
  26. match api_path + '/tickets/mass_update', to: 'tickets_mass#update', via: :post
  27. match api_path + '/ticket_create', to: 'tickets#ticket_create', via: :get
  28. match api_path + '/ticket_split', to: 'tickets#ticket_split', via: :get
  29. match api_path + '/ticket_history/:id', to: 'tickets#ticket_history', via: :get
  30. match api_path + '/ticket_customer', to: 'tickets#ticket_customer', via: :get
  31. match api_path + '/ticket_related/:ticket_id', to: 'tickets#ticket_related', via: :get
  32. match api_path + '/ticket_recent', to: 'tickets#ticket_recent', via: :get
  33. match api_path + '/ticket_merge/:source_ticket_id/:target_ticket_number', to: 'tickets#ticket_merge', via: :put
  34. match api_path + '/ticket_stats', to: 'tickets#stats', via: %i[get post]
  35. # ticket overviews
  36. match api_path + '/ticket_overview', to: 'ticket_overviews#data', via: :get
  37. match api_path + '/ticket_overviews', to: 'ticket_overviews#show', via: :get
  38. # ticket priority
  39. match api_path + '/ticket_priorities', to: 'ticket_priorities#index', via: :get
  40. match api_path + '/ticket_priorities/:id', to: 'ticket_priorities#show', via: :get
  41. match api_path + '/ticket_priorities', to: 'ticket_priorities#create', via: :post
  42. match api_path + '/ticket_priorities/:id', to: 'ticket_priorities#update', via: :put
  43. match api_path + '/ticket_priorities/:id', to: 'ticket_priorities#destroy', via: :delete
  44. # ticket state
  45. match api_path + '/ticket_states', to: 'ticket_states#index', via: :get
  46. match api_path + '/ticket_states/:id', to: 'ticket_states#show', via: :get
  47. match api_path + '/ticket_states', to: 'ticket_states#create', via: :post
  48. match api_path + '/ticket_states/:id', to: 'ticket_states#update', via: :put
  49. match api_path + '/ticket_states/:id', to: 'ticket_states#destroy', via: :delete
  50. # ticket articles
  51. match api_path + '/ticket_articles', to: 'ticket_articles#index', via: :get
  52. match api_path + '/ticket_articles/:id', to: 'ticket_articles#show', via: :get
  53. match api_path + '/ticket_articles/by_ticket/:id', to: 'ticket_articles#index_by_ticket', via: :get
  54. match api_path + '/ticket_articles', to: 'ticket_articles#create', via: :post
  55. match api_path + '/ticket_articles/:id', to: 'ticket_articles#update', via: :put
  56. match api_path + '/ticket_articles/:id', to: 'ticket_articles#destroy', via: :delete
  57. match api_path + '/ticket_attachment/:ticket_id/:article_id/:id', to: 'ticket_articles#attachment', via: :get
  58. match api_path + '/ticket_attachment_upload_clone_by_article/:article_id', to: 'ticket_articles#ticket_attachment_upload_clone_by_article', via: :post
  59. match api_path + '/ticket_article_plain/:id', to: 'ticket_articles#article_plain', via: :get
  60. match api_path + '/ticket_articles/:id/retry_security_process', to: 'ticket_articles#retry_security_process', via: :post
  61. match api_path + '/ticket_articles/:id/retry_whatsapp_attachment_download', to: 'ticket_articles#retry_whatsapp_attachment_download', via: :post
  62. end