import { IsBoolean, IsNumber, IsOptional, IsString, MinLength } from "class-validator";

/**
 * A new bank-register movement. `amount` is signed: positive = ingreso,
 * negative = egreso (the module's sign convention). The currency is the
 * account's, not the movement's — `bankAccountId` decides it.
 * Booked rows are never edited — a mistake is corrected by voiding + re-capture.
 */
export class CreateBankMovementDto {
  /** Which chequera this lands in. Required — see BankAccount in the schema. */
  @IsString() @MinLength(1) bankAccountId!: string;

  @IsNumber() amount!: number;
  @IsString() @MinLength(1) transactionDate!: string;

  @IsOptional() @IsString() concept?: string;
  @IsOptional() @IsString() reference?: string;
  @IsOptional() @IsString() transactionType?: string;
  @IsOptional() @IsBoolean() cleared?: boolean;
  @IsOptional() @IsBoolean() transferred?: boolean;
  @IsOptional() @IsString() notes?: string;
  @IsOptional() @IsString() amountInWords?: string;
}
