Skip to content

Gate: RelationOutputDto Missing createdAt Field #1691

@nicoprow

Description

@nicoprow

Summary

The output DTO for business partner relations (RelationOutputDto) is missing the createdAt timestamp. The standard data model defines Created At as an attribute of a Business Partner Relation. The input-stage DTO (RelationDto) already carries this field correctly; the output stage does not.

Standard Reference

CX-0074 §1.5.2.5 BUSINESS PARTNER RELATION

Attribute Description Type
Created At The date and time when the business partner relation data record has been created. Date / Time
Updated At The date and time when the business partner relation data record has been last updated. Date / Time

Current State

RelationOutputDto (bpdm-gate-api/.../model/RelationOutputDto.kt) only exposes updatedAt:

data class RelationOutputDto(
    val externalId: String,
    val relationType: SharableRelationType,
    val sourceBpn: String,
    val targetBpn: String,
    val validityPeriods: Collection<RelationValidityPeriodDto>,
    val reasonCode: String?,
    val updatedAt: Instant          // ← present
    // createdAt is absent          // ← missing
)

The input-stage counterpart RelationDto correctly includes both:

data class RelationDto(
    ...
    val updatedAt: Instant,
    val createdAt: Instant          // ← present on input
)

Impact

Consumers reading the output stage to reconcile or audit relation data cannot determine when a relation was originally created. This breaks symmetry with the input stage response and deviates from the standard's data model.

Proposed Fix

Add createdAt: Instant to RelationOutputDto:

data class RelationOutputDto(
    val externalId: String,
    val relationType: SharableRelationType,
    val sourceBpn: String,
    val targetBpn: String,
    val validityPeriods: Collection<RelationValidityPeriodDto>,
    val reasonCode: String?,
    val updatedAt: Instant,
    val createdAt: Instant           // ← add this
)

The underlying database entity already persists a creation timestamp (used to populate RelationDto.createdAt), so no schema migration is needed — only the mapping layer and the DTO class require updating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    Status
    New

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions