C# · Track 7 · Tutorial 2 of 5
Check it ran
The morning after, check that last night's run recalculated your month and took your consolidation request - before anyone reads the reports.
You will needA month and a consolidation request from the earlier tutorials, and a night since.
By the endA script that tells you, each morning, whether the figures are ready.
1What to check, the morning after
Two things say whether last night's run took your work: the month's request - is it recalculated? - and the consolidation request - did the run take it?
2Write the check
Create CheckRun.cs. It takes the two IDs your scripts printed:
CheckRun.cs
// CheckRun.cs - checks, the morning after, whether last night's run took your work.
// dotnet run -- CheckRun <trial balance request id> <consolidation request id>
public static class CheckRun
{
public static async Task Run(string[] args)
{
if (args.Length < 2)
{
Console.WriteLine("Usage: dotnet run -- CheckRun <trial balance request id> <consolidation request id>");
return;
}
var (monthRequest, consolidationRequest) = (args[0], args[1]);
var month = (await Brizo.Call("GET", $"/organisations/{Brizo.CompanyId}/requests/{monthRequest}")).Body!;
Console.WriteLine($"Trial balance request {monthRequest}: recalculation {month["recalculation"]}");
if (month["recalculation"]!.ToString() == "failed")
{
Console.WriteLine($" failed at {month["recalculation_step"]}");
}
var run = (await Brizo.Call("GET", $"/organisations/{Brizo.CompanyId}/consolidation-requests/{consolidationRequest}")).Body!["data"]!;
Console.WriteLine($"Consolidation request {consolidationRequest}: {run["status"]}"
+ (run["dispatched_at"] is not null ? $" at {run["dispatched_at"]}" : ""));
}
}
3Run it
dotnet run -- CheckRun 91 12Check
Trial balance request 91: recalculation done
Consolidation request 12: dispatched at 2026-10-03T01:40:03+08:00Use your own IDs. done means the month is in the reports.
4If something failed
- A month's
recalculationoffailednames the step it failed at. Send the month again with a new key to try again. - A consolidation request of
failedisn't tried again. Ask for a new one. - Still
pendingin the morning means the run hasn't taken it yet.
Want more detail? See the documentation