API - workouts refactoring

This commit is contained in:
Sam
2022-02-16 17:46:22 +01:00
parent 0b2e2ed5dd
commit 1b4a477544
20 changed files with 81 additions and 184 deletions

View File

@@ -0,0 +1,17 @@
from uuid import UUID
import shortuuid
def encode_uuid(uuid_value: UUID) -> str:
"""
Return short id string from a UUID
"""
return shortuuid.encode(uuid_value)
def decode_short_id(short_id: str) -> UUID:
"""
Return UUID from a short id string
"""
return shortuuid.decode(short_id)