import { ApiProperty } from '@nestjs/swagger';
import { ProjectInfoDTO } from '../../project/dto/project-dto';
import { UserRoleDTO } from '../../user/dto/user-role-dto';
import { ProjectLicenseShortDTO } from '../../license/dto/license-dto';

export class AppLoadProjectListItemDTO {
  @ApiProperty({})
  id: string;
  @ApiProperty({})
  title: string;
  @ApiProperty({})
  shortLink: string | null;
  @ApiProperty({
    type: UserRoleDTO,
  })
  role: UserRoleDTO | null;
  @ApiProperty({
    type: ProjectLicenseShortDTO,
  })
  license: ProjectLicenseShortDTO;
}

export class AppLoadDTO {
  @ApiProperty({
    type: AppLoadProjectListItemDTO,
    isArray: true,
  })
  projects: AppLoadProjectListItemDTO[];

  @ApiProperty({
    type: ProjectInfoDTO,
  })
  project: ProjectInfoDTO | null;

  @ApiProperty({
    type: UserRoleDTO,
  })
  role: UserRoleDTO | null;

  @ApiProperty({})
  unreadNotificationsCount: number;
}
