import { ApiProperty } from "@nestjs/swagger";
import { IsEnum, IsString } from "class-validator";
import { type } from "os";

enum PlanType {
	Standard = 'beginer',
	standard = 'standard',
	premium = 'premium',
}

enum PaymentType {
	Monthly = 'monthly',
	Yearly = 'yearly'
}

class PaymentDto {
	// name card number exp_month exp_year id number
	@ApiProperty({ example: 'John Doe', required: true, description: 'name' })
	@IsString()
	name: string;

	@ApiProperty({ example: '4580000000000000', required: true, description: 'card number' })
	@IsString()
	card_number: string;

	@ApiProperty({ example: '10', required: true, description: 'exp_month' })
	@IsString()
	exp_month: string;

	@ApiProperty({ example: '2026', required: true, description: 'exp_year' })
	@IsString()
	exp_year: string;

	@ApiProperty({ example: '4242424242424242', required: true, description: 'id number' })
	@IsString()
	socialId: string;

	@ApiProperty({ example: '123', required: true, description: 'number' })
	@IsString()
	cvv: string;
}

export class CreatePaymentLinkDto {
	@ApiProperty({ example: 'premium', required: true, description: 'type' })
	@IsEnum(PlanType, { message: 'Type must be either "premium or standard or beginer"' })
	plan: PlanType;

	@ApiProperty({ example: 'monthly', required: true, description: 'type' })
	@IsEnum(PaymentType, { message: 'Type must be either "monthly or yearly"' })
	type: PaymentType;

	@ApiProperty({ example: { name: 'John Doe', card_number: '4557430402053431', exp_month: '12', exp_year: '2025', socialId: '008336174', cvv: '200' }, required: true, description: 'payment' })
	payment: PaymentDto;
}



