Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
6847eec
feat: Implement Ratecard Drawer and Finance Table
shancds May 14, 2025
2b3b0ba
feat: Add Ratecard management functionality with localization support
shancds May 18, 2025
a8b2068
feat: implement organization working days and hours settings
chamikaJ May 19, 2025
fbfeace
feat(ratecard): implement CRUD operations and validation for rate cards
shancds May 19, 2025
34613e5
Merge branch 'fix/performance-improvements' of https://github.com/Wor…
chamikaJ May 20, 2025
1dade05
feat(reporting): enhance date range handling in reporting allocation
chamikaJ May 20, 2025
819252c
refactor(reporting): update date handling and logging in allocation c…
chamikaJ May 20, 2025
3b59a85
refactor(reporting): simplify date parsing and improve logging format
chamikaJ May 20, 2025
14d8f43
refactor(reporting): clarify date parsing in allocation controller an…
chamikaJ May 20, 2025
67c62fc
refactor(schedule): streamline organization working days update query
chamikaJ May 20, 2025
26b0b57
feat(ratecard): enhance rate card management with CRUD operations and…
shancds May 20, 2025
3dd56f0
feat(ratecard): add currency field to rate card queries and update logic
shancds May 20, 2025
afd4cbd
refactor(ratecard): remove console log from updateRateCard thunk
shancds May 20, 2025
76c92b1
refactor(reporting): optimize date handling and organization working …
chamikaJ May 20, 2025
97feef5
refactor(reporting): improve utilization calculations in allocation c…
chamikaJ May 20, 2025
c1067d8
refactor(reporting): update total working hours calculation in alloca…
chamikaJ May 20, 2025
7d81b77
feat(ratecard): update job role references and enhance rate card func…
shancds May 20, 2025
cc8dca7
fix(ratecard): update input value handling and change 'Ratecard' to '…
shancds May 20, 2025
ded0ad6
refactor: remove debug console logs from selection cell components an…
shancds May 21, 2025
f6eadde
feat(ratecard): add 'Add All' button to include all job titles and ad…
shancds May 21, 2025
69e7938
Merge branch 'feature/project-finance' into finance-module
chamikaJ May 21, 2025
4386aab
Merge pull request #135 from shancds/finance-module
chamikaJ May 21, 2025
db1108a
feat(ratecard): add 'Add All' and 'Remove All' buttons, enhance role …
shancds May 21, 2025
c3bec74
feat(project-ratecard): implement project rate card management with C…
shancds May 21, 2025
3ce8127
feat(ratecard): enhance project rate card functionality with job titl…
shancds May 21, 2025
b104cf2
feat(ratecard): add RatecardType import for enhanced type support in …
shancds May 21, 2025
533b595
Merge pull request #136 from shancds/feature/project-finance
chamikaJ May 21, 2025
d7a5f08
feat(project-finance): implement project finance API and frontend int…
chamikaJ May 22, 2025
49fc89a
Merge branch 'feature/recurring-tasks' of https://github.com/Worklenz…
chamikaJ May 22, 2025
a879176
feat(ratecard): update currency default to USD and align rate columns…
shancds May 22, 2025
096163d
Merge branch 'feature/recurring-tasks' of https://github.com/Worklenz…
chamikaJ May 22, 2025
a711d48
feat(ratecard): implement insertOne functionality for single role cre…
shancds May 22, 2025
87bd1b8
feat(ratecard): crud rename and ratecard-assignee-selector create
shancds May 22, 2025
e245530
Merge branch 'feature/project-finance' of https://github.com/Worklenz…
shancds May 23, 2025
1a5f6d5
Feat(settings-ratecard-drawer): add role show drop down fix
shancds May 23, 2025
b320a7b
feat(project-finance): enhance project finance view and calculations
chamikaJ May 23, 2025
22d0fc7
feat(project-ratecard-member): add members to the project ratecard fu…
shancds May 23, 2025
659ede7
feat(project-ratecard-member): ratecard member handle backend and fro…
shancds May 23, 2025
21a4131
Fix(Ratecard): translate locate update
shancds May 23, 2025
399d8b4
Merge pull request #137 from shancds/feature/project-finance
chamikaJ May 26, 2025
e567d6b
feat(ratecard): add minimum value constraint to rate input fields
shancds May 26, 2025
1969fbd
feat(ratecard-drawer): enhance rate card deletion logic and button di…
shancds May 26, 2025
f68c72a
feat(ratecard-drawer): add confirmation popover for role deletion and…
shancds May 26, 2025
85280c3
feat(members-time-sheet): enhance tooltip display with utilization st…
shancds May 26, 2025
b0ed3f6
feat(task-breakdown-api): implement task financial breakdown API and …
chamikaJ May 26, 2025
da98fe2
feat(subtask-table): add titles to table columns for better clarity
shancds May 26, 2025
c55e593
feat(project-view-finance): add confirmation messages for delete actions
shancds May 26, 2025
612de86
feat(finance-table): enhance task display and localization support
chamikaJ May 26, 2025
dcb4ff1
Merge branch 'Worklenz:feature/project-finance' into feature/project-…
shancds May 27, 2025
c33a152
Merge pull request #139 from shancds/feature/project-finance
chamikaJ May 27, 2025
f22a91b
feat(ratecard): enhance ratecard update logic and add unsaved changes…
shancds May 27, 2025
cf0eaad
feat(ratecard-table): improve rate handling and focus management in t…
shancds May 27, 2025
42c4802
Merge branch 'Worklenz:feature/project-finance' into feature/project-…
shancds May 27, 2025
7bb93d2
Merge pull request #140 from shancds/feature/project-finance
chamikaJ May 27, 2025
ca0c958
fix(project-finance-controller): correct estimated hours calculation …
chamikaJ May 27, 2025
010cbe1
feat(ratecard-drawer): enhance drawer close logic to handle unsaved c…
shancds May 28, 2025
bc652f8
Merge branch 'Worklenz:feature/project-finance' into feature/project-…
shancds May 28, 2025
5cb6548
feat(import-ratecards-drawer): add alert for already imported rate ca…
shancds May 28, 2025
07bc5e6
feat(project-finance): implement time formatting utilities and update…
chamikaJ May 28, 2025
cae5524
feat(ratecard-assignee-selector): add assignedMembers prop to handle …
shancds May 28, 2025
ad9e940
Merge pull request #145 from shancds/feature/project-finance
chamikaJ May 28, 2025
5454c22
feat(project-finance): enhance fixed cost handling and add silent ref…
chamikaJ May 28, 2025
a87ea46
feat(project-finance): implement hierarchical task loading and subtas…
chamikaJ May 28, 2025
b8cc9b5
feat(project-finance): add finance data export functionality
chamikaJ May 28, 2025
549728c
feat(reporting): implement member selection and filtering in time rep…
shancds May 29, 2025
9b48cc7
refactor(reporting): remove console logs from member time sheets and …
shancds May 29, 2025
7b1c048
feat(time-report): add member search functionality to time report loc…
shancds May 29, 2025
f1920c1
feat(members-time-sheet): enhance utilization display with color indi…
shancds May 29, 2025
b94c56f
feat(reporting): enhance utilization tracking and filtering in time r…
shancds May 29, 2025
b5288a8
fix(reporting): correct member data extraction in fetchReportingMembers
shancds May 29, 2025
a0f3696
feat(auth): add debug logging for authentication processes
chamikaJ May 29, 2025
6a2e9af
feat(auth): enhance session and user deserialization logging
chamikaJ May 29, 2025
a3d5e63
fix(session): update session middleware configuration
chamikaJ May 29, 2025
2f0fb92
feat(session): add session store debugging and pg_sessions table mana…
chamikaJ May 29, 2025
935165d
refactor(session): simplify pg_sessions table structure and query logic
chamikaJ May 29, 2025
d1fe23b
feat(database): add progress tracking and finance module tables
chamikaJ May 29, 2025
1f6bbce
feat(reporting): add total time utilization component and update memb…
shancds May 29, 2025
8d6c43c
fix(reporting): update total utilization calculation precision and re…
shancds May 29, 2025
4bc1b4f
Merge pull request #146 from shancds/feature/reporting-time-members-f…
chamikaJ May 30, 2025
b0fb0a2
refactor(auth): remove debug logging from authentication processes
chamikaJ May 30, 2025
b6e4ed9
Merge branch 'fix/performance-improvements' of https://github.com/Wor…
chamikaJ May 30, 2025
8cdc8b3
chore(dependencies): update rimraf version and clean up package-lock.…
chamikaJ May 30, 2025
43c6701
feat(finance): enhance project finance view with export functionality…
chamikaJ May 30, 2025
fef50bd
feat(task-logging): enhance time log functionality with subtask handl…
chamikaJ May 30, 2025
4e43780
Merge branch 'feature/member-time-progress-and-utilization' of https:…
chamikaJ May 30, 2025
aeed75c
feat(members-time-sheet): enhance tooltip customization and styling f…
chamikaJ May 30, 2025
6a4bf4d
feat(finance-permissions): implement permission checks for finance da…
chamikaJ May 30, 2025
035617c
fix(finance-table): correct cost calculations in finance table
chamikaJ May 30, 2025
dc6a62a
feat(reporting-allocation): enhance query logic and filters for repor…
chamikaJ Jun 2, 2025
b6be411
fix(database-functions): correct JSON handling for task members in SQ…
chamikaJ Jun 2, 2025
3f7b969
feat(time-report-localization): enhance English, Spanish, and Portugu…
chamikaJ Jun 2, 2025
45d9049
feat(reporting-allocation): enhance working hours calculation and loc…
chamikaJ Jun 2, 2025
71638ce
refactor(task-list): update task list components and remove deprecate…
chamikaJ Jun 2, 2025
4f082e9
feat(gantt-integration): add SVAR Gantt chart component and related f…
chamikaJ Jun 3, 2025
0f59461
feat(time-report-filters): enhance billable status filtering and loca…
chamikaJ Jun 3, 2025
e59216a
feat(reporting-filters): enhance filter components with improved UI a…
chamikaJ Jun 3, 2025
593e6cf
refactor(config): migrate configuration files to ES module syntax
chamikaJ Jun 3, 2025
e8bf84e
feat(config): optimize dependency management and enhance isomorphic l…
chamikaJ Jun 3, 2025
5ec7a27
refactor(vite.config): streamline dependency management and enhance S…
chamikaJ Jun 3, 2025
3bfb886
feat(react-integration): add React polyfills and ensure global availa…
chamikaJ Jun 3, 2025
0136f6d
chore(dependencies): update package versions and resolutions for impr…
chamikaJ Jun 3, 2025
66b7dc5
refactor(vite.config): simplify configuration and optimize chunking s…
chamikaJ Jun 3, 2025
e82bb23
feat(members-time-sheet): enhance API response handling and add noCat…
chamikaJ Jun 3, 2025
13baf36
feat(reporting-allocation): add helper method for billable query with…
chamikaJ Jun 3, 2025
1ec9759
feat(reporting-allocation): update members and utilization filters to…
chamikaJ Jun 3, 2025
d6686d6
feat(project-currency): implement project-specific currency support
chamikaJ Jun 4, 2025
dcdb651
feat(project-finance): add action to update project-specific currency
chamikaJ Jun 4, 2025
915980d
feat(project-view): implement finance tab visibility based on user pe…
chamikaJ Jun 4, 2025
7d735da
Merge branch 'feature/recurring-tasks' of https://github.com/Worklenz…
chamikaJ Jun 5, 2025
9e66a1c
Merge branch 'feature/project-finance' of https://github.com/Worklenz…
Jun 5, 2025
59880bf
feat(project-view): implement finance tab visibility based on user pe…
chamikaJ Jun 6, 2025
ba2ecb2
Merge branch 'feature/project-finance' of https://github.com/Worklenz…
chamikaJ Jun 6, 2025
791cbe2
feat(project-finance): add billable filter functionality to project f…
chamikaJ Jun 6, 2025
3129d7a
Merge branch 'feature/project-finance' of https://github.com/Worklenz…
Jun 6, 2025
c031a49
refactor(project-finance): enhance financial statistics display and f…
chamikaJ Jun 6, 2025
413d5df
Merge branch 'feature/project-finance' of https://github.com/Worklenz…
Jun 6, 2025
49196aa
feat(finance-drawer): enhance task summary and member breakdown display
chamikaJ Jun 6, 2025
509fcc8
refactor(project-finance): improve task cost calculations and UI hier…
chamikaJ Jun 9, 2025
6e18889
feat(task-hierarchy): implement recursive task estimation and reset f…
chamikaJ Jun 9, 2025
0e2c37a
Merge branch 'feature/project-finance' of https://github.com/Worklenz…
Jun 9, 2025
4a3f4cc
Merge branch 'feature/project-finance' of https://github.com/Worklenz…
Jun 9, 2025
e3e1b2d
fix(tasks-controller): cap progress calculation at 100% and synchroni…
chamikaJ Jun 9, 2025
e0a290c
feat(project-finance): enhance fixed cost calculations and parent tas…
chamikaJ Jun 9, 2025
06488d8
feat(project-finance): optimize task cost calculations and enhance UI…
chamikaJ Jun 11, 2025
c5bac36
feat(project-finance): enhance task cost tracking and UI updates
chamikaJ Jun 11, 2025
025b200
Merge branch 'feature/project-finance' of https://github.com/Worklenz…
Jun 11, 2025
c84034b
refactor(project-finance): streamline task cost calculations and prev…
chamikaJ Jun 11, 2025
bedf85d
Merge branch 'feature/project-finance' of https://github.com/Worklenz…
Jun 11, 2025
a08d1ef
fix(finance-table): correct budget and variance calculations for leaf…
chamikaJ Jun 12, 2025
4783b5e
fix(finance-table): refine budget and variance calculations for impro…
chamikaJ Jun 12, 2025
ccb8e68
feat(reporting): add billable and non-billable time tracking to membe…
chamikaJ Jun 13, 2025
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
195 changes: 195 additions & 0 deletions docs/api/task-breakdown-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# Task Breakdown API

