Skip to content

Commit

Permalink
fix(providerHomepage): responding providerUrl for service (#1126)
Browse files Browse the repository at this point in the history
* fix(providerHomepage): responding providerUrl for service
* tests updates
* test setup data file
Ref: #1125
  • Loading branch information
tfjanjua authored Nov 14, 2024
1 parent 4691c3e commit 28fb429
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/api/services-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public async Task<ServiceDetailResponse> 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))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Services.Service.ViewModels;
/// <param name="Description">The description of the service.</param>
/// <param name="LicenseType">LicenseType for offer</param>
/// <param name="Price">Pricing information of the app.</param>
/// <param name="ProviderUri">Provider's homepage url or marketing url</param>
/// <param name="OfferSubscriptionDetailData">Detail Data of the offer subscription</param>
/// <param name="ServiceTypes">Collection of the assigned serviceTypeIds.</param>
/// <param name="Documents">documents assigned to offer</param>
Expand All @@ -48,6 +49,7 @@ public record ServiceDetailResponse(
string? Description,
LicenseTypeId LicenseType,
string Price,
string? ProviderUri,
IEnumerable<OfferSubscriptionStateDetailData> OfferSubscriptionDetailData,
IEnumerable<ServiceTypeId> ServiceTypes,
IDictionary<DocumentTypeId, IEnumerable<DocumentData>> Documents,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public record OfferDetailData(
/// <param name="ContactEmail">Contact email address.</param>
/// <param name="Description">The description of the service.</param>
/// <param name="Price">Pricing information of the app.</param>
/// <param name="ProviderUri">Provider's homepage url or marketing url</param>
/// <param name="OfferSubscriptionDetailData">Detail Data of the offer subscription</param>
/// <param name="ServiceTypeIds">Collection of the assigned serviceTypeIds.</param>
/// <param name="Documents">Collections of the Document type Data.</param>
Expand All @@ -64,6 +65,7 @@ public record ServiceDetailData(
string? ContactEmail,
string? Description,
string Price,
string? ProviderUri,
IEnumerable<OfferSubscriptionStateDetailData> OfferSubscriptionDetailData,
IEnumerable<ServiceTypeId> ServiceTypeIds,
IEnumerable<DocumentTypeData> Documents,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ public async Task GetServiceDetailsAsync_WithExistingServiceAndLanguageCode_Retu
result.TechnicalUserProfile.Should().ContainSingle().Which.Should().Match<KeyValuePair<Guid, IEnumerable<string>>>(
x => x.Value.SequenceEqual(new[] { "role1", "role2" }));
result.LeadPictureId.Should().NotBeEmpty();
result.ProviderUri.Should().NotBeEmpty();
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 28fb429

Please sign in to comment.