mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +00:00
refactor booking priority logic and constants; adjust scoring thresholds and remove unused service types
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsBoolean, IsIn, IsInt, IsOptional, IsString, MaxLength, Min } from 'class-validator';
|
||||
import { IsBoolean, IsIn, IsInt, IsOptional, IsString, Max, MaxLength, Min } from 'class-validator';
|
||||
|
||||
export class CreatePriorityConfigDto {
|
||||
@ApiProperty({ description: 'Config type: WAGON or CURRENCY', enum: ['WAGON', 'CURRENCY'] })
|
||||
@@ -30,9 +30,15 @@ export class CreatePriorityConfigDto {
|
||||
@Min(0)
|
||||
maxWagonCount!: number;
|
||||
|
||||
@ApiProperty({ description: 'Points awarded when booking matches this rule', default: 0 })
|
||||
@ApiProperty({
|
||||
description:
|
||||
'Points awarded when booking matches this rule. Capped so the priority blocks sum to ≤ 100 alongside the service-type bonus (service ≤ 15 + wagon ≤ 50 + currency ≤ 35). WAGON configs should not exceed 50; CURRENCY configs should not exceed 35.',
|
||||
default: 0,
|
||||
maximum: 50,
|
||||
})
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(50)
|
||||
scorePoints!: number;
|
||||
|
||||
@ApiPropertyOptional({ default: false, description: 'Feature flag — toggle without code deploy' })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsBoolean, IsInt, IsOptional, IsString, IsUUID, MaxLength, Min } from 'class-validator';
|
||||
import { IsBoolean, IsInt, IsOptional, IsString, IsUUID, Max, MaxLength, Min } from 'class-validator';
|
||||
|
||||
export class CreateServiceTypeDto {
|
||||
@ApiProperty({ description: 'Service type display name', maxLength: 255 })
|
||||
@@ -32,10 +32,15 @@ export class CreateServiceTypeDto {
|
||||
@IsBoolean()
|
||||
includesCustoms?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Priority bonus points awarded when this service is used', default: 0 })
|
||||
@ApiPropertyOptional({
|
||||
description: 'Priority bonus points awarded when this service is used (0–15)',
|
||||
default: 0,
|
||||
maximum: 15,
|
||||
})
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(15)
|
||||
priorityBonusPoints?: number;
|
||||
|
||||
@ApiPropertyOptional({ default: true })
|
||||
|
||||
Reference in New Issue
Block a user