Skip to content

Commit

Permalink
Merge pull request #8537 from ever-co/fix/add-all-task-data
Browse files Browse the repository at this point in the history
[Enhancement] Add All task Data
  • Loading branch information
rahul-rocket authored Nov 15, 2024
2 parents a0af6b3 + 375f11d commit 8f97921
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 31 deletions.
3 changes: 3 additions & 0 deletions packages/contracts/src/task.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export interface ITask
status?: TaskStatusEnum;
priority?: TaskPriorityEnum;
size?: TaskSizeEnum;
startDate?: Date;
resolvedAt?: Date;
dueDate?: Date;
estimate?: number;
tags?: ITag[];
Expand All @@ -41,6 +43,7 @@ export interface ITask
creatorId?: ID;
isDraft?: boolean; // Define if task is still draft (E.g : Task description not completed yet)

version?: string;
issueType?: string;

parent?: ITask;
Expand Down
64 changes: 33 additions & 31 deletions packages/core/src/time-tracking/time-log/time-log.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,7 @@ export class TimeLogService extends TenantAwareCrudService<TimeLog> {
imageUrl: true,
membersCount: true
},
task: {
id: true,
title: true,
estimate: true,
taskStatus: {
name: true,
value: true,
description: true,
icon: true,
color: true,
order: true,
isCollapsed: true,
isDefault: true
},
issueType: true
},
task: TimeLogService.TASK_SELECT_FIELDS,
organizationContact: {
id: true,
name: true,
Expand Down Expand Up @@ -355,21 +340,7 @@ export class TimeLogService extends TenantAwareCrudService<TimeLog> {
imageUrl: true
}
},
task: {
id: true,
title: true,
taskStatus: {
name: true,
value: true,
description: true,
icon: true,
color: true,
order: true,
isCollapsed: true,
isDefault: true
},
issueType: true
},
task: TimeLogService.TASK_SELECT_FIELDS,
timeSlots: {
id: true,
overall: true,
Expand Down Expand Up @@ -1282,4 +1253,35 @@ export class TimeLogService extends TenantAwareCrudService<TimeLog> {
// Check if the end date is on or before the current date
return moment(end).isSameOrBefore(moment());
}

private static readonly TASK_SELECT_FIELDS = {
id: true,
isActive: true,
isArchived: true,
tenantId: true,
organizationId: true,
number: true,
prefix: true,
title: true,
description: true,
status: true,
priority: true,
size: true,
issueType: true,
estimate: true,
dueDate: true,
startDate: true,
resolvedAt: true,
version: true,
taskStatus: {
name: true,
value: true,
description: true,
icon: true,
color: true,
order: true,
isCollapsed: true,
isDefault: true
}
} as const;
}

0 comments on commit 8f97921

Please sign in to comment.