actualtap-py
actualtap-py copied to clipboard
Issue with amount format
Can we allow different time zones to allow different formats.
"msg": "Input should be a valid decimal",
"input": "23,27"
Can I have an example of the payload that is expected for the api?
You can find the function with its validator here. Here's the code block:
def validate_amount(cls, v):
try:
return Decimal(str(v)) if v else Decimal(0)
except Exception:
raise ValueError("Invalid amount format. Must be a valid decimal number.")
From what I can tell in the iOS shortcut actions it grabs the dictionary from shortcut input, replaces [^\d.,] with World for the value with the key of amount, then gets the numbers from the amount text. So it should look for both periods and commas. Is your original message in this issue the full error message? Was there more in the payload?
Comma separated numbers should be working
See:
https://github.com/bobokun/actualtap-py/blob/f85101958df2d9a1b135845c21de9d7531619b14/tests/test_schemas.py#L41-L44