tiago/db_structure #2
23
src/fiber_package/refs.py
Normal file
23
src/fiber_package/refs.py
Normal file
@ -0,0 +1,23 @@
|
||||
from dataclasses import dataclass
|
||||
from pydantic import UUID7
|
||||
from typing import Literal
|
||||
|
||||
@dataclass(slots=True)
|
||||
class SystemRef(Ref):
|
||||
uuid: UUID7
|
||||
collection: Literal["system"] = "system"
|
||||
|
||||
class CommitteeRef(Ref):
|
||||
uuid: UUID7
|
||||
collection: Literal["committee"] = "committee"
|
||||
|
||||
Ref = SystemRef | CommitteeRef
|
||||
|
||||
# TODO....
|
||||
|
||||
|
||||
EntityList = Annotated[list[UUID4], Field(default_factory=list)]
|
||||
GroupList = Annotated[list[UUID4], Field(default_factory=list)]
|
||||
|
||||
EntityRef = UUID4
|
||||
GroupRef = UUID4
|
||||
@ -1,9 +0,0 @@
|
||||
from typing import Annotated
|
||||
from pydantic import RootModel, Field, UUID4
|
||||
|
||||
|
||||
EntityList = Annotated[list[UUID4], Field(default_factory=list)]
|
||||
GroupList = Annotated[list[UUID4], Field(default_factory=list)]
|
||||
|
||||
EntityRef = UUID4
|
||||
GroupRef = UUID4
|
||||
Loading…
x
Reference in New Issue
Block a user