Skip to content

Commit

Permalink
feat(offers): remove displayTechnicalUser from offer
Browse files Browse the repository at this point in the history
* adjust all endpoints where displayTechnicalUser could be set
* remove displayTechnicalUser from the database

Refs: #1244
  • Loading branch information
Phil91 committed Jan 21, 2025
1 parent bd94343 commit 34a34e9
Show file tree
Hide file tree
Showing 27 changed files with 10,431 additions and 129 deletions.
8 changes: 0 additions & 8 deletions docs/api/apps-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2611,10 +2611,6 @@ 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:
type: array
items:
Expand Down Expand Up @@ -2926,10 +2922,6 @@ components:
type: string
description: ContactNumber
nullable: true
displayTechnicalUser:
type: boolean
description: DisplayTechnicalUser
nullable: true
additionalProperties: false
description: Request Model for App Creation.
AppRoleData:
Expand Down
11 changes: 0 additions & 11 deletions docs/api/services-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2397,10 +2397,6 @@ 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 @@ -2437,10 +2433,6 @@ components:
type: string
description: Contact email address.
nullable: true
displayTechnicalUser:
type: boolean
description: Display Technical User.
nullable: true
description:
type: string
description: The description of the service.
Expand Down Expand Up @@ -2563,9 +2555,6 @@ 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,7 +204,6 @@ 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,7 +115,6 @@ 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: 0 additions & 2 deletions src/marketplace/Apps.Service/ViewModels/AppDetailResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ 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 @@ -55,7 +54,6 @@ public record AppDetailResponse(
string Provider,
string? ContactEmail,
string? ContactNumber,
bool? DisplayTechnicalUser,
IEnumerable<AppUseCaseData> UseCases,
string LongDescription,
LicenseTypeId LicenseType,
Expand Down
4 changes: 1 addition & 3 deletions src/marketplace/Apps.Service/ViewModels/AppRequestModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Apps.Service.ViewModels;
/// <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 @@ -47,6 +46,5 @@ public record AppRequestModel(
[ValidateEnumValues] IEnumerable<PrivacyPolicyId> PrivacyPolicies,
string? ProviderUri,
string? ContactEmail,
string? ContactNumber,
bool? DisplayTechnicalUser
string? ContactNumber
);
3 changes: 1 addition & 2 deletions src/marketplace/Offers.Library/Models/OfferingData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public record ServiceOfferingData(
Guid? SalesManager,
IEnumerable<LocalizedDescription> Descriptions,
IEnumerable<ServiceTypeId> ServiceTypeIds,
string? ProviderUri,
bool? DisplayTechnicalUser);
string? ProviderUri);

/// <summary>
/// Description of a service
Expand Down
1 change: 0 additions & 1 deletion src/marketplace/Offers.Library/Service/OfferService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ 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 @@ -101,7 +101,6 @@ public async Task<ServiceDetailResponse> GetServiceDetailsAsync(Guid serviceId,
result.Provider,
result.LeadPictureId,
result.ContactEmail,
result.DisplayTechnicalUser,
result.Description,
result.LicenseTypeId,
result.Price,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ 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: 0 additions & 2 deletions src/marketplace/Services.Service/ViewModels/ServiceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ 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 @@ -49,7 +48,6 @@ 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 @@ -31,7 +31,6 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Services.Service.ViewModels;
/// <param name="Provider">Provider of the app.</param>
/// <param name="LeadPictureId">Lead picture Id.</param>
/// <param name="ContactEmail">Contact email address.</param>
/// <param name="DisplayTechnicalUser">Display Technical User.</param>
/// <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>
Expand All @@ -47,7 +46,6 @@ public record ServiceDetailResponse(
string Provider,
Guid? LeadPictureId,
string? ContactEmail,
bool? DisplayTechnicalUser,
string? Description,
LicenseTypeId LicenseType,
string Price,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public record ServiceDetailData(
string Provider,
Guid? LeadPictureId,
string? ContactEmail,
bool? DisplayTechnicalUser,
string? Description,
string Price,
string? ProviderUri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ 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 @@ -26,70 +26,17 @@ namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
/// View model of an application's Service detailed data.
/// </summary>
public record ServiceDetailsData(

/// <summary>
/// ID of the offer.
/// </summary>
Guid Id,

/// <summary>
/// Title or name of the offer.
/// </summary>
string? Title,

/// <summary>
/// Service Type Id of the offer
/// </summary>
IEnumerable<ServiceTypeId> ServiceTypeIds,

/// <summary>
/// Provider of the offer.
/// </summary>
string Provider,

/// <summary>
/// Descriptions of the offer.
/// </summary>
IEnumerable<LocalizedDescription> Descriptions,

/// <summary>
/// document assigned to offer
/// </summary>
IEnumerable<DocumentTypeData> Documents,

/// <summary>
/// Uri to provider's marketing presence.
/// </summary>
string? ProviderUri,

/// <summary>
/// Email address of the app's primary contact.
/// </summary>
string? ContactEmail,

/// <summary>
/// Phone number of the app's primary contact.
/// </summary>
string? ContactNumber,

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

/// <summary>
/// Offer Status Id
/// </summary>
OfferStatusId OfferStatusId,

/// <summary>
/// License Type Id
/// </summary>
LicenseTypeId LicenseTypeId,

///<summary>
/// Technical User Profile
///</summary>
IEnumerable<TechnicalUserRoleData> TechnicalUserProfile
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ 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 @@ -278,7 +277,6 @@ public void RemoveAppLanguages(IEnumerable<(Guid appId, string languageShortName
offer.ProviderCompany!.Name,
offer.Documents.Where(document => document.DocumentTypeId == DocumentTypeId.SERVICE_LEADIMAGE && document.DocumentStatusId != DocumentStatusId.INACTIVE).Select(document => document.Id).FirstOrDefault(),
offer.ContactEmail,
offer.DisplayTechnicalUser,
offer.OfferDescriptions.SingleOrDefault(d => d.LanguageShortName == languageShortName)!.DescriptionLong,
offer.OfferLicenses.FirstOrDefault()!.Licensetext,
offer.MarketingUrl,
Expand Down Expand Up @@ -677,7 +675,6 @@ 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 34a34e9

Please sign in to comment.