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.

37 lines
1.3 KiB

  1. import { ProjectReadItem, CurrentUsersRole, ProjectType } from '~/domain/models/project/project'
  2. export class ProjectDTO {
  3. id: number
  4. name: string
  5. description: string
  6. guideline: string
  7. current_users_role: CurrentUsersRole
  8. projectType: ProjectType
  9. updatedAt: string
  10. enableRandomOrder: boolean
  11. enableShareAnnotation: boolean
  12. singleClassClassification: boolean
  13. pageLink: string
  14. permitApprove: Boolean
  15. filterOption: String
  16. tags: Object[]
  17. constructor(item: ProjectReadItem) {
  18. this.id = item.id
  19. this.name = item.name
  20. this.description = item.description
  21. this.guideline = item.guideline
  22. this.current_users_role = item.current_users_role
  23. this.projectType = item.project_type
  24. this.updatedAt = item.updated_at
  25. this.enableRandomOrder = item.random_order
  26. this.enableShareAnnotation = item.collaborative_annotation
  27. this.singleClassClassification = item.single_class_classification
  28. this.pageLink = item.annotationPageLink
  29. this.permitApprove = item.permitApprove
  30. this.filterOption = item.filterOption
  31. this.tags = item.tags
  32. }
  33. }
  34. export type ProjectWriteDTO = Pick<ProjectDTO, 'id' | 'name' | 'description' | 'guideline' | 'projectType' | 'enableRandomOrder' | 'enableShareAnnotation' | 'singleClassClassification' | 'tags'>