Versie 0.2.0

This commit is contained in:
Atreides Assets committed 2026-10-29 11:57:29 +01:00
commit e77d8fd373
495 files changed
+81026

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
// Generated, do not edit. sha256:37f1d463b03d2b5d702238cb632740786fc53e2072e4691719327d700c59d56c
import { capacityReached } from '../license.mjs';
import * as db from '../db.js';
import { counts } from './counts.js';
import { RATE_ONLY_ASSET } from './_shared.js';
import { getBaseCurrency } from './portfolio.js';
function fiatAccountCount() {
return db.one(`SELECT COUNT(*) AS n FROM Account WHERE kind = 'bank'`).n;
}
function assetCount() {
return db.one(`SELECT COUNT(*) AS n FROM Asset WHERE symbol <> ? AND NOT ${RATE_ONLY_ASSET}`,
[getBaseCurrency()]).n;
}
export function currentCount(soort) {
const c = counts();
if (soort === 'assets') return assetCount();
if (soort === 'valuations') return c.valuations;
if (soort === 'fiatAccounts') return fiatAccountCount();
throw new Error(`No counter for capacity '${soort}' yet.`);
}
export function capacityReachedFor(soort) {
return capacityReached(soort, currentCount(soort));
}