mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 17:38:12 +00:00
47 lines
1008 B
TypeScript
47 lines
1008 B
TypeScript
import { IsString, IsOptional, IsInt, IsBoolean } from 'class-validator';
|
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class CreatePromotionDto {
|
|
@ApiProperty({ example: 'SUMMER2024' })
|
|
@IsString()
|
|
code: string;
|
|
|
|
@ApiProperty({ example: 'Summer Discount' })
|
|
@IsString()
|
|
title: string;
|
|
|
|
@ApiPropertyOptional({ example: 'Get 15% off' })
|
|
@IsOptional()
|
|
@IsString()
|
|
subtitle?: string;
|
|
|
|
@ApiPropertyOptional({ example: 15 })
|
|
@IsOptional()
|
|
@IsInt()
|
|
percentOff?: number;
|
|
|
|
@ApiPropertyOptional({ example: 5000 })
|
|
@IsOptional()
|
|
@IsInt()
|
|
amountOffMinor?: number;
|
|
|
|
@ApiProperty({ example: '2026-12-31T23:59:59Z' })
|
|
@IsString()
|
|
validUntil: string;
|
|
|
|
@ApiPropertyOptional({ example: 'Book Now' })
|
|
@IsOptional()
|
|
@IsString()
|
|
ctaLabel?: string;
|
|
|
|
@ApiPropertyOptional({ example: 'edr://search' })
|
|
@IsOptional()
|
|
@IsString()
|
|
deepLink?: string;
|
|
|
|
@ApiPropertyOptional({ example: true })
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
active?: boolean;
|
|
}
|