From 4405f947de419b876903cfe3b051fe98b8c11d93 Mon Sep 17 00:00:00 2001 From: Phil Schneider Date: Fri, 12 Jan 2024 10:21:45 +0100 Subject: [PATCH] fix(registration): exclude inactive agreements (#407) when submitting agreements with endpoint /api/registration/application/{applicationId}/companyRoleAgreementConsents we only check for active agreements Refs: CPLP-3667 --- .../Repositories/CompanyRolesRepository.cs | 2 +- .../Registration.Service/Controllers/RegistrationController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/portalbackend/PortalBackend.DBAccess/Repositories/CompanyRolesRepository.cs b/src/portalbackend/PortalBackend.DBAccess/Repositories/CompanyRolesRepository.cs index f0b663c2ef..cb14ebdd94 100644 --- a/src/portalbackend/PortalBackend.DBAccess/Repositories/CompanyRolesRepository.cs +++ b/src/portalbackend/PortalBackend.DBAccess/Repositories/CompanyRolesRepository.cs @@ -65,7 +65,7 @@ public void RemoveCompanyAssignedRoles(Guid companyId, IEnumerable companyRole.CompanyRoleRegistrationData!.IsRegistrationRole && companyRoleIds.Contains(companyRole.Id)) .Select(companyRole => new ValueTuple>( companyRole.Id, - companyRole.AgreementAssignedCompanyRoles! + companyRole.AgreementAssignedCompanyRoles.Where(x => x.Agreement!.AgreementStatusId == AgreementStatusId.ACTIVE) .Select(agreementAssignedCompanyRole => new AgreementStatusData( agreementAssignedCompanyRole.AgreementId, agreementAssignedCompanyRole.Agreement!.AgreementStatusId diff --git a/src/registration/Registration.Service/Controllers/RegistrationController.cs b/src/registration/Registration.Service/Controllers/RegistrationController.cs index 49e31955a9..93dd8ba678 100644 --- a/src/registration/Registration.Service/Controllers/RegistrationController.cs +++ b/src/registration/Registration.Service/Controllers/RegistrationController.cs @@ -250,7 +250,7 @@ public Task GetCompanyDetailDataAsync([FromRoute] Guid applic /// /// Id of the application to set the company for. /// The company with its address - /// Example: Post: /api/registration/application/4f0146c6-32aa-4bb1-b844-df7e8babdcb4/companyDetailsWithAddress + /// Example: Post: /api/registration/application/{applicationId}/companyDetailsWithAddress /// Successfully set the company with its address /// A request parameter was incorrect. /// CompanyApplication was not found for the given id.