Skip to content

High performance self-hosted photo and video management solution.

819 B
Raw Blame
import { ApiProperty } from '@nestjs/swagger';
import { createZodDto } from 'nestjs-zod';
import z from 'zod';
import { UploadFieldName } from 'src/dtos/asset-media.dto.js';
import { isoDatetimeToDate } from 'src/validation.js';

export class CreateProfileImageDto {
  @ApiProperty({ type: 'string', format: 'binary', description: 'Profile image file' })
  [UploadFieldName.PROFILE_DATA]!: Express.Multer.File;
}

const CreateProfileImageResponseSchema = z
  .object({
    userId: z.uuidv4().describe('User ID'),
    profileChangedAt: isoDatetimeToDate.describe('Profile image change date'),
    profileImagePath: z.string().describe('Profile image file path'),
  })
  .meta({ id: 'CreateProfileImageResponseDto' });

export class CreateProfileImageResponseDto extends createZodDto(CreateProfileImageResponseSchema) {}