/me
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user