Skip to content

Commit

Permalink
feat(dispalyTechnicalUser): add parameter display technical user in a…
Browse files Browse the repository at this point in the history
…pps services (#1215)

Co-authored-by: Norbert Truchsess <[email protected]>
  • Loading branch information
AnuragNagpure and ntruchsess authored Dec 20, 2024
1 parent 7244417 commit f36c976
Show file tree
Hide file tree
Showing 24 changed files with 10,408 additions and 27 deletions.
16 changes: 12 additions & 4 deletions docs/api/apps-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2565,6 +2565,10 @@ components:
type: string
description: Phone number of the app's primary contact.
nullable: true
displayTechnicalUser:
type: boolean
description: Technical User Status of app's primary contact.
nullable: true
useCases:

Check warning on line 2572 in docs/api/apps-service.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Array Without Maximum Number of Items (v3)

Array schema should have the field 'maxItems' set

Check warning on line 2572 in docs/api/apps-service.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Array Without Maximum Number of Items (v3)

Array schema should have the field 'maxItems' set
type: array
items:
Expand Down Expand Up @@ -2863,18 +2867,22 @@ components:
type: array
items:
$ref: '#/components/schemas/PrivacyPolicyId'
description: Price
description: PrivacyPolicies
providerUri:
type: string
description: Price
description: ProviderUri
nullable: true
contactEmail:
type: string
description: Price
description: ContactEmail
nullable: true
contactNumber:
type: string
description: Price
description: ContactNumber
nullable: true
displayTechnicalUser:
type: boolean
description: DisplayTechnicalUser
nullable: true
additionalProperties: false
description: Request Model for App Creation.
Expand Down
7 changes: 7 additions & 0 deletions docs/api/services-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,10 @@ components:
type: string
description: Contact Number of the service.
nullable: true
displayTechnicalUser:
type: boolean
description: Technical User status of the service.
nullable: true
licenseType:
$ref: '#/components/schemas/LicenseTypeId'
offerStatus:
Expand Down Expand Up @@ -2509,6 +2513,9 @@ components:
providerUri:
type: string
nullable: true
displayTechnicalUser:
type: boolean
nullable: true
additionalProperties: false
ServiceOverviewData:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ private async Task<Guid> CreateAppAsync(AppRequestModel appRequestModel)

app.ContactEmail = appRequestModel.ContactEmail;
app.ContactNumber = appRequestModel.ContactNumber;
app.DisplayTechnicalUser = appRequestModel.DisplayTechnicalUser;
app.MarketingUrl = appRequestModel.ProviderUri;
app.LicenseTypeId = LicenseTypeId.COTS;
app.DateLastChanged = DateTimeOffset.UtcNow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public async Task<AppDetailResponse> GetAppDetailsByIdAsync(Guid appId, string?
result.Provider,
result.ContactEmail,
result.ContactNumber,
result.DisplayTechnicalUser,
result.UseCases,
result.LongDescription ?? Constants.ErrorString,
result.LicenseTypeId,
Expand Down
2 changes: 2 additions & 0 deletions src/marketplace/Apps.Service/ViewModels/AppDetailResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Apps.Service.ViewModels;
/// <param name="Provider">Provider of the app.</param>
/// <param name="ContactEmail">Email address of the app's primary contact.</param>
/// <param name="ContactNumber">Phone number of the app's primary contact.</param>
/// <param name="DisplayTechnicalUser">Technical User Status of app's primary contact.</param>
/// <param name="UseCases">Names of the app's use cases.</param>
/// <param name="LongDescription">Long description of the app.</param>
/// <param name="LicenseType">License Type for app.</param>
Expand All @@ -54,6 +55,7 @@ public record AppDetailResponse(
string Provider,
string? ContactEmail,
string? ContactNumber,
bool? DisplayTechnicalUser,
IEnumerable<AppUseCaseData> UseCases,
string LongDescription,
LicenseTypeId LicenseType,
Expand Down
12 changes: 7 additions & 5 deletions src/marketplace/Apps.Service/ViewModels/AppRequestModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Apps.Service.ViewModels;
/// <param name="Descriptions">Descriptions</param>
/// <param name="SupportedLanguageCodes">SupportedLanguageCodes</param>
/// <param name="Price">Price</param>
/// <param name="PrivacyPolicies">Price</param>
/// <param name="ProviderUri">Price</param>
/// <param name="ContactEmail">Price</param>
/// <param name="ContactNumber">Price</param>
/// <param name="PrivacyPolicies">PrivacyPolicies</param>
/// <param name="ProviderUri">ProviderUri</param>
/// <param name="ContactEmail">ContactEmail</param>
/// <param name="ContactNumber">ContactNumber</param>
/// <param name="DisplayTechnicalUser">DisplayTechnicalUser</param>
public record AppRequestModel(
string? Title,
Guid? SalesManagerId,
Expand All @@ -46,5 +47,6 @@ public record AppRequestModel(
[ValidateEnumValues] IEnumerable<PrivacyPolicyId> PrivacyPolicies,
string? ProviderUri,
string? ContactEmail,
string? ContactNumber
string? ContactNumber,
bool? DisplayTechnicalUser
);
3 changes: 2 additions & 1 deletion src/marketplace/Offers.Library/Models/OfferingData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public record ServiceOfferingData(
Guid? SalesManager,
IEnumerable<LocalizedDescription> Descriptions,
IEnumerable<ServiceTypeId> ServiceTypeIds,
string? ProviderUri);
string? ProviderUri,
bool? DisplayTechnicalUser);

/// <summary>
/// Description of a service
Expand Down
1 change: 1 addition & 0 deletions src/marketplace/Offers.Library/Service/OfferService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ public async Task<Guid> CreateServiceOfferingAsync(ServiceOfferingData data, Off
service.MarketingUrl = data.ProviderUri;
service.LicenseTypeId = LicenseTypeId.COTS;
service.DateLastChanged = DateTimeOffset.UtcNow;
service.DisplayTechnicalUser = data.DisplayTechnicalUser;
});
var licenseId = offerRepository.CreateOfferLicenses(data.Price).Id;
offerRepository.CreateOfferAssignedLicense(service.Id, licenseId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public async Task<ServiceData> GetServiceDetailsByIdAsync(Guid serviceId)
result.ProviderUri ?? Constants.ErrorString,
result.ContactEmail,
result.ContactNumber,
result.DisplayTechnicalUser,
result.LicenseTypeId,
result.OfferStatusId,
result.TechnicalUserProfile.ToDictionary(g => g.TechnicalUserProfileId, g => g.UserRoles)
Expand Down
2 changes: 2 additions & 0 deletions src/marketplace/Services.Service/ViewModels/ServiceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Services.Service.ViewModels;
/// <param name="ProviderUri">Provider Uri of the service</param>
/// <param name="ContactEmail">Contact Email of the service.</param>
/// <param name="ContactNumber">Contact Number of the service. </param>
/// <param name="DisplayTechnicalUser">Technical User status of the service. </param>
/// <param name="LicenseType">License Type for offer </param>
/// <param name="OfferStatus">Status of the offer </param>
/// <param name="TechnicalUserProfile">Status of the offer </param>
Expand All @@ -48,6 +49,7 @@ public record ServiceData(
string ProviderUri,
string? ContactEmail,
string? ContactNumber,
bool? DisplayTechnicalUser,
LicenseTypeId LicenseType,
OfferStatusId OfferStatus,
IDictionary<Guid, IEnumerable<string>> TechnicalUserProfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public record OfferDetailsData(
string Provider,
string? ContactEmail,
string? ContactNumber,
bool? DisplayTechnicalUser,
IEnumerable<AppUseCaseData> UseCases,
string? LongDescription,
string? Price,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public record ServiceDetailsData(
/// </summary>
string? ContactNumber,

/// <summary>
/// Technical User status.
/// </summary>
bool? DisplayTechnicalUser,

/// <summary>
/// Offer Status Id
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public IAsyncEnumerable<ActiveAppData> GetAllActiveAppsAsync(string? languageSho
offer.ProviderCompany!.Name,
offer.ContactEmail,
offer.ContactNumber,
offer.DisplayTechnicalUser,
offer.UseCases.Select(uc => new AppUseCaseData(uc.Id, uc.Name)),
dbContext.Languages.Any(l => l.ShortName == languageShortName)
? offer.OfferDescriptions.SingleOrDefault(d => d.LanguageShortName == languageShortName)!.DescriptionLong
Expand Down Expand Up @@ -675,6 +676,7 @@ public void RemoveOffer(Guid offerId) =>
offer.MarketingUrl,
offer.ContactEmail,
offer.ContactNumber,
offer.DisplayTechnicalUser,
offer.OfferStatusId,
offer.LicenseTypeId,
offer.TechnicalUserProfiles.Select(tup => new TechnicalUserRoleData(
Expand Down
Loading

0 comments on commit f36c976

Please sign in to comment.