## Get Task Financial Breakdown

**Endpoint:** `GET /api/project-finance/task/:id/breakdown`

**Description:** Retrieves detailed financial breakdown for a single task, including members grouped by job roles with labor hours and costs.

### Parameters

- `id` (path parameter): UUID of the task

### Response

```json
{
"success": true,
"body": {
"task": {
"id": "uuid",
"name": "Task Name",
"project_id": "uuid",
"billable": true,
"estimated_hours": 10.5,
"logged_hours": 8.25,
"estimated_labor_cost": 525.0,
"actual_labor_cost": 412.5,
"fixed_cost": 100.0,
"total_estimated_cost": 625.0,
"total_actual_cost": 512.5
},
"grouped_members": [
{
"jobRole": "Frontend Developer",
"estimated_hours": 5.25,
"logged_hours": 4.0,
"estimated_cost": 262.5,
"actual_cost": 200.0,
"members": [
{
"team_member_id": "uuid",
"name": "John Doe",
"avatar_url": "https://...",
"hourly_rate": 50.0,
"estimated_hours": 5.25,
"logged_hours": 4.0,
"estimated_cost": 262.5,
"actual_cost": 200.0
}
]
},
{
"jobRole": "Backend Developer",
"estimated_hours": 5.25,
"logged_hours": 4.25,
"estimated_cost": 262.5,
"actual_cost": 212.5,
"members": [
{
"team_member_id": "uuid",
"name": "Jane Smith",
"avatar_url": "https://...",
"hourly_rate": 50.0,
"estimated_hours": 5.25,
"logged_hours": 4.25,
"estimated_cost": 262.5,
"actual_cost": 212.5
}
]
}
],
"members": [
{
"team_member_id": "uuid",
"name": "John Doe",
"avatar_url": "https://...",
"hourly_rate": 50.0,
"job_title_name": "Frontend Developer",
"estimated_hours": 5.25,
"logged_hours": 4.0,
"estimated_cost": 262.5,
"actual_cost": 200.0
},
{
"team_member_id": "uuid",
"name": "Jane Smith",
"avatar_url": "https://...",
"hourly_rate": 50.0,
"job_title_name": "Backend Developer",
"estimated_hours": 5.25,
"logged_hours": 4.25,
"estimated_cost": 262.5,
"actual_cost": 212.5
}
]
}
}
```

