Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/AI_Brain / sub_brains/money_agents/dashboard.cs |
| Date | Not specified in source |
| Repository | Janady13/AI_Brain |
| Revision | 6d0767aad08781eb5c4e1eb14a42ec92c437be78 |
| Branch | copilot/convert-python-files-to-csharp |
| Path or archive member | sub_brains/money_agents/dashboard.cs |
| Original SHA-256 | 0707b8dca38ffcc3042a6a0bed66591dc55285f81e6195db21cb16a276775edf |
| Git blob SHA | e530a99c39e16bc42beeb2a9c494e3a83c4919e0 |
| Reading-copy SHA-256 | 0707b8dca38ffcc3042a6a0bed66591dc55285f81e6195db21cb16a276775edf |
Recovered source transcript
Download complete source text ↓88 lines · 2.4 KB
// Dashboard for money agents
using System;
using System.Collections.Generic;
namespace AIBrain.SubBrains.MoneyAgents
{
public class Dashboard
{
private Dictionary<string, decimal> revenueStreams;
private List<Dictionary<string, object>> activityLog;
public Dashboard()
{
revenueStreams = new Dictionary<string, decimal>();
activityLog = new List<Dictionary<string, object>>();
}
public void AddRevenueStream(string name, decimal amount)
{
if (revenueStreams.ContainsKey(name))
{
revenueStreams[name] += amount;
}
else
{
revenueStreams[name] = amount;
}
LogActivity("revenue_added", new Dictionary<string, object>
{
["stream"] = name,
["amount"] = amount,
["timestamp"] = DateTime.UtcNow
});
}
public decimal GetTotalRevenue()
{
decimal total = 0;
foreach (var kvp in revenueStreams)
{
total += kvp.Value;
}
return total;
}
public Dictionary<string, decimal> GetRevenueStreams()
{
return new Dictionary<string, decimal>(revenueStreams);
}
public List<Dictionary<string, object>> GetActivityLog(int limit = 50)
{
var count = Math.Min(limit, activityLog.Count);
var startIndex = Math.Max(0, activityLog.Count - count);
return activityLog.GetRange(startIndex, count);
}
private void LogActivity(string action, Dictionary<string, object> details)
{
var entry = new Dictionary<string, object>
{
["action"] = action,
["timestamp"] = DateTime.UtcNow
};
foreach (var kvp in details)
{
entry[kvp.Key] = kvp.Value;
}
activityLog.Add(entry);
}
public Dictionary<string, object> GetDashboardSummary()
{
return new Dictionary<string, object>
{
["total_revenue"] = GetTotalRevenue(),
["stream_count"] = revenueStreams.Count,
["activity_count"] = activityLog.Count,
["last_updated"] = DateTime.UtcNow
};
}
}
}