feat: expand backend admin marketplace and scaling
فشلت بعض الفحوصات
/ deploy (push) Failing after 1m22s
فشلت بعض الفحوصات
/ deploy (push) Failing after 1m22s
هذا الالتزام موجود في:
@@ -1,4 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Transform } from 'class-transformer';
|
||||
import {
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
@@ -15,6 +16,7 @@ import {
|
||||
} from 'class-validator';
|
||||
import { ExperienceLevel } from '../../../common/enums/experience-level.enum';
|
||||
import { MusicRole } from '../../../common/enums/music-role.enum';
|
||||
import { toBoolean } from '../../../common/utils/query-transform.util';
|
||||
|
||||
export class CreateUserDto {
|
||||
@ApiProperty({ example: 'John Doe' })
|
||||
@@ -54,6 +56,11 @@ export class CreateUserDto {
|
||||
@IsUrl({ require_tld: false })
|
||||
avatar?: string;
|
||||
|
||||
@ApiProperty({ required: false, example: 'https://cdn.example.com/profile-cover.jpg' })
|
||||
@IsOptional()
|
||||
@IsUrl({ require_tld: false })
|
||||
coverImage?: string;
|
||||
|
||||
@ApiProperty({ required: false, example: 'Riyadh, Saudi Arabia' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@@ -76,11 +83,13 @@ export class CreateUserDto {
|
||||
|
||||
@ApiProperty({ required: false, default: false })
|
||||
@IsOptional()
|
||||
@Transform(toBoolean)
|
||||
@IsBoolean()
|
||||
isPrivate?: boolean;
|
||||
|
||||
@ApiProperty({ required: false, default: false })
|
||||
@IsOptional()
|
||||
@Transform(toBoolean)
|
||||
@IsBoolean()
|
||||
isVerified?: boolean;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Transform, Type } from 'class-transformer';
|
||||
import { IsNumber, IsOptional, IsString, IsUrl, Length, Max, Min } from 'class-validator';
|
||||
|
||||
@@ -14,7 +14,12 @@ export class ProfileSetupDto {
|
||||
@IsUrl({ require_tld: false })
|
||||
avatar?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: '<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>', maxLength: 150 })
|
||||
@ApiPropertyOptional({ example: 'https://cdn.example.com/profile-cover.jpg' })
|
||||
@IsOptional()
|
||||
@IsUrl({ require_tld: false })
|
||||
coverImage?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'Short bio about me', maxLength: 150 })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@Length(0, 150)
|
||||
|
||||
27
src/modules/users/dto/talent-discover-query.dto.ts
Normal file
27
src/modules/users/dto/talent-discover-query.dto.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Transform, Type } from 'class-transformer';
|
||||
import { IsBoolean, IsNumber, IsOptional, Max, Min } from 'class-validator';
|
||||
import { toBoolean } from '../../../common/utils/query-transform.util';
|
||||
import { UserQueryDto } from './user-query.dto';
|
||||
|
||||
export class TalentDiscoverQueryDto extends UserQueryDto {
|
||||
@ApiPropertyOptional({ default: true })
|
||||
@IsOptional()
|
||||
@Transform(toBoolean)
|
||||
@IsBoolean()
|
||||
hasAvatarOnly?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ default: true })
|
||||
@IsOptional()
|
||||
@Transform(toBoolean)
|
||||
@IsBoolean()
|
||||
includeRoleBuckets?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ minimum: 1, maximum: 24, default: 8 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
@Min(1)
|
||||
@Max(24)
|
||||
limit?: number;
|
||||
}
|
||||
@@ -1,7 +1,22 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsArray, IsBoolean, IsEnum, IsOptional, IsString, IsUrl, Length } from 'class-validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
import {
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
IsEmail,
|
||||
IsEnum,
|
||||
IsNumber,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUrl,
|
||||
Length,
|
||||
Matches,
|
||||
Max,
|
||||
Min,
|
||||
} from 'class-validator';
|
||||
import { ExperienceLevel } from '../../../common/enums/experience-level.enum';
|
||||
import { MusicRole } from '../../../common/enums/music-role.enum';
|
||||
import { toBoolean } from '../../../common/utils/query-transform.util';
|
||||
|
||||
export class UpdateUserDto {
|
||||
@ApiPropertyOptional({ example: 'John Doe' })
|
||||
@@ -10,6 +25,18 @@ export class UpdateUserDto {
|
||||
@Length(2, 80)
|
||||
name?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'artist_one' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@Length(3, 30)
|
||||
@Matches(/^[a-zA-Z0-9_.]+$/, { message: 'username can contain letters, numbers, _ and .' })
|
||||
username?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'artist@example.com' })
|
||||
@IsOptional()
|
||||
@IsEmail()
|
||||
email?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'Artist One' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@@ -27,17 +54,43 @@ export class UpdateUserDto {
|
||||
@IsUrl({ require_tld: false })
|
||||
avatar?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'https://cdn.example.com/profile-cover.jpg' })
|
||||
@IsOptional()
|
||||
@IsUrl({ require_tld: false })
|
||||
coverImage?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'Riyadh, Saudi Arabia' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@Length(0, 120)
|
||||
location?: string;
|
||||
|
||||
@ApiPropertyOptional({ required: false, example: 24.7136, minimum: -90, maximum: 90 })
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
@Min(-90)
|
||||
@Max(90)
|
||||
latitude?: number;
|
||||
|
||||
@ApiPropertyOptional({ required: false, example: 46.6753, minimum: -180, maximum: 180 })
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
@Min(-180)
|
||||
@Max(180)
|
||||
longitude?: number;
|
||||
|
||||
@ApiPropertyOptional({ default: false })
|
||||
@IsOptional()
|
||||
@Transform(toBoolean)
|
||||
@IsBoolean()
|
||||
isPrivate?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ default: false })
|
||||
@IsOptional()
|
||||
@Transform(toBoolean)
|
||||
@IsBoolean()
|
||||
isVerified?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ enum: MusicRole, isArray: true })
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsBoolean, IsOptional, IsString } from 'class-validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsBoolean, IsEnum, IsOptional, IsString } from 'class-validator';
|
||||
import { PaginationQueryDto } from '../../../common/dto/pagination-query.dto';
|
||||
import { ExperienceLevel } from '../../../common/enums/experience-level.enum';
|
||||
import { MusicRole } from '../../../common/enums/music-role.enum';
|
||||
import { toBoolean } from '../../../common/utils/query-transform.util';
|
||||
|
||||
export const USER_SORT_FIELDS = [
|
||||
'createdAt',
|
||||
'name',
|
||||
'username',
|
||||
'followersCount',
|
||||
'postsCount',
|
||||
] as const;
|
||||
|
||||
export type UserSortField = (typeof USER_SORT_FIELDS)[number];
|
||||
|
||||
export class UserQueryDto extends PaginationQueryDto {
|
||||
@ApiPropertyOptional({ description: 'Search by name or username' })
|
||||
@@ -10,6 +24,34 @@ export class UserQueryDto extends PaginationQueryDto {
|
||||
|
||||
@ApiPropertyOptional({ default: false })
|
||||
@IsOptional()
|
||||
@Transform(toBoolean)
|
||||
@IsBoolean()
|
||||
isVerified?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ enum: MusicRole })
|
||||
@IsOptional()
|
||||
@IsEnum(MusicRole)
|
||||
musicRole?: MusicRole;
|
||||
|
||||
@ApiPropertyOptional({ enum: ExperienceLevel })
|
||||
@IsOptional()
|
||||
@IsEnum(ExperienceLevel)
|
||||
experienceLevel?: ExperienceLevel;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@Transform(toBoolean)
|
||||
@IsBoolean()
|
||||
isPrivate?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Require or exclude users with avatar images' })
|
||||
@IsOptional()
|
||||
@Transform(toBoolean)
|
||||
@IsBoolean()
|
||||
hasAvatar?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ enum: USER_SORT_FIELDS, default: 'createdAt' })
|
||||
@IsOptional()
|
||||
@IsEnum(USER_SORT_FIELDS)
|
||||
sortBy?: UserSortField;
|
||||
}
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم