Files
crm/apps/api/src/loyalty/dto.ts
T
MahdiandCursor c2bfa7749d Add project board, loyalty club, and if/then automations.
Separate modules for post-sales kanban, person points/tiers, and deal-won/ticket-resolved rules without overlapping the sales pipeline.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-30 09:42:07 +03:30

61 lines
944 B
TypeScript

import { Type } from 'class-transformer';
import {
IsInt,
IsNumber,
IsOptional,
IsString,
MaxLength,
Min,
MinLength,
ValidateIf,
} from 'class-validator';
export class CreateLoyaltyTierDto {
@IsString()
@MinLength(2)
@MaxLength(80)
name!: string;
@Type(() => Number)
@IsInt()
@Min(0)
minPoints!: number;
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsString()
@MaxLength(32)
color?: string | null;
}
export class UpdateLoyaltyTierDto {
@IsOptional()
@IsString()
@MinLength(2)
@MaxLength(80)
name?: string;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(0)
minPoints?: number;
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsString()
@MaxLength(32)
color?: string | null;
}
export class AdjustLoyaltyPointsDto {
@Type(() => Number)
@IsNumber()
delta!: number;
@IsOptional()
@IsString()
@MaxLength(200)
reason?: string;
}