#879: CustomField.kt

projectforge-business/src/main/kotlin/org/projectforge/business/dvelop/CustomField.kt

Type: Kotlin class — DTO with computed logic

Purpose: Represents a single custom field instance with its value, used in the D-velop API for synchronizing entity-specific custom data (e.g., the DATEV account number on a TradingPartner).

Source path: projectforge-business/src/main/kotlin/org/projectforge/business/dvelop/CustomField.kt

40 lines · 12 code · 25 comments · 3 blank

Models a custom field value object as sent/received by the D-velop REST API. Each custom field has a configID (references a CustomFieldDef by UUID), a name, and a polymorphic value. Additional metadata like label, type, and selectOptionDtos support UI rendering. Primarily used within TradingPartner.customFields to map the DATEV account number (datevKonto) to D-velop's custom field API representation.

Properties

PropertyTypeDescription
configIDString?Constructor param — UUID of the CustomFieldDef this value belongs to
nameString?Constructor param — Name of the custom field (e.g., "datevKonto")
valueAny?Constructor param — The actual value (polymorphic, e.g., Int, String)
valueNameString?Optional display name for the value
selectOptionDtosArray<String>?Available options if the field has predefined values
labelString?Display label for UI rendering
typeType?The data type of the field (currently only NUMBER is defined)

Inner Enum: Type

ValueDescription
NUMBERThe only defined type — indicates the custom field holds a numeric value

Architecture Notes

This class mixes DTO concerns (data transfer to/from D-velop JSON API) with UI concerns (label, selectOptionDtos). The value field is typed as Any? to support polymorphic deserialization. The companion enum Type is minimal as of this version — only NUMBER is needed for the Datev account use case.

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
b6092df09 Copyright 2023 -> 2024
cb2915283 WIP D.velop
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5f7ef41b8 Copyright 2021 -> 2022
ceb63e8a1 Source code header: (C) 2001-2021.
7c79f1922 Copyright of source header -> 2020.
dd5ca38ac CopyRight of all java file-header updated or created.
9ebb88522 Initial commit