2024-04-16 07:26:37 +02:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
|
import { IsInt, IsPositive } from 'class-validator';
|
|
|
|
|
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
|
|
|
|
|
import { ValidateDate, ValidateUUID } from 'src/validation';
|
|
|
|
|
|
|
|
|
|
export class AssetFullSyncDto {
|
|
|
|
|
@ValidateUUID({ optional: true })
|
|
|
|
|
lastId?: string;
|
|
|
|
|
|
|
|
|
|
@ValidateDate()
|
|
|
|
|
updatedUntil!: Date;
|
|
|
|
|
|
|
|
|
|
@IsInt()
|
|
|
|
|
@IsPositive()
|
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
limit!: number;
|
|
|
|
|
|
|
|
|
|
@ValidateUUID({ optional: true })
|
|
|
|
|
userId?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class AssetDeltaSyncDto {
|
|
|
|
|
@ValidateDate()
|
|
|
|
|
updatedAfter!: Date;
|
2024-04-29 05:24:21 +02:00
|
|
|
|
2024-04-16 07:26:37 +02:00
|
|
|
@ValidateUUID({ each: true })
|
|
|
|
|
userIds!: string[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class AssetDeltaSyncResponseDto {
|
|
|
|
|
needsFullSync!: boolean;
|
|
|
|
|
upserted!: AssetResponseDto[];
|
|
|
|
|
deleted!: string[];
|
|
|
|
|
}
|