feat(dashboard): total sales by department #58

Merged
addison merged 4 commits from 007-000-000-total-sales-by-department into main 2026-09-24 05:27:03 -04:00
Collaborator

Spec 7.0.0

Changes

  • Added backend endpoint to give total sales by department.
  • Added total sales line chart in frontend.

Testing

  • Make sure you have latest code running.
  • Navigate to Sales dashboard.
  • A full height and width total sales by department 3 liner chart must be visible 12 months rolling window.
  • Hover over any month point it must show the hovered over month's Overall, Hvac and Electric sales correctly.
# Spec 7.0.0 ## Changes - Added backend endpoint to give total sales by department. - Added total sales line chart in frontend. ## Testing - [x] Make sure you have latest code running. - [x] Navigate to Sales dashboard. - [x] A full height and width total sales by department 3 liner chart must be visible 12 months rolling window. - [x] Hover over any month point it must show the hovered over month's Overall, Hvac and Electric sales correctly.
fix: improve formatting of dot properties in DepartmentSalesChart component
All checks were successful
CI / frontend (pull_request) Successful in 45s
CI / backend (pull_request) Successful in 45s
Amp Review / review (pull_request) Successful in 1s
59acd0240a
talha requested review from addison 2026-09-22 12:09:12 -04:00
Author
Collaborator

@addison I haven't added print page as it was not mentioned in spec, Please do let me know if it's needed in this page too.

@addison I haven't added print page as it was not mentioned in spec, Please do let me know if it's needed in this page too.
Owner

Please use convention commit format for PR titles

Please use convention commit format for PR titles
addison changed title from 007-000-000-total-sales-by-department to feat(dashboard): total sales by department) 2026-09-24 04:34:31 -04:00
addison changed title from feat(dashboard): total sales by department) to feat(dashboard): total sales by department 2026-09-24 04:34:39 -04:00
Author
Collaborator

@addison wrote in #58 (comment):

Please use convention commit format for PR titles

My bad, don't know how i missed this

@addison wrote in https://git.kwila.cloud/kwila/office-extensions/pulls/58#issuecomment-4993: > Please use convention commit format for PR titles My bad, don't know how i missed this
@ -0,0 +1,25 @@
// "YYYY-MM" -> e.g. "Sep 26", for compact X-axis ticks.
export const formatMonthLabel = (month: string) => {
Owner

These functions don't seem specific to sales dashboards, shouldn't they be in frontend/src/lib?

These functions don't seem specific to sales dashboards, shouldn't they be in `frontend/src/lib`?
Author
Collaborator

Everywhere else we aren't showing months in such format, that's why added this. We can move it to global place somewhere if any other component or file needs it too

Everywhere else we aren't showing months in such format, that's why added this. We can move it to global place somewhere if any other component or file needs it too
addison marked this conversation as resolved
@ -0,0 +138,4 @@
var subtotal float64
if err := rows.Scan(&date, &department, &subtotal, &number, &memo); err != nil {
s.logger.Error("failed to scan department sales row", slog.Any("error", err))
continue
Owner

It seems better to return a 500 error here.

It seems better to return a 500 error here.
Owner

Rather than drop data from the dashboard without telling the user.

Rather than drop data from the dashboard without telling the user.
Author
Collaborator

Let me update this

Let me update this
addison left a comment

Return 500 error when failing to scan DB row

Return 500 error when failing to scan DB row
fix: handle error in department sales row scanning and return JSON error response
All checks were successful
CI / frontend (pull_request) Successful in 41s
CI / backend (pull_request) Successful in 35s
6fbdf4d4dc
talha requested review from addison 2026-09-24 04:55:26 -04:00
addison deleted branch 007-000-000-total-sales-by-department 2026-09-24 05:27:03 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
kwila/office-extensions!58
No description provided.