44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { Salon } from '../../salons/entities/salon.entity';
|
|
import { SalonSubscription } from '../../subscriptions/entities/salon-subscription.entity';
|
|
import { UserRole } from '../../users/enums/user-role.enum';
|
|
|
|
class MeUserResponseDto {
|
|
@ApiProperty({ format: 'uuid' })
|
|
id: string;
|
|
|
|
@ApiProperty()
|
|
firstName: string;
|
|
|
|
@ApiProperty()
|
|
lastName: string;
|
|
|
|
@ApiProperty()
|
|
mobile: string;
|
|
|
|
@ApiProperty({ enum: UserRole })
|
|
role: UserRole;
|
|
|
|
@ApiPropertyOptional({ nullable: true })
|
|
avatarUrl?: string | null;
|
|
}
|
|
|
|
export class MeResponseDto {
|
|
@ApiProperty({ type: MeUserResponseDto })
|
|
user: MeUserResponseDto;
|
|
|
|
@ApiPropertyOptional({
|
|
type: Salon,
|
|
isArray: true,
|
|
description: 'Present for salon owners',
|
|
})
|
|
salons?: Salon[];
|
|
|
|
@ApiPropertyOptional({
|
|
type: SalonSubscription,
|
|
nullable: true,
|
|
description: 'Active subscription for salon owners, null if none',
|
|
})
|
|
activeSubscription?: SalonSubscription | null;
|
|
}
|