### Error Responses

- `404 Not Found`: Task not found
- `400 Bad Request`: Invalid task ID

### Usage

This endpoint is designed to work with the finance drawer component (`@finance-drawer.tsx`) to provide detailed cost breakdown information for individual tasks. The response includes:

1. **Task Summary**: Overall task financial information
2. **Grouped Members**: Members organized by job role with aggregated costs
3. **Individual Members**: Detailed breakdown for each team member

The data structure matches what the finance drawer expects, with members grouped by job roles and individual labor hours and costs calculated based on:
- Estimated hours divided equally among assignees
- Actual logged time per member
- Hourly rates from project rate cards
- Fixed costs added to the totals

### Frontend Usage Example

```typescript
import { projectFinanceApiService } from '@/api/project-finance-ratecard/project-finance.api.service';

// Fetch task breakdown
const fetchTaskBreakdown = async (taskId: string) => {
try {
const response = await projectFinanceApiService.getTaskBreakdown(taskId);
const breakdown = response.body;

console.log('Task:', breakdown.task);
console.log('Grouped Members:', breakdown.grouped_members);
console.log('Individual Members:', breakdown.members);

return breakdown;
} catch (error) {
console.error('Error fetching task breakdown:', error);
throw error;
}
};

// Usage in React component
const TaskBreakdownComponent = ({ taskId }: { taskId: string }) => {
const [breakdown, setBreakdown] = useState(null);
const [loading, setLoading] = useState(false);

useEffect(() => {
const loadBreakdown = async () => {
setLoading(true);
try {
const data = await fetchTaskBreakdown(taskId);
setBreakdown(data);
} catch (error) {
// Handle error
} finally {
setLoading(false);
}
};

if (taskId) {
loadBreakdown();
}
}, [taskId]);

if (loading) return <Spin />;
if (!breakdown) return null;

return (
<div>
<h3>{breakdown.task.name}</h3>
<p>Total Estimated Cost: ${breakdown.task.total_estimated_cost}</p>
<p>Total Actual Cost: ${breakdown.task.total_actual_cost}</p>

{breakdown.grouped_members.map(group => (
<div key={group.jobRole}>
<h4>{group.jobRole}</h4>
<p>Hours: {group.estimated_hours} | Cost: ${group.estimated_cost}</p>
{group.members.map(member => (
<div key={member.team_member_id}>
{member.name}: {member.estimated_hours}h @ ${member.hourly_rate}/h
</div>
))}
</div>
))}
</div>
);
};
```

### Integration

This API complements the existing finance endpoints:
- `GET /api/project-finance/project/:project_id/tasks` - Get all tasks for a project
- `PUT /api/project-finance/task/:task_id/fixed-cost` - Update task fixed cost

The finance drawer component has been updated to automatically use this API when a task is selected, providing real-time financial breakdown data.
Loading
Loading