From d27d1e4206329ac491f5ba4ffbfff49efb701ee0 Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <ak@geant.org>
Date: Tue, 26 Nov 2024 16:59:17 +0000
Subject: [PATCH] BGPPeers: reorder fields in accordance to the
 `create_nren_l3_core_service` BGPPeers classes.

---
 .../modify_nren_l3_core_service.py            | 30 +++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/gso/workflows/nren_l3_core_service/modify_nren_l3_core_service.py b/gso/workflows/nren_l3_core_service/modify_nren_l3_core_service.py
index e99a994e..7eaf2e6f 100644
--- a/gso/workflows/nren_l3_core_service/modify_nren_l3_core_service.py
+++ b/gso/workflows/nren_l3_core_service/modify_nren_l3_core_service.py
@@ -67,38 +67,44 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
 
     class IPv4BGPPeer(BaseModel):
         peer_address: IPv4AddressType
-        add_v4_multicast: bool = Field(default=False, exclude=True)
-        ip_type: IPTypes = IPTypes.IPV4
-
-        bfd_enabled: bool = False
-        has_custom_policies: bool = False
         authentication_key: str | None
+        has_custom_policies: bool = False
+        bfd_enabled: bool = False
         multipath_enabled: bool = False
-        send_default_route: bool = False
         is_passive: bool = False
+        add_v4_multicast: bool = Field(default=False, exclude=True)
+        send_default_route: bool = False
 
         @computed_field  # type: ignore[misc]
         @property
         def families(self) -> list[IPFamily]:
             return [IPFamily.V4UNICAST, IPFamily.V4MULTICAST] if self.add_v4_multicast else [IPFamily.V4UNICAST]
 
+        @computed_field  # type: ignore[misc]
+        @property
+        def ip_type(self) -> IPTypes:
+            return IPTypes.IPV4
+
     class IPv6BGPPeer(BaseModel):
         peer_address: IPv6AddressType
-        add_v6_multicast: bool = Field(default=False, exclude=True)
-        ip_type: IPTypes = IPTypes.IPV6
-
-        bfd_enabled: bool = False
-        has_custom_policies: bool = False
         authentication_key: str | None
+        has_custom_policies: bool = False
+        bfd_enabled: bool = False
         multipath_enabled: bool = False
-        send_default_route: bool = False
         is_passive: bool = False
+        add_v6_multicast: bool = Field(default=False, exclude=True)
+        send_default_route: bool = False
 
         @computed_field  # type: ignore[misc]
         @property
         def families(self) -> list[IPFamily]:
             return [IPFamily.V6UNICAST, IPFamily.V6MULTICAST] if self.add_v6_multicast else [IPFamily.V6UNICAST]
 
+        @computed_field  # type: ignore[misc]
+        @property
+        def ip_type(self) -> IPTypes:
+            return IPTypes.IPV6
+
     #  There are three possible scenarios for Edge Ports. They can be added, removed, or their relevant SBP can be
     #  modified.
     removed_ap_list = [
-- 
GitLab