abuse.model.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { Account } from '../../actors/account.model'
  2. import { AbuseState } from './abuse-state.model'
  3. import { AbusePredefinedReasonsString } from './abuse-reason.model'
  4. import { VideoConstant } from '../../videos/video-constant.model'
  5. import { VideoChannel } from '../../videos/channel/video-channel.model'
  6. export interface AdminVideoAbuse {
  7. id: number
  8. name: string
  9. uuid: string
  10. nsfw: boolean
  11. deleted: boolean
  12. blacklisted: boolean
  13. startAt: number | null
  14. endAt: number | null
  15. thumbnailPath?: string
  16. channel?: VideoChannel
  17. countReports: number
  18. nthReport: number
  19. }
  20. export interface AdminVideoCommentAbuse {
  21. id: number
  22. threadId: number
  23. video: {
  24. id: number
  25. name: string
  26. uuid: string
  27. }
  28. text: string
  29. deleted: boolean
  30. }
  31. export interface AdminAbuse {
  32. id: number
  33. reason: string
  34. predefinedReasons?: AbusePredefinedReasonsString[]
  35. reporterAccount: Account
  36. flaggedAccount: Account
  37. state: VideoConstant<AbuseState>
  38. moderationComment?: string
  39. video?: AdminVideoAbuse
  40. comment?: AdminVideoCommentAbuse
  41. createdAt: Date
  42. updatedAt: Date
  43. countReportsForReporter?: number
  44. countReportsForReportee?: number
  45. countMessages: number
  46. }
  47. export type UserVideoAbuse = Omit<AdminVideoAbuse, 'countReports' | 'nthReport'>
  48. export type UserVideoCommentAbuse = AdminVideoCommentAbuse
  49. export type UserAbuse = Omit<AdminAbuse, 'reporterAccount' | 'countReportsForReportee' | 'countReportsForReporter' | 'startAt' | 'endAt'
  50. | 'count' | 'nth' | 'moderationComment'>