From eabb8dfdbda94aed2ef8f90ce9be40abe01f2107 Mon Sep 17 00:00:00 2001 From: viniciusgadea Date: Wed, 22 Jul 2026 10:51:53 -0300 Subject: [PATCH] FEAT: add CustomPropertyDto and update IUpdateDataRequest to use custom properties array --- docsfera.json | 30 +++++++++++++++++++++++++++++- src/modules/catalog/dtos/index.ts | 20 ++++++++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/docsfera.json b/docsfera.json index 83e0cac..12b36c5 100644 --- a/docsfera.json +++ b/docsfera.json @@ -11265,6 +11265,31 @@ "docs" ] }, + "CustomPropertyDto": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "text", + "number", + "date", + "boolean" + ] + } + }, + "required": [ + "key", + "value", + "type" + ] + }, "IUpdateDataRequest": { "type": "object", "properties": { @@ -11295,7 +11320,10 @@ "type": "string" }, "custom_properties": { - "type": "object" + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomPropertyDto" + } } }, "required": [ diff --git a/src/modules/catalog/dtos/index.ts b/src/modules/catalog/dtos/index.ts index 00c641b..aa2ee07 100644 --- a/src/modules/catalog/dtos/index.ts +++ b/src/modules/catalog/dtos/index.ts @@ -204,6 +204,22 @@ export class IData { } +export enum CustomPropertyType { + TEXT = 'text', + NUMBER = 'number', + DATE = 'date', + BOOLEAN = 'boolean', +} + +export class CustomPropertyDto { + @ApiProperty() + key: string; + @ApiProperty() + value: string; + @ApiProperty({ enum: CustomPropertyType }) + type: CustomPropertyType; +} + export class IUpdateDataRequest { @ApiProperty() name: string; @@ -217,8 +233,8 @@ export class IUpdateDataRequest { share_type?: DataAssetShareType; @ApiPropertyOptional() docs?: string; - @ApiPropertyOptional() - custom_properties?: Record; + @ApiPropertyOptional({ type: [CustomPropertyDto] }) + custom_properties?: CustomPropertyDto[]; } export class IUpdateCertificationStatusRequest {