Skip to content

Commit

Permalink
Merge branch 'main' into merge-main-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil91 committed Jan 18, 2024
2 parents f9e606f + eb6e7d6 commit 8d35ebe
Show file tree
Hide file tree
Showing 8 changed files with 355 additions and 142 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

New features, fixed bugs, known defects and other noteworthy changes to each release of the Catena-X Portal Backend.

## 1.8.0-RC2

### Bugfix
* Notification Service
* fixed Get: /api/notification/ endpoint which resulted in a 'Sequence contains more than one element' error
* Registration Service
* fixed Put: /api/registration/application/{applicationId}/status endpoint to allow same status as existing status

## 1.8.0-RC1.1

### Bugfix
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.8.0</VersionPrefix>
<VersionSuffix>RC1.1</VersionSuffix>
<VersionSuffix>RC2</VersionSuffix>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Notification DeleteNotification(Guid notificationId) =>
_dbContext.Notifications.AsNoTracking()
.Where(notification =>
notification.ReceiverUserId == receiverUserId &&
semantic == SearchSemanticTypeId.AND
(semantic == SearchSemanticTypeId.AND
? ((!isRead.HasValue || notification.IsRead == isRead.Value) &&
(!typeId.HasValue || notification.NotificationTypeId == typeId.Value) &&
(!topicId.HasValue || notification.NotificationType!.NotificationTypeAssignedTopic!.NotificationTopicId == topicId.Value) &&
Expand All @@ -93,7 +93,7 @@ public Notification DeleteNotification(Guid notificationId) =>
(onlyDueDate && notification.DueDate.HasValue) ||
(doneState.HasValue && notification.Done == doneState.Value) ||
(searchTypeIds.Any() && searchTypeIds.Contains(notification.NotificationTypeId)) ||
(searchQuery != null && notification.Content != null && EF.Functions.ILike(notification.Content, $"%{searchQuery.EscapeForILike()}%"))))
(searchQuery != null && notification.Content != null && EF.Functions.ILike(notification.Content, $"%{searchQuery.EscapeForILike()}%")))))
.GroupBy(notification => notification.ReceiverUserId),
sorting switch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,13 @@ public async Task<int> SetOwnCompanyApplicationStatusAsync(Guid applicationId, C
throw new NotFoundException($"CompanyApplication {applicationId} not found");
}

ValidateCompanyApplicationStatus(applicationId, status, applicationUserData, applicationRepository, _dateTimeProvider);
if (applicationUserData.StatusId != status)
{
ValidateCompanyApplicationStatus(applicationId, status, applicationUserData, applicationRepository, _dateTimeProvider);
return await _portalRepositories.SaveAsync().ConfigureAwait(false);
}

return await _portalRepositories.SaveAsync().ConfigureAwait(false);
return 0;
}

public async Task<CompanyApplicationStatusId> GetOwnCompanyApplicationStatusAsync(Guid applicationId)
Expand Down Expand Up @@ -820,7 +824,7 @@ private static void ValidateCompanyApplicationStatus(Guid applicationId,
x => x.applicationStatus == applicationData.StatusId && x.status == status))
{
throw new ArgumentException(
$"invalid status update requested {status}, current status is {applicationData.StatusId}, possible values are: {CompanyApplicationStatusId.SUBMITTED}");
$"invalid status update requested {status}, current status is {applicationData.StatusId}, possible values are: {string.Join(",", allowedCombination.Where(x => x.applicationStatus == status).Select(x => x.applicationStatus))}");
}

applicationRepository.AttachAndModifyCompanyApplication(applicationId, a =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public Task<IEnumerable<CompanyApplicationDeclineData>> GetApplicationsDeclineDa
/// <param name="applicationId" example="4f0146c6-32aa-4bb1-b844-df7e8babdcb4">Id of the application which status should be set.</param>
/// <param name="status" example="8">The status that should be set</param>
/// <returns></returns>
/// <remarks>Example: Put: /api/registration/application/4f0146c6-32aa-4bb1-b844-df7e8babdcb4/status</remarks>
/// <remarks>Example: Put: /api/registration/application/{applicationId}/status</remarks>
/// <response code="200">Successfully set the status</response>
/// <response code="404">CompanyApplication was not found for the given id.</response>
/// <response code="400">Status must be null.</response>
Expand Down
Loading

0 comments on commit 8d35ebe

Please sign in to comment.