namespace PowderCoating.Application.Interfaces;
///
/// Keeps Account.CurrentBalance in sync with double-entry transactions.
/// DebitAsync / CreditAsync update the balance in the normal-balance direction
/// for each account sub-type, but do NOT call CompleteAsync — the caller must
/// persist by calling IUnitOfWork.CompleteAsync / CommitTransactionAsync.
/// RecalculateAllAsync is the exception: it saves internally and is safe to call standalone.
///
public interface IAccountBalanceService
{
///
/// Applies a debit to the account.
/// Debit-normal accounts (Asset / Expense / COGS): balance increases.
/// Credit-normal accounts (Liability / Equity / Revenue): balance decreases.
/// No-op when accountId is null or amount is zero.
///
Task DebitAsync(int? accountId, decimal amount);
///
/// Applies a credit to the account.
/// Debit-normal accounts: balance decreases.
/// Credit-normal accounts: balance increases.
/// No-op when accountId is null or amount is zero.
///
Task CreditAsync(int? accountId, decimal amount);
///
/// Recomputes CurrentBalance for every active account in the company by replaying all
/// transactions through LedgerService. Saves internally. Use after import or to fix drift.
///
Task RecalculateAllAsync(int companyId);
}