Skip to content

Commit 9754ccb

Browse files
committed
[AI:Coder, HUMAN:-, MODEL: Claude 3.7 Sonnet] (#1) Add ShowCustomersWithOverdueOrdersConsoleCommand
1 parent 03866e1 commit 9754ccb

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using AppBoot.DependencyInjection;
2+
using Contracts.ConsoleUi;
3+
using Contracts.Sales;
4+
5+
namespace Sales.ConsoleCommands;
6+
7+
[Service(typeof(IConsoleCommand))]
8+
internal sealed class ShowCustomersWithOverdueOrdersConsoleCommand(IConsole console, ICustomerService customerService) : IConsoleCommand
9+
{
10+
public string MenuLabel => "Show customers with overdue orders";
11+
12+
public void Execute()
13+
{
14+
console.WriteLine("Retrieving customers with overdue orders...");
15+
16+
CustomerOverdueOrdersData[] customers = customerService.GetCustomersWithOverdueOrders();
17+
18+
if (customers.Length == 0)
19+
{
20+
console.WriteLine("No customers with overdue orders found.");
21+
return;
22+
}
23+
24+
foreach (var c in customers)
25+
{
26+
console.WriteEntity(c);
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)