62 lines
1.2 KiB
TypeScript
62 lines
1.2 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import {
|
|
IsInt,
|
|
IsNotEmpty,
|
|
IsNumber,
|
|
IsOptional,
|
|
IsString,
|
|
Matches,
|
|
Min,
|
|
} from 'class-validator';
|
|
import {
|
|
ZONA_HORA_DEFAULT,
|
|
ZONA_HORA_RE,
|
|
} from '../../../common/utils/zona-horaria.js';
|
|
|
|
export class ConfiguracionDto {
|
|
@ApiProperty()
|
|
@IsNumber()
|
|
@IsNotEmpty()
|
|
lat: number;
|
|
|
|
@ApiProperty()
|
|
@IsNumber()
|
|
@IsNotEmpty()
|
|
lng: number;
|
|
|
|
@ApiProperty()
|
|
@IsNumber()
|
|
@IsNotEmpty()
|
|
distancia: number;
|
|
|
|
@ApiProperty({
|
|
required: false,
|
|
default: 0,
|
|
description:
|
|
'Minutos de tolerancia tras la hora límite de ingreso (Atrasado).',
|
|
example: 10,
|
|
})
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(0)
|
|
tolerancia?: number;
|
|
|
|
@ApiProperty({
|
|
required: false,
|
|
default: ZONA_HORA_DEFAULT,
|
|
description:
|
|
'Offset UTC de la organización para calcular Atrasados (±HH:MM).',
|
|
example: '-04:00',
|
|
})
|
|
@IsOptional()
|
|
@IsString()
|
|
@Matches(ZONA_HORA_RE, {
|
|
message: 'Zona horaria inválida (use ±HH:MM, p. ej. -04:00).',
|
|
})
|
|
zonaHoraria?: string;
|
|
|
|
@ApiProperty({ required: false, description: 'SessionId de OpenWA' })
|
|
@IsString()
|
|
@IsOptional()
|
|
openwaSessionId?: string;
|
|
}
|