Skip to content

Commit

Permalink
add AlternativeSubject
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammerbeck committed May 24, 2024
1 parent 3d9e43a commit 7e99b3d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task Publish(AltinnEventType type, string resourceId, string fileTr
if (partyId != null) await _partyRepository.InitializeParty(organizationId, partyId);
}
}
var cloudEvent = CreateCloudEvent(type, resourceId, fileTransferId, partyId);
var cloudEvent = CreateCloudEvent(type, resourceId, fileTransferId, partyId, organizationId);
var serializerOptions = new JsonSerializerOptions
{
PropertyNamingPolicy = new LowerCaseNamingPolicy()
Expand All @@ -53,7 +53,7 @@ public async Task Publish(AltinnEventType type, string resourceId, string fileTr
}
}

private CloudEvent CreateCloudEvent(AltinnEventType type, string resourceId, string fileTransferId, string? partyId)
private CloudEvent CreateCloudEvent(AltinnEventType type, string resourceId, string fileTransferId, string? partyId, string? alternativeSubject)
{
CloudEvent cloudEvent = new CloudEvent()
{
Expand All @@ -64,7 +64,8 @@ private CloudEvent CreateCloudEvent(AltinnEventType type, string resourceId, str
ResourceInstance = fileTransferId,
Type = "no.altinn.broker." + type.ToString().ToLowerInvariant(),
Source = _altinnOptions.PlatformGatewayUrl + "broker/api/v1/filetransfer",
Subject = !string.IsNullOrWhiteSpace(partyId) ? "/party/" + partyId : null
Subject = !string.IsNullOrWhiteSpace(partyId) ? "/party/" + partyId : null,
AlternativeSubject = !string.IsNullOrWhiteSpace(alternativeSubject) ? "/organisation/" + alternativeSubject : null,
};

return cloudEvent;
Expand Down

0 comments on commit 7e99b3d

Please sign in to comment.