A new section has been implemented on the website to display an interactive chart showing the sales of each product. The implementation includes both the frontend in Angular and the backend in Laravel, ensuring that the data updates in real-time.
Changes Made:
Frontend (Angular):
Dependency Updates:
Added chart.js to the package.json file for chart visualization.
Routing and Components:
Added a new route for the sales chart page in app-routing.module.ts.
Created the SalesGraphComponent with its respective HTML, CSS, and unit tests.
Added the link to the navigation menu for authenticated users with the Nurseryman role.
Order Service:
Added a method in order.service.ts to fetch sales and cancellations data from the backend.
Backend (Laravel):
Order Controller:
Added a new method in OrderController.php to retrieve sales and cancellations data.
API Route:
Added a new route in api.php to fetch sales and cancellations.
Implementation of Sales Chart by Product
Response to Issue #77
Description:
A new section has been implemented on the website to display an interactive chart showing the sales of each product. The implementation includes both the frontend in Angular and the backend in Laravel, ensuring that the data updates in real-time.
Changes Made:
Frontend (Angular):
Dependency Updates:
chart.js
to thepackage.json
file for chart visualization.Routing and Components:
app-routing.module.ts
.SalesGraphComponent
with its respective HTML, CSS, and unit tests.Nurseryman
role.Order Service:
order.service.ts
to fetch sales and cancellations data from the backend.Backend (Laravel):
Order Controller:
OrderController.php
to retrieve sales and cancellations data.API Route:
api.php
to fetch sales and cancellations.Modified Files:
Angular:
package-lock.json
package.json
src/app/app-routing.module.ts
src/app/app.module.ts
src/app/components/header/header.component.html
src/app/components/sales-graph/sales-graph.component.{css,html,spec.ts,ts}
src/app/models/{Cancellation.ts,Sale.ts}
src/app/services/order.service.ts
Laravel:
app/Http/Controllers/OrderController.php
routes/api.php