import { ApiProperty } from "@nestjs/swagger";
import { IsArray, IsEnum, IsNumber, IsString } from "class-validator";
import { Types } from "mongoose";
enum plan_intervel {
    day = 'day',
    month = 'month',
    week = 'week',
    year = 'year'
}

enum plan_name {
    BASIC_PLAN = 'BASIC_PLAN',
    STANDERED_PLAN = 'STANDERED_PLAN',
    PREMIUM_PLAN = 'PREMIUM_PLAN',
}

enum plan_currency {
    usd = 'usd',
}


export class plan {
    @ApiProperty()
    @IsNumber()
    amount: number;

    @ApiProperty({ enum: Object.values(plan_intervel), default: plan_intervel.month })
    @IsString()
    @IsEnum(plan_intervel)
    interval: string;

    @ApiProperty({ required: false })
    @IsNumber()
    interval_count: Number;

    @ApiProperty({ enum: Object.values(plan_name), default: plan_name.BASIC_PLAN })
    @IsEnum(plan_name)
    @IsString()
    name: string;

    @ApiProperty()
    @IsString()
    description: string;

    @ApiProperty({ enum: Object.values(plan_currency), default: plan_currency.usd })
    @IsString()
    @IsEnum(plan_currency)
    currency: string;


    @ApiProperty({ required:false })
    @IsArray()
    highlights: string[];
}


export class subscription {
    @ApiProperty()
    @IsString()
    plan_id: string;

    @ApiProperty()
    @IsString()
    payment_method_id: string;

}

export class upgradeSubscription {
    @ApiProperty()
    @IsString()
    plan_id: string;

    // @ApiProperty()
    // @IsString()
    // subscription_id: string;

}
