diff --git a/docs/api/services-service.yaml b/docs/api/services-service.yaml index 38bd9055e4..fc508d2bfa 100644 --- a/docs/api/services-service.yaml +++ b/docs/api/services-service.yaml @@ -2396,6 +2396,10 @@ components: price: type: string description: Pricing information of the app. + providerUri: + type: string + description: Provider's homepage url or marketing url + nullable: true offerSubscriptionDetailData: type: array items: diff --git a/src/marketplace/Services.Service/BusinessLogic/ServiceBusinessLogic.cs b/src/marketplace/Services.Service/BusinessLogic/ServiceBusinessLogic.cs index 3d21cb8ea3..3d982e6132 100644 --- a/src/marketplace/Services.Service/BusinessLogic/ServiceBusinessLogic.cs +++ b/src/marketplace/Services.Service/BusinessLogic/ServiceBusinessLogic.cs @@ -99,6 +99,7 @@ public async Task GetServiceDetailsAsync(Guid serviceId, result.Description, result.LicenseTypeId, result.Price, + result.ProviderUri, result.OfferSubscriptionDetailData, result.ServiceTypeIds, result.Documents.GroupBy(doc => doc.DocumentTypeId).ToDictionary(d => d.Key, d => d.Select(x => new DocumentData(x.DocumentId, x.DocumentName))), diff --git a/src/marketplace/Services.Service/ViewModels/ServiceDetailResponse.cs b/src/marketplace/Services.Service/ViewModels/ServiceDetailResponse.cs index 5d58306b09..acc9563f56 100644 --- a/src/marketplace/Services.Service/ViewModels/ServiceDetailResponse.cs +++ b/src/marketplace/Services.Service/ViewModels/ServiceDetailResponse.cs @@ -34,6 +34,7 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Services.Service.ViewModels; /// The description of the service. /// LicenseType for offer /// Pricing information of the app. +/// Provider's homepage url or marketing url /// Detail Data of the offer subscription /// Collection of the assigned serviceTypeIds. /// documents assigned to offer @@ -48,6 +49,7 @@ public record ServiceDetailResponse( string? Description, LicenseTypeId LicenseType, string Price, + string? ProviderUri, IEnumerable OfferSubscriptionDetailData, IEnumerable ServiceTypes, IDictionary> Documents, diff --git a/src/portalbackend/PortalBackend.DBAccess/Models/OfferDetailData.cs b/src/portalbackend/PortalBackend.DBAccess/Models/OfferDetailData.cs index 7df8446477..63b1b9395f 100644 --- a/src/portalbackend/PortalBackend.DBAccess/Models/OfferDetailData.cs +++ b/src/portalbackend/PortalBackend.DBAccess/Models/OfferDetailData.cs @@ -51,6 +51,7 @@ public record OfferDetailData( /// Contact email address. /// The description of the service. /// Pricing information of the app. +/// Provider's homepage url or marketing url /// Detail Data of the offer subscription /// Collection of the assigned serviceTypeIds. /// Collections of the Document type Data. @@ -64,6 +65,7 @@ public record ServiceDetailData( string? ContactEmail, string? Description, string Price, + string? ProviderUri, IEnumerable OfferSubscriptionDetailData, IEnumerable ServiceTypeIds, IEnumerable Documents, diff --git a/src/portalbackend/PortalBackend.DBAccess/Repositories/OfferRepository.cs b/src/portalbackend/PortalBackend.DBAccess/Repositories/OfferRepository.cs index 350e0fdc56..c64f838efb 100644 --- a/src/portalbackend/PortalBackend.DBAccess/Repositories/OfferRepository.cs +++ b/src/portalbackend/PortalBackend.DBAccess/Repositories/OfferRepository.cs @@ -278,6 +278,7 @@ public void RemoveAppLanguages(IEnumerable<(Guid appId, string languageShortName offer.ContactEmail, offer.OfferDescriptions.SingleOrDefault(d => d.LanguageShortName == languageShortName)!.DescriptionLong, offer.OfferLicenses.FirstOrDefault()!.Licensetext, + offer.MarketingUrl, offer.OfferSubscriptions .Where(os => os.CompanyId == userCompanyId) .Select(x => new OfferSubscriptionStateDetailData(x.Id, x.OfferSubscriptionStatusId)), diff --git a/tests/marketplace/Services.Service.Tests/BusinessLogic/ServiceBusinessLogicTests.cs b/tests/marketplace/Services.Service.Tests/BusinessLogic/ServiceBusinessLogicTests.cs index 3a56adbdc1..bc08ba4b3c 100644 --- a/tests/marketplace/Services.Service.Tests/BusinessLogic/ServiceBusinessLogicTests.cs +++ b/tests/marketplace/Services.Service.Tests/BusinessLogic/ServiceBusinessLogicTests.cs @@ -295,6 +295,7 @@ public async Task GetServiceDetailsAsync_WithExistingServiceAndLanguageCode_Retu result.TechnicalUserProfile.Should().ContainSingle().Which.Should().Match>>( x => x.Value.SequenceEqual(new[] { "role1", "role2" })); result.LeadPictureId.Should().NotBeEmpty(); + result.ProviderUri.Should().NotBeEmpty(); } [Fact] diff --git a/tests/portalbackend/PortalBackend.DBAccess.Tests/OfferRepositoryTests.cs b/tests/portalbackend/PortalBackend.DBAccess.Tests/OfferRepositoryTests.cs index 516e08e59e..37a8cad302 100644 --- a/tests/portalbackend/PortalBackend.DBAccess.Tests/OfferRepositoryTests.cs +++ b/tests/portalbackend/PortalBackend.DBAccess.Tests/OfferRepositoryTests.cs @@ -450,6 +450,7 @@ public async Task GetServiceDetailByIdUntrackedAsync_ReturnsExpectedResult() x => technicalUserRoleDatas.Single(t => t.TechnicalUserProfileId == x.TechnicalUserProfileId).UserRoles.Count() == 1, x => technicalUserRoleDatas.Single(t => t.TechnicalUserProfileId == x.TechnicalUserProfileId).UserRoles.Count() == 2); offerDetail.LeadPictureId.Should().Be(new Guid("9685f744-9d90-4102-a949-fcd0bb86f951")); + offerDetail.ProviderUri.Should().Be("https://google.com"); } #endregion diff --git a/tests/portalbackend/PortalBackend.DBAccess.Tests/Seeder/Data/offers.unittest.json b/tests/portalbackend/PortalBackend.DBAccess.Tests/Seeder/Data/offers.unittest.json index fc7e53aab8..4899b0b78c 100644 --- a/tests/portalbackend/PortalBackend.DBAccess.Tests/Seeder/Data/offers.unittest.json +++ b/tests/portalbackend/PortalBackend.DBAccess.Tests/Seeder/Data/offers.unittest.json @@ -36,7 +36,7 @@ "name": "Consulting Service - Data Readiness", "date_created": "2023-01-01 00:00:00.000000 +00:00", "date_released": "2023-01-01 00:00:00.000001 +00:00", - "marketing_url": null, + "marketing_url": "https://google.com", "contact_email": null, "contact_number": "0000", "provider_company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",