Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/customer-portal/backend/modules/entity/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ public type ProjectFeatures record {|
boolean hasDeploymentWriteAccess;
# Indicates if deployment read access is enabled
boolean hasDeploymentReadAccess;
# Allowed categories for default case creation in deployed product search
ProductCategory[]? defaultCaseProductCategories;
# Allowed categories for service request creation in deployed product search
ProductCategory[]? srProductCategories;
json...;
|};

Expand Down Expand Up @@ -1999,6 +2003,8 @@ public type ChangeRequest record {|
string number;
# Change request title
string? title;
# Change request description
string? description;
# Associated project information
ReferenceTableItem? project;
# Service request information (case)
Expand Down Expand Up @@ -2093,8 +2099,6 @@ public type CatalogItemVariablesResponse record {|
# Change request details information.
public type ChangeRequestResponse record {|
*ChangeRequest;
# Change request description
string? description;
# User who created the change request
string createdBy;
# Justification for the change request
Expand Down
8 changes: 6 additions & 2 deletions apps/customer-portal/backend/modules/types/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ public type ProjectFeatures record {|
boolean hasDeploymentWriteAccess;
# Indicates if deployment read access is enabled
boolean hasDeploymentReadAccess;
# Allowed categories for default case creation in deployed product search.
entity:ProductCategory[]? defaultCaseProductCategories;
# Allowed categories for service request creation in deployed product search.
entity:ProductCategory[]? srProductCategories;
|};

# Project filter options.
Expand Down Expand Up @@ -1390,6 +1394,8 @@ public type ChangeRequest record {|
string number;
# Change request title
string? title;
# Change request description
string? description;
# Project
ReferenceItem? project;
# Service request information (case)
Expand Down Expand Up @@ -1478,8 +1484,6 @@ public type CatalogSearchPayload record {|
# Change request details information.
public type ChangeRequestResponse record {|
*ChangeRequest;
# Change request description
string? description;
# User who created the change request
string createdBy;
# Justification for the change request
Expand Down
28 changes: 23 additions & 5 deletions apps/customer-portal/backend/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2795,10 +2795,12 @@ components:
type: string
description: Allowed domain list of the account
nullable: true
default: ""
classification:
type: string
description: Account classification
nullable: true
default: ""
isPartner:
type: boolean
description: Whether the account is a partner or not
Expand Down Expand Up @@ -3441,6 +3443,7 @@ components:
- createdOn
- deployedProduct
- deployment
- description
- duration
- endDate
- id
Expand All @@ -3464,6 +3467,10 @@ components:
type: string
description: Change request title
nullable: true
description:
type: string
description: Change request description
nullable: true
project:
description: Project
nullable: true
Expand Down Expand Up @@ -3549,7 +3556,6 @@ components:
- approvedOn
- communicationPlan
- createdBy
- description
- hasCustomerApproved
- hasCustomerReviewed
- impactDescription
Expand All @@ -3559,10 +3565,6 @@ components:
- testPlan
type: object
properties:
description:
type: string
description: Change request description
nullable: true
createdBy:
type: string
description: User who created the change request
Expand Down Expand Up @@ -4864,6 +4866,7 @@ components:
ProjectFeatures:
required:
- acceptedSeverityValues
- defaultCaseProductCategories
- hasChangeRequestReadAccess
- hasDeploymentReadAccess
- hasDeploymentWriteAccess
Expand All @@ -4874,6 +4877,7 @@ components:
- hasSraWriteAccess
- hasTimeLogsReadAccess
- hasUpdatesReadAccess
- srProductCategories
type: object
properties:
acceptedSeverityValues:
Expand Down Expand Up @@ -4911,6 +4915,20 @@ components:
hasDeploymentReadAccess:
type: boolean
description: Indicates if deployment read access is enabled
defaultCaseProductCategories:
type: array
description: Allowed categories for default case creation in deployed product
search.
nullable: true
items:
$ref: '#/components/schemas/ProductCategory'
srProductCategories:
type: array
description: Allowed categories for service request creation in deployed
product search.
nullable: true
items:
$ref: '#/components/schemas/ProductCategory'
additionalProperties: false
description: Project feature access configuration.
ProjectFilterOptions:
Expand Down
2 changes: 1 addition & 1 deletion apps/customer-portal/backend/service.bal
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ service http:InterceptableService / on new http:Listener(9090, listenerConf) {
};
}

return getProjectFeatures(projectMetadata);
return mapProjectFeatures(projectMetadata);
}

# Classify the case using AI chat agent.
Expand Down
9 changes: 6 additions & 3 deletions apps/customer-portal/backend/utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ public isolated function searchCases(string idToken, string projectId, types:Cas
};
}

# Get project features for a given project.
# Map project features for a given project.
#
# + projectMetadata - Project metadata response
# + return - Project features or error
public isolated function getProjectFeatures(entity:ProjectMetadataResponse projectMetadata)
public isolated function mapProjectFeatures(entity:ProjectMetadataResponse projectMetadata)
returns types:ProjectFeatures {

types:ReferenceItem[] acceptedSeverityValues =
Expand All @@ -123,7 +123,9 @@ public isolated function getProjectFeatures(entity:ProjectMetadataResponse proje
hasUpdatesReadAccess: projectMetadata.features.hasUpdatesReadAccess,
hasTimeLogsReadAccess: projectMetadata.features.hasTimeLogsReadAccess,
hasDeploymentWriteAccess: projectMetadata.features.hasDeploymentWriteAccess,
hasDeploymentReadAccess: projectMetadata.features.hasDeploymentReadAccess
hasDeploymentReadAccess: projectMetadata.features.hasDeploymentReadAccess,
defaultCaseProductCategories: projectMetadata.features.defaultCaseProductCategories,
srProductCategories: projectMetadata.features.srProductCategories
};
}

Expand Down Expand Up @@ -753,6 +755,7 @@ public isolated function mapChangeRequestSearchResponse(entity:ChangeRequestSear
startDate: changeRequest.plannedStartOn,
endDate: changeRequest.plannedEndOn,
duration: changeRequest.duration,
description: changeRequest.description,
hasServiceOutage: changeRequest.hasServiceOutage,
createdOn: changeRequest.createdOn,
updatedOn: changeRequest.updatedOn,
Expand Down