package store import ( "context" "errors" bootnodezap "github.com/hanzoai/bootnode/zap/gen" ) // UsageStore persists per-org/per-project compute-unit accounting. // Hot-path counters live in deps.MQ (Redis-equivalent), durable // accounting lives here in per-tenant SQLite, and roll-ups sync to // Commerce via deps.Commerce.RecordUsage on a timer. type UsageStore struct { base BaseClient } // NewUsageStore builds the per-tenant usage store. func NewUsageStore(b BaseClient) *UsageStore { return &UsageStore{base: b} } // Append writes one billable call. // // TODO(bootnode-port): port from bootnode/core/billing/tracker.py func (s *UsageStore) Append(ctx context.Context, r bootnodezap.UsageRecord) error { _ = ctx _ = r return errors.New("store.UsageStore.Append: not implemented") } // Summary aggregates usage over (start, end). // // TODO(bootnode-port): port from bootnode/api/billing/__init__.py:usage_summary func (s *UsageStore) Summary(ctx context.Context, orgID string, start, end int64) (bootnodezap.UsageSummary, error) { _ = ctx _ = orgID _ = start _ = end return bootnodezap.UsageSummary{}, errors.New("store.UsageStore.Summary: not implemented") }