Add weekly consistency goals

This commit is contained in:
hz
2026-08-01 04:14:39 -05:00
parent ecd5da9162
commit 300b230c03
16 changed files with 589 additions and 2 deletions
+10
View File
@@ -178,6 +178,16 @@ public sealed class CreditStore
return ToStatus(account);
}
public async Task<CreditAward?> GetAppliedAwardAsync(string userId, string operationId)
{
var entry = await _ledger.Find(value => value.Id == LedgerId(userId, operationId)
&& value.State == "applied").FirstOrDefaultAsync();
return entry is null || entry.Amount <= 0 ? null : new CreditAward
{
Amount = entry.Amount, ReasonCode = entry.ReasonCode, Description = entry.Description
};
}
public async Task<int> GetBankCycleAsync(string userId)
{
await EnsureAndCleanAsync(userId, _clock.GetUtcNow().UtcDateTime);