1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[PR #733] [MERGED] [Feature] Add Total cost to Projects #1109

Closed
opened 2026-05-07 00:16:03 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/733
Author: @Keybored02
Created: 3/17/2026
Status: Merged
Merged: 3/18/2026
Merged by: @maziggy

Base: devHead: feature/project_total_cost


📝 Commits (9)

  • 6daee7e Add Total cost to Projects, add new bom_cost to stats, include localisation
  • 85b17d8 Merge branch 'dev' into feature/project_total_cost
  • df8dabf Updated Budget calc logic, added budget to ProjectModal, included locales
  • 4261aeb Merge branch 'feature/project_total_cost' of https://github.com/Keybored02/bambuddy into feature/project_total_cost
  • 6520010 Merge branch 'dev' into feature/project_total_cost
  • 2959ed7 Merge branch 'dev' into feature/project_total_cost
  • b802815 Change budget handling from undefined to null
  • 62bc8ef Update budget assignment condition in projects.py
  • a9fcd86 Update client.ts

📊 Changes

12 files changed (+98 additions, -17 deletions)

View changed files

📝 backend/app/api/routes/projects.py (+5 -1)
📝 backend/app/schemas/project.py (+2 -0)
📝 frontend/src/api/client.ts (+5 -3)
📝 frontend/src/i18n/locales/de.ts (+3 -0)
📝 frontend/src/i18n/locales/en.ts (+3 -0)
📝 frontend/src/i18n/locales/fr.ts (+3 -0)
📝 frontend/src/i18n/locales/it.ts (+3 -0)
📝 frontend/src/i18n/locales/ja.ts (+3 -0)
📝 frontend/src/i18n/locales/pt-BR.ts (+3 -0)
📝 frontend/src/i18n/locales/zh-CN.ts (+3 -0)
📝 frontend/src/pages/ProjectDetailPage.tsx (+32 -12)
📝 frontend/src/pages/ProjectsPage.tsx (+33 -1)

📄 Description

Description

This PR adds a total cost filed to the project page. It sums material, energy, and BOM cost.

Fixes ##728

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

  • ProjectStats schema: added bom_cost: float = 0.0
  • compute_project_stats: extended BOM aggregate query with SUM(unit_price * quantity_needed) → returned as bom_cost
  • ProjectStats TS interface: added bom_cost: number
  • Cost Tracking card: added Total Cost field (estimated_cost + total_energy_cost + bom_cost), shown in green with "incl. BOM" hint when applicable
  • BOM section footer total: replaced client-side reduce() with server-computed stats.bom_cost
  • Added totalCost and includesBom keys to projectDetail.cost in all 7 locales (en, de, fr, it, ja, pt-BR, zh-CN)

Screenshots

image

Testing

  • I have tested this on my local machine
  • I have tested with my printer model: H2C

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

Additional Notes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/maziggy/bambuddy/pull/733 **Author:** [@Keybored02](https://github.com/Keybored02) **Created:** 3/17/2026 **Status:** ✅ Merged **Merged:** 3/18/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `dev` ← **Head:** `feature/project_total_cost` --- ### 📝 Commits (9) - [`6daee7e`](https://github.com/maziggy/bambuddy/commit/6daee7ee38d067626c09e520df5ec3136b196fab) Add Total cost to Projects, add new bom_cost to stats, include localisation - [`85b17d8`](https://github.com/maziggy/bambuddy/commit/85b17d87c8ecf5f7cde2147b13983499caf6edb8) Merge branch 'dev' into feature/project_total_cost - [`df8dabf`](https://github.com/maziggy/bambuddy/commit/df8dabf89291358cc270b8c59b2feed5a7815c3d) Updated Budget calc logic, added budget to ProjectModal, included locales - [`4261aeb`](https://github.com/maziggy/bambuddy/commit/4261aeb944f9bf068d5212ac2fb7199d816baad9) Merge branch 'feature/project_total_cost' of https://github.com/Keybored02/bambuddy into feature/project_total_cost - [`6520010`](https://github.com/maziggy/bambuddy/commit/6520010a01a0b2784786a0985871003f3eb5e029) Merge branch 'dev' into feature/project_total_cost - [`2959ed7`](https://github.com/maziggy/bambuddy/commit/2959ed7b2d457dc64d7816712115470a7de8ea10) Merge branch 'dev' into feature/project_total_cost - [`b802815`](https://github.com/maziggy/bambuddy/commit/b8028154e4369673541644cd00807ea701e546fd) Change budget handling from undefined to null - [`62bc8ef`](https://github.com/maziggy/bambuddy/commit/62bc8ef06f6c05f3ee4193b90f331d56ac1cabb0) Update budget assignment condition in projects.py - [`a9fcd86`](https://github.com/maziggy/bambuddy/commit/a9fcd86b366f6c11b74402334b322af26d5d61bc) Update client.ts ### 📊 Changes **12 files changed** (+98 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `backend/app/api/routes/projects.py` (+5 -1) 📝 `backend/app/schemas/project.py` (+2 -0) 📝 `frontend/src/api/client.ts` (+5 -3) 📝 `frontend/src/i18n/locales/de.ts` (+3 -0) 📝 `frontend/src/i18n/locales/en.ts` (+3 -0) 📝 `frontend/src/i18n/locales/fr.ts` (+3 -0) 📝 `frontend/src/i18n/locales/it.ts` (+3 -0) 📝 `frontend/src/i18n/locales/ja.ts` (+3 -0) 📝 `frontend/src/i18n/locales/pt-BR.ts` (+3 -0) 📝 `frontend/src/i18n/locales/zh-CN.ts` (+3 -0) 📝 `frontend/src/pages/ProjectDetailPage.tsx` (+32 -12) 📝 `frontend/src/pages/ProjectsPage.tsx` (+33 -1) </details> ### 📄 Description ## Description This PR adds a total cost filed to the project page. It sums material, energy, and BOM cost. ## Related Issue Fixes ##728 ## Type of Change <!-- Mark the relevant option with an "x" --> - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test addition or update ## Changes Made <!-- List the specific changes made in this PR --> - ProjectStats schema: added `bom_cost: float = 0.0` - `compute_project_stats`: extended BOM aggregate query with `SUM(unit_price * quantity_needed)` → returned as `bom_cost` - ProjectStats TS interface: added `bom_cost: number` - Cost Tracking card: added Total Cost field (estimated_cost + total_energy_cost + bom_cost), shown in green with "incl. BOM" hint when applicable - BOM section footer total: replaced client-side reduce() with server-computed `stats.bom_cost` - Added `totalCost` and `includesBom` keys to `projectDetail.cost` in all 7 locales (en, de, fr, it, ja, pt-BR, zh-CN) ## Screenshots <img width="978" height="145" alt="image" src="https://github.com/user-attachments/assets/65bf077b-aa95-442f-870a-2be732fe701a" /> ## Testing <!-- Describe how you tested your changes --> - [x] I have tested this on my local machine - [x] I have tested with my printer model: H2C ## Checklist - [x] My code follows the project's coding style - [x] I have commented my code where necessary - [ ] I have updated the documentation (if needed) - [x] My changes generate no new warnings - [x] I have tested my changes thoroughly ## Additional Notes <!-- Add any additional information that reviewers should know --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:16:03 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy-maziggy-1#1109
No description provided.