Skip to content

TEDEFO-5239 Provide the typed attribute and the code list of each data type - #71

Merged
rousso merged 4 commits into
developfrom
feature/TEDEFO-4794-output-formatting
Oct 4, 2026
Merged

rousso merged 4 commits into
developfrom
feature/TEDEFO-4794-output-formatting

Conversation

@rousso

@rousso rousso commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

The attribute and the code list of each data type

TEDEFO-5239

To display the unit of an amount, a measure or a duration in a format block, the EFX Toolkit needs to know which attribute of a field holds the unit. For a calculated duration, which has no field, it needs the code list of its unit. Until now, it had to hard-code both.

Each SdkDataType now has:

  • getAttributeName(): the attribute that the fields of the type carry, for example currencyID for an amount;
  • getAttributeType(): the data type of that attribute, for example currency;
  • getListName(): for the four new data types currency, measurement-unit, duration-unit and language, the root code list of their values, for example timeperiod for duration-unit.

The code list of the unit of a calculated duration is therefore the list name of the type of the attribute of duration: timeperiod. For a field, the code list of its unit still comes from its attribute field in fields.json. The design is in section 6 of eForms Data Types.

The data types now follow the pattern of the other SDK entities:

  • SdkDataTypeV1 and SdkDataTypeV2 are created by SdkEntityFactory.getSdkDataType(sdkVersion, JsonNode), from an entry in the format of fields/fwd/data-types.json.
  • SdkDataTypeRepository(sdkVersion) reads them from a data-types.json resource of this library, in that format. SDK 1 has no such file, so this is where its data types come from. Reading the SDK 2 file is left to TEDEFO-5231, once it has the four new data types and the types of the attributes (TEDEFO-5238), and the masking value of duration (TEDEMD-1117).
  • createDefault() is unchanged, and deprecated.

Validation

  • New SdkDataTypeRepositoryTest: 9 tests.
  • mvn verify: all 100 tests pass, and so does the API compatibility check.

@rousso
rousso requested a review from rouschr October 3, 2026 02:13
@rousso rousso changed the title TEDEFO-5239 Provide the attribute of each data type, with the code list of its values TEDEFO-5239 Provide the typed attribute and the code list of each data type Oct 3, 2026
@rousso
rousso merged commit bc52d2e into develop Oct 4, 2026
6 checks passed
@rousso
rousso deleted the feature/TEDEFO-4794-output-formatting branch October 4, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant