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
2 changes: 2 additions & 0 deletions apps/customer-portal/backend/modules/entity/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,8 @@ public type TimeCard record {|
boolean hasBillable;
# State information (e.g., "Approved", "Submitted", etc.)
ChoiceListItem? state;
# User who created the time card
ReferenceTableItem? user;
# User who approved the time card
ReferenceTableItem? approvedBy;
# Associated project
Expand Down
2 changes: 2 additions & 0 deletions apps/customer-portal/backend/modules/types/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,8 @@ public type TimeCard record {|
ReferenceItem? state;
# User who approved the time card
ReferenceItem? approvedBy;
# User who reported the time card
ReferenceItem? reportedBy;
# Associated project
ReferenceItem? project;
# Associated case
Expand Down
2 changes: 2 additions & 0 deletions apps/customer-portal/backend/utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ public isolated function mapProductVersionsResponse(entity:ProductVersionsRespon
public isolated function mapTimeCardSearchResponse(entity:TimeCardsResponse response) returns types:TimeCardsResponse {
types:TimeCard[] timeCards = from entity:TimeCard timeCard in response.timeCards
let entity:ReferenceTableItem? approvedBy = timeCard.approvedBy
let entity:ReferenceTableItem? reportedBy = timeCard.user
let entity:ReferenceTableItem? project = timeCard.project
let entity:TimeCardCase? case = timeCard.case
let entity:ChoiceListItem? state = timeCard.state
Expand All @@ -496,6 +497,7 @@ public isolated function mapTimeCardSearchResponse(entity:TimeCardsResponse resp
createdOn: timeCard.createdOn,
hasBillable: timeCard.hasBillable,
state: state != () ? {id: state.id.toString(), label: state.label} : (),
reportedBy: reportedBy != () ? {id: reportedBy.id, label: reportedBy.name} : (),
approvedBy: approvedBy != () ? {id: approvedBy.id, label: approvedBy.name} : (),
project: project != () ? {id: project.id, label: project.name} : (),
case: case != () ? {id: case.id, label: case.name, number: case.number} : ()
Expand Down