Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The **need for configuration updates** is **marked bold**.
- Refactor usage of direction-characteristics ([#1128](https://github.com/eclipse-tractusx/puris/pull/1128))
- Remove demonstrator data injection via command line runner ([#1132](https://github.com/eclipse-tractusx/puris/pull/1132))
- Updated table row height and selection behavior ([#1135](https://github.com/eclipse-tractusx/puris/pull/1135))
- Updated UUID so it also supports URN format ([#1196](https://github.com/eclipse-tractusx/puris/pull/1196))

### Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class DataExchangeRequestDto implements Serializable {
private String requestId;

@NotNull
private UUID notificationId;
private String notificationId;

@NotNull
private CriticalityEnumeration criticality;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class DataExchangeRequestSamm {

@NotNull
@Pattern(regexp = PatternStore.URN_OR_UUID_STRING)
private UUID sourceDisruptionId;
private String sourceDisruptionId;

@NotNull
private CriticalityEnumeration criticality;
Expand All @@ -72,7 +72,7 @@ public class DataExchangeRequestSamm {
@JsonCreator
public DataExchangeRequestSamm(
@JsonProperty(value = "requestId") String requestId,
@JsonProperty(value = "sourceDisruptionId") UUID sourceDisruptionId,
@JsonProperty(value = "sourceDisruptionId") String sourceDisruptionId,
@JsonProperty(value = "criticality") CriticalityEnumeration criticality,
@JsonProperty(value = "desiredStartDateTime") Date desiredStartDateTime,
@JsonProperty(value = "desiredEndDateTime") Date desiredEndDateTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ public abstract class DemandAndCapacityNotification {
@Id
@GeneratedValue
protected UUID uuid;
protected UUID notificationId;
@Pattern(regexp = PatternStore.URN_OR_UUID_STRING)
protected String notificationId;

@ElementCollection
@CollectionTable(
name = "notification_related_notification_ids",
joinColumns = @JoinColumn(name = "notification_uuid")
)
@Column(name = "related_notification_id")
protected List<UUID> relatedNotificationIds;
protected List<@Pattern(regexp = PatternStore.URN_OR_UUID_STRING) String> relatedNotificationIds;

protected UUID sourceDisruptionId;
@Pattern(regexp = PatternStore.URN_OR_UUID_STRING)
protected String sourceDisruptionId;

@ManyToOne()
@JoinColumn(name = "partner_uuid")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ See the NOTICE file(s) distributed with this work for additional

@NoRepositoryBean
public interface DemandAndCapacityNotificationRepository<TEntity extends DemandAndCapacityNotification> extends JpaRepository<TEntity, UUID> {
Optional<TEntity> findByPartnerBpnlAndSourceDisruptionId(String bpnl, UUID sourceDisruptionId);
Optional<TEntity> findByPartnerBpnlAndSourceDisruptionId(String bpnl, String sourceDisruptionId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ public ReportedDemandAndCapacityNotification sammToReportedDemandAndCapacityNoti
.filter(site -> samm.getAffectedSitesRecipient().contains(site.getBpns()))
.collect(Collectors.toList());
var notification = builder
.notificationId(UUID.fromString(samm.getNotificationId()))
.relatedNotificationIds(samm.getRelatedNotificationIds() != null ? samm.getRelatedNotificationIds().stream().map(id -> UUID.fromString(id)).toList() : null)
.sourceDisruptionId(samm.getSourceDisruptionId() != null ? UUID.fromString(samm.getSourceDisruptionId()) : null)
.notificationId(samm.getNotificationId())
.relatedNotificationIds(samm.getRelatedNotificationIds() != null ? samm.getRelatedNotificationIds().stream().map(id -> id).toList() : null)
.sourceDisruptionId(samm.getSourceDisruptionId() != null ? samm.getSourceDisruptionId() : null)
.text(samm.getText())
.resolvingMeasureDescription(samm.getResolvingMeasureDescription())
.leadingRootCause(samm.getLeadingRootCause())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ See the NOTICE file(s) distributed with this work for additional
@ToString
public class DemandAndCapacityNotificationDto implements Serializable {
private UUID uuid;
private UUID notificationId;

private List<UUID> relatedNotificationIds;
@Pattern(regexp = PatternStore.URN_OR_UUID_STRING)
private String notificationId;

private UUID sourceDisruptionId;
private List<@Pattern(regexp = PatternStore.URN_OR_UUID_STRING) String> relatedNotificationIds;

@Pattern(regexp = PatternStore.URN_OR_UUID_STRING)
private String sourceDisruptionId;

@Pattern(regexp = PatternStore.BPNL_STRING)
private String partnerBpnl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final TEntity findById(UUID uuid) {
return repository.findById(uuid).orElse(null);
}

public final TEntity findByNotificationId(UUID notificationId) {
public final TEntity findByNotificationId(String notificationId) {
return repository.findAll().stream().filter(notification -> notification.getNotificationId().equals(notificationId))
.findFirst().orElse(null);
}
Expand All @@ -64,7 +64,7 @@ public final List<TEntity> findAllByBpnl(String bpnl) {
.toList();
}

public final TEntity findByBpnlAndSourceDisruptionId(String bpnl, UUID sourceDisruptionId) {
public final TEntity findByBpnlAndSourceDisruptionId(String bpnl, String sourceDisruptionId) {
return repository.findByPartnerBpnlAndSourceDisruptionId(bpnl, sourceDisruptionId).orElse(null);
}

Expand All @@ -76,10 +76,10 @@ public final TEntity create(TEntity notification) {
throw new KeyAlreadyExistsException("Notification already exists");
}
if (notification.getNotificationId() == null) {
notification.setNotificationId(UUID.randomUUID());
notification.setNotificationId(UUID.randomUUID().toString());
}
if (notification.getSourceDisruptionId() == null) {
notification.setSourceDisruptionId(UUID.randomUUID());
notification.setSourceDisruptionId(UUID.randomUUID().toString());
}
notification.setContentChangedAt(new Date());
return repository.save(notification);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ public class ItemStockResponseDto {
@ToString
public static class HeaderDto {
@NotNull
private UUID messageId;
@Pattern(regexp = PatternStore.URN_OR_UUID_STRING)
private String messageId;
@NotNull
private UUID relatedMessageId;
@Pattern(regexp = PatternStore.URN_OR_UUID_STRING)
private String relatedMessageId;
@NotNull
@Pattern(regexp = PatternStore.NON_EMPTY_NON_VERTICAL_WHITESPACE_STRING)
private String context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,27 @@ databaseChangeLog:
referencedTableName: own_data_exchange_request
referencedColumnNames: uuid
constraintName: fk_reported_data_exchange_approval_data_exchange_request
- changeSet:
id: "6"
author: ruzicam
changes:
- modifyDataType:
tableName: notification_related_notification_ids
columnName: related_notification_id
newDataType: VARCHAR(255)
- modifyDataType:
tableName: own_demand_and_capacity_notification
columnName: notification_id
newDataType: VARCHAR(255)
- modifyDataType:
tableName: own_demand_and_capacity_notification
columnName: source_disruption_id
newDataType: VARCHAR(255)
- modifyDataType:
tableName: reported_demand_and_capacity_notification
columnName: notification_id
newDataType: VARCHAR(255)
- modifyDataType:
tableName: reported_demand_and_capacity_notification
columnName: source_disruption_id
newDataType: VARCHAR(255)
Loading
Loading