import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsIn, IsOptional, IsString, MinLength } from 'class-validator';

export class SignContractDto {
  @ApiProperty({ enum: ['CUSTOMER', 'STAFF'] })
  @IsIn(['CUSTOMER', 'STAFF'])
  role!: 'CUSTOMER' | 'STAFF';

  @ApiProperty({ description: 'PNG signature image as base64 (with or without data URL prefix)' })
  @IsString()
  @MinLength(20)
  signatureImageBase64!: string;

  @ApiProperty()
  @IsString()
  @MinLength(1)
  signerDisplayName!: string;

  @ApiPropertyOptional()
  @IsOptional()
  @IsString()
  consentText?: string;
}
