From e2da0cf0991b7593060dc1e920d2c83793ccb1a0 Mon Sep 17 00:00:00 2001 From: Guy Khmelnitsky <3136012+GuyKh@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:36:39 +0200 Subject: [PATCH] fix: Fix object ordering (#152) --- iec_api/models/invoice.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iec_api/models/invoice.py b/iec_api/models/invoice.py index b0c7ca7..3d66538 100644 --- a/iec_api/models/invoice.py +++ b/iec_api/models/invoice.py @@ -65,12 +65,6 @@ class Invoice(DataClassDictMixin): invoice_id: int = field(metadata=field_options(alias="invoiceId")) contract_number: int = field(metadata=field_options(alias="contractNumber")) order_number: int = field(metadata=field_options(alias="orderNumber")) - full_date: Optional[datetime] = field(default=None, metadata=field_options(alias="fullDate")) - from_date: Optional[datetime] = field(default=None, metadata=field_options(alias="fromDate")) - to_date: Optional[datetime] = field(default=None, metadata=field_options(alias="toDate")) - last_date: Optional[date] = field( - default=None, metadata=field_options(alias="lastDate", serialization_strategy=FormattedDate("%d/%m/%Y")) - ) invoice_payment_status: int = field(metadata=field_options(alias="invoicePaymentStatus")) document_id: str = field(metadata=field_options(alias="documentID")) days_period: str = field(metadata=field_options(alias="daysPeriod")) @@ -82,6 +76,12 @@ class Invoice(DataClassDictMixin): meter_readings: list[MeterReading] = field( metadata=field_options(alias="meterReadings"), default_factory=lambda: [] ) + full_date: Optional[datetime] = field(default=None, metadata=field_options(alias="fullDate")) + from_date: Optional[datetime] = field(default=None, metadata=field_options(alias="fromDate")) + to_date: Optional[datetime] = field(default=None, metadata=field_options(alias="toDate")) + last_date: Optional[date] = field( + default=None, metadata=field_options(alias="lastDate", serialization_strategy=FormattedDate("%d/%m/%Y")) + ) @classmethod def __post_deserialize__(cls, obj: "Invoice") -> "Invoice":