A small console application that retrieves orders and generates a summary report.
dotnet run
- .NET 10 SDK
- IDE
The application loads a set of customer orders and prints a summary report to the console:
Fetching orders...
Orders Retrieved: 7
Generating report...
Report
------------------------
Order Count: 5
Average Value: £204.10
Total Value: £1,020.50
Cancelled orders should not be included in any report calculations.
The application uses GraduateInterviewApp.Client (provided as a pre-built library in libs/). Below is a summary of the public API available.
| Method | Return Type | Description |
|---|---|---|
ApiClient(string dataFilePath) |
— | Constructor. Accepts the path to the orders data file. |
GetOrders() |
List<Order>? |
Retrieves orders synchronously. May return null. |
GetOrdersAsync() |
Task<List<Order>?> |
Asynchronously retrieves orders. May return null. |
| Property | Type | Description |
|---|---|---|
Id |
int |
Unique order identifier. |
Amount |
decimal |
Monetary value of the order. |
IsCancelled |
bool |
Whether the order has been cancelled. |
Tip: Your IDE's IntelliSense will also show documentation for these types.
The business has reported that the application occasionally crashes and sometimes produces incorrect reporting figures.
Investigate the issue(s) and make any fixes you believe are appropriate.