15 lines
403 B
Python
15 lines
403 B
Python
|
|
from pydantic import BaseModel
|
||
|
|
from typing import List
|
||
|
|
import uuid
|
||
|
|
|
||
|
|
class Task(BaseModel):
|
||
|
|
id: str
|
||
|
|
content: str
|
||
|
|
user: str
|
||
|
|
priority: int # 1 (low) to 5 (high)
|
||
|
|
status: str # pending, approved, printed
|
||
|
|
|
||
|
|
@staticmethod
|
||
|
|
def create(content: str, user: str, priority: int):
|
||
|
|
return Task(id=str(uuid.uuid4()), content=content, user=user, priority=priority, status="pending")
|