From 651454cebc6935d82548a979d911b65b7679c5b0 Mon Sep 17 00:00:00 2001
From: Trishna Saeharaseelan <trishna.saeharaseelan@noc.ac.uk>
Date: Thu, 17 Nov 2022 16:50:38 +0000
Subject: [PATCH] refactor: add nested schema for standard vehicle data

---
 vehicle_status.py | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/vehicle_status.py b/vehicle_status.py
index 4b5314a..9e9cc79 100644
--- a/vehicle_status.py
+++ b/vehicle_status.py
@@ -1,7 +1,7 @@
 """
     schema: vehicle-specific decoded status message (DRAFT)
 """
-from . import message_header_schema, api
+from . import message_header_schema, vehicle_schema, api
 from flask_restx import fields
 
 
@@ -13,11 +13,7 @@ vehicle_status_message_schema = api.model(
             required=True,
             description="Message header",
         ),
-        "serial_number": fields.String(
-            required=True,
-            description="vehicle serial number",
-            example="ah-1",
-        ),
+        "platform": fields.Nested(vehicle_schema)
         "time": fields.String(
             required=True,
             description="Timestamp of message",
@@ -28,16 +24,6 @@ vehicle_status_message_schema = api.model(
             description="",  # we can track the version of the AE plan?
             example="",
         ),
-        "platform_ID": fields.Integer(
-            required=True,
-            description="Platform ID",
-            example=2,
-        ),
-        "platform_type": fields.String(
-            required=True,
-            description="The high level type of this vehicle",
-            example="alr",
-        ),
         "platform_state": fields.String(
             required=True,
             description="",
-- 
GitLab