import { IsEmail, IsNotEmpty, IsString, IsOptional, IsNumber, IsArray, ArrayNotEmpty, IsBoolean, IsEnum } from "class-validator";
import { ApiProperty } from '@nestjs/swagger';
import { Types } from 'mongoose';
import { Transform } from "class-transformer";

export enum type {
    MEMBERSHIP = 'MEMBERSHIP',
    SUBSCRIPTION = 'SUBSCRIPTION',
}

export class admin_staff_create {

    @ApiProperty({ default: "" })
    @IsString()
    @IsOptional()
    name: string;

    @ApiProperty({ default: "staff@qixs.ai" })
    @IsEmail({}, { message: 'Please enter valid email Address' },)
    @IsNotEmpty()
    email: string;

    @ApiProperty({ default: "qwerty" })
    @IsString()
    @IsNotEmpty()
    password: string;

    @ApiProperty({ default: "9800000000" })
    @IsString()
    @IsOptional()
    phone_no: string;

    @ApiProperty({ default: "+91" })
    @IsString()
    @IsOptional()
    country_code: string;

    @ApiProperty({ required: false, default: null })
    @IsString()
    @IsOptional()
    profile_pic: string;

    @ApiProperty()
    @IsOptional()
    @IsArray()
    module_permission: string[];
}

export class admin_staff_update {

    @ApiProperty({ default: "" })
    @IsString()
    @IsOptional()
    name: string;

    @ApiProperty({ default: "9800000000" })
    @IsString()
    @IsOptional()
    phone_no: string;

    @ApiProperty({ default: "+91" })
    @IsString()
    @IsOptional()
    country_code: string;

    @ApiProperty({ required: false, default: null })
    @IsString()
    @IsOptional()
    profile_pic: string;

    @ApiProperty()
    @IsOptional()
    @IsArray()
    module_permission: string[];
}

export class pagination_list {

    @Transform(({ value }) => parseInt(value))
    @ApiProperty({ required: false })
    @IsNumber()
    @IsOptional()
    pagination: number;

    @Transform(({ value }) => parseInt(value))
    @ApiProperty({ required: false })
    @IsNumber()
    @IsOptional()
    limit: number;

    @ApiProperty({ required: false })
    @IsOptional()
    @IsString()
    search?: string;
}


export class workspaceEdit {

    @ApiProperty({ default: null })
    @IsNotEmpty()
    image: string;

    @ApiProperty({ default: null })
    @IsNotEmpty()
    name: string;

}

export class adminData {
    user_data: any
}



export class editProfileAdmin {

    @ApiProperty()
    @IsOptional()
    @IsString()
    name: string;

    @ApiProperty()
    @IsOptional()
    @IsString()
    profile_pic: string;

}


