Add authenticated finance REST API

This commit is contained in:
kai
2026-09-09 09:47:56 +02:00
parent afc6f74f36
commit ad452045be
13 changed files with 760 additions and 44 deletions
+6 -1
View File
@@ -64,6 +64,11 @@ ALIASES = {
def canonical_name(value):
name = ' '.join(str(value).split())
name = re.sub(r'^(dividende[n]?|ausschüttung)\s+', '', name, flags=re.I)
if not name or len(name) > 150:
if not name or not name_key(name) or len(name) > 150:
raise ValueError('Positionsname muss zwischen 1 und 150 Zeichen lang sein.')
return ALIASES.get(name_key(name), name)
def decimal_string(amount):
"""Represent integer cents in JSON without a binary float conversion."""
return f'{Decimal(amount) / 100:.2f}'