Skip to content

Predecessor Relation Type For Addresses #1561

@nicoprow

Description

@nicoprow

Description

As a dataspace participant I want to see the relations between golden record addresses. At the moment it is only possible to see relations between legal entities, but addresses can also be in a relation. Addresses should have their own set of relation types which may or may not include relation types of legal entity relations.

Technical Considerations

The implementaiton of this feature can be divided into two aspects:

  • Implementing a new relation type
  • Implementing golden record process for relations between addresses

For this, all BPDM apps need to be adapted:

Gate

New relation type

The Gate API and service logic now has a new relation type 'IsReplaceBy'. Relations of that type can be upserted and searched like any other relation type.

New output fields

At the moment relation outputs have the fields 'sourceBpnL' and 'targetBpnL'. However, for the new address relations we want to know the actual BPNAs instead. Since currently these fields are unused we will rename as 'sourceBpn' and 'targetBpn' (on DTO and database level). These generic BPN fields will contain the BPNLs if its a relation between legal entities and BPNAs if its a relation between addresses.

The name change will be technical a breaking change but with no impact as these fields are unused. The breaking change should be explained as a patch to rectify incorrect DTO field names. The name change, the impact and the reason should be noted in the migration guide. Also, the name change should be marked as breaking in the Changelog documentation.

New Sharing Validations

Current relation sharing logic:
For each relation ready to be shared it is checked whether there exists already BPNLs inthe output stage for the relation's source and target. If it exists, a new golden record relation task is created in the Orchestrator with these BPNLs and the relation type. If it not exists, we skip the sharing for that relation and try again next check.

New relatiopn sharing logic:
For each relation ready to be shared the Gate checks whether there exists already output s for the relation's sources and target. If it not exists yet, skip the sharing and try again next check. If it exists perform a validation over the source and target's address types and the relation type. Based on the address types and the relation type we determine what kind of relation golden record task we need to create:

  • Both legal addresses & relation type either (IsAlternativeHeadquarterFor | IsOwned by | IsManagedBy) -> Legal Entity Relation Golden Record Task
  • One additional address & one legal address & relation type IsReplacedBy -> Address Relation Golden Record Task
  • else -> appropriate sharing state error message about unsupported relation type

Orchestrator

New relation type

The relaton golden record tasks now can have a new relation type of 'IsReplacedBy'

New task fields

Relation golden record tasks have the two fields 'sourceBpnL' and 'targetBpnL' be renamed as 'sourceBpn', 'targetBpn'.

Same explanation and things to do as with the gate.

Pool

New relations

The Pool now needs to support new address relations.
They require a separate DB object as well as DTOs.
Addresses will now have a new 'relations' field that reference these objects analogous to how legal entities do it.
The only valid type of these new address relations is 'IsReplacedBy'

General relation task processing logic

Currently, the pool assumes that every relation golden record task is for legal entities.
We need to add a service logic before the legal entity relation processing which decides whether to process the golden record task as address relation or legal entity. This will be done based on the golden record type.

In this service logic we can also apply general validations like self reference check and the validation of validity periods.

Address relation task processing logic

The Pool needs new service logic to process address relation golden record tasks.
The service logic should be analogous to the legal entity relation golden record task logic.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions