You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.5 KiB

  1. import { ProjectReadItem, ProjectType } from '~/domain/models/project/project'
  2. export class ProjectDTO {
  3. id: number
  4. name: string
  5. description: string
  6. guideline: string
  7. projectType: ProjectType
  8. updatedAt: string
  9. enableRandomOrder: boolean
  10. enableShareAnnotation: boolean
  11. singleClassClassification: boolean
  12. pageLink: string
  13. tags: Object[]
  14. canDefineLabel: boolean
  15. canDefineRelation: boolean
  16. isTextProject: boolean
  17. allowOverlapping: boolean
  18. graphemeMode: boolean
  19. hasCategory: boolean
  20. hasSpan: boolean
  21. constructor(item: ProjectReadItem) {
  22. this.id = item.id
  23. this.name = item.name
  24. this.description = item.description
  25. this.guideline = item.guideline
  26. this.projectType = item.project_type
  27. this.updatedAt = item.updated_at
  28. this.enableRandomOrder = item.random_order
  29. this.enableShareAnnotation = item.collaborative_annotation
  30. this.singleClassClassification = item.single_class_classification
  31. this.pageLink = item.annotationPageLink
  32. this.tags = item.tags
  33. this.canDefineLabel = item.canDefineLabel
  34. this.canDefineRelation = item.canDefineRelation
  35. this.isTextProject = item.isTextProject
  36. this.allowOverlapping = item.allow_overlapping
  37. this.graphemeMode = item.grapheme_mode
  38. this.hasCategory = item.hasCategory
  39. this.hasSpan = item.hasSpan
  40. }
  41. }
  42. export type ProjectWriteDTO = Pick<ProjectDTO, 'id' | 'name' | 'description' | 'guideline' | 'projectType' | 'enableRandomOrder' | 'enableShareAnnotation' | 'singleClassClassification' | 'allowOverlapping' | 'graphemeMode' | 'tags'>