From c8ce98347ea4be1840337b3b3c4ab0940928ed31 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sun, 24 May 2026 02:21:47 +0100 Subject: [PATCH] feat(base): allow type on /properties/update, restricted to user types --- .../src/core/base/dto/update-property.dto.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/server/src/core/base/dto/update-property.dto.ts b/apps/server/src/core/base/dto/update-property.dto.ts index 89beb4db2..bf32b453f 100644 --- a/apps/server/src/core/base/dto/update-property.dto.ts +++ b/apps/server/src/core/base/dto/update-property.dto.ts @@ -1,11 +1,15 @@ import { - IsEmpty, + IsIn, IsNotEmpty, IsObject, IsOptional, IsString, IsUUID, } from 'class-validator'; +import { + USER_PROPERTY_TYPES, + BasePropertyTypeValue, +} from '../base.schemas'; export class UpdatePropertyDto { @IsUUID() @@ -19,15 +23,9 @@ export class UpdatePropertyDto { @IsNotEmpty() name?: string; - /* - * Type changes are intentionally not exposed via the API in v1. The - * conversion engine in apps/server/src/core/base/engine/ and the - * worker in tasks/base-type-conversion.task.ts remain intact for - * a future v2 re-wire. Requests including `type` are rejected here - * so the service's type-change branches stay unreachable. - */ - @IsEmpty() - type?: string; + @IsOptional() + @IsIn(USER_PROPERTY_TYPES) + type?: BasePropertyTypeValue; @IsOptional() @IsObject()