From 36d7d6e4e1e0b57202090bc99bd33b39719217be Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Mon, 29 Sep 2025 20:42:53 +0100 Subject: [PATCH] Add GUID. Closes #10 --- data/spot.py | 3 +++ webassets/apidocs/openapi.yml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/data/spot.py b/data/spot.py index 50f3761..a2a6966 100644 --- a/data/spot.py +++ b/data/spot.py @@ -1,4 +1,5 @@ import json +import uuid from dataclasses import dataclass from datetime import datetime @@ -15,6 +16,8 @@ from core.utils import infer_mode_family_from_mode, infer_band_from_freq, infer_ # Data class that defines a spot. @dataclass class Spot: + # Globally unique identifier for the spot + guid: str = str(uuid.uuid4()) # Callsign of the operator that has been spotted dx_call: str = None # Callsign of the operator that has spotted them diff --git a/webassets/apidocs/openapi.yml b/webassets/apidocs/openapi.yml index 1d56299..704e583 100644 --- a/webassets/apidocs/openapi.yml +++ b/webassets/apidocs/openapi.yml @@ -223,6 +223,10 @@ components: Spot: type: object properties: + guid: + type: string + description: Globally unique identifier to distinguish this spot from any others. + example: d8a3f1b6-cb73-464e-b717-54b7004aa04f dx_call: type: string description: Callsign of the operator that has been spotted