Files
retail-nest/src/modules/sync/dto/sync-request.dto.ts
2025-10-10 16:04:10 +07:00

25 lines
856 B
TypeScript

import { IsOptional, IsDateString, IsArray, IsString } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
export class SyncRequestDto {
@ApiPropertyOptional({
description: 'Last sync timestamp (ISO 8601). Returns only changes since this time.',
example: '2025-01-15T10:30:00.000Z',
})
@IsOptional()
@IsDateString({}, { message: 'Last sync timestamp must be a valid ISO 8601 date' })
lastSyncTimestamp?: string;
@ApiPropertyOptional({
description: 'Specific entities to sync. If not provided, syncs all entities.',
example: ['products', 'categories'],
isArray: true,
type: String,
})
@IsOptional()
@IsArray({ message: 'Entities must be an array' })
@IsString({ each: true, message: 'Each entity must be a string' })
entities?: string[];
}