data-privacy-task.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. import { i18n } from '@shared/i18n'
  3. import type { DataPrivacyTask } from '@shared/graphql/types'
  4. import type { ActivityMessageBuilder } from '../types'
  5. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  6. const path = (metaObject: DataPrivacyTask) => {
  7. return '#'
  8. }
  9. const messageText = (
  10. type: string,
  11. authorName: string,
  12. metaObject: DataPrivacyTask,
  13. ): Maybe<string> => {
  14. const objectTitle = metaObject.deletableId || '-'
  15. switch (type) {
  16. case 'create':
  17. return i18n.t(
  18. '%s created data privacy task to delete user ID |%s|',
  19. authorName,
  20. objectTitle,
  21. )
  22. case 'update':
  23. return i18n.t(
  24. '%s updated data privacy task to delete user ID |%s|',
  25. authorName,
  26. objectTitle,
  27. )
  28. case 'completed':
  29. return i18n.t(
  30. '%s completed data privacy task to delete user ID |%s|',
  31. authorName,
  32. objectTitle,
  33. )
  34. default:
  35. return null
  36. }
  37. }
  38. export default <ActivityMessageBuilder>{
  39. messageText,
  40. path,
  41. model: 'DataPrivacyTask',
  42. }