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>
61 lines
944 B
TypeScript
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;
|
|
}
|