Skip to content
Snippets Groups Projects
Commit 28d57f63 authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Fix dateformats

Setra expects datetime.datetime, not datetime.date
In addition, voucherdate is in fact not optional.
parent 5162e916
No related branches found
No related tags found
1 merge request!10Fix dateformats
Pipeline #59908 passed
......@@ -33,7 +33,7 @@ class BaseModel(pydantic.BaseModel):
class Transaction(BaseModel):
account: str
amount: float
transdate: Optional[datetime.date]
transdate: Optional[datetime.datetime]
curamount: Optional[float]
currency: Optional[str]
description: str
......@@ -51,7 +51,7 @@ class Transaction(BaseModel):
class Voucher(BaseModel):
voucherdate: Optional[datetime.date]
voucherdate: datetime.datetime
exref: Optional[str]
voucherno: int
transactions: typing.List[Transaction]
......
......@@ -8,12 +8,12 @@
{
"exref": 1,
"voucherno": 66,
"voucherdate": "2020-10-14 00:00",
"transactions": [
{
"voucherid": 66,
"account": 1,
"amount": 1,
"transdate": 1,
"transdate": "2020-10-14 00:00",
"curamount": 1,
"currency": 1,
"description": 1,
......@@ -30,10 +30,9 @@
"extinvref": 1
},
{
"voucherid": 66,
"account": 2,
"amount": 2,
"transdate": 2,
"transdate": "2020-10-14 00:00",
"curamount": 2,
"currency": 2,
"description": 2,
......
{
"exref": 3,
"voucherno": 4,
"voucherdate": "2020-10-14 00:00",
"transactions": [
{
"voucherid": 66,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment