support-organizer/backend/fgo-request-manager/models/requestentry.py

31 lines
1.3 KiB
Python
Raw Normal View History

2023-10-02 18:18:21 +00:00
import marshmallow as ma
2023-11-24 19:50:18 +00:00
from .requests import RequestStatus
2023-10-02 18:18:21 +00:00
class BaseField(ma.Schema):
id = ma.fields.Integer(description="Atlas Academy id")
image = ma.fields.Url(description="URL to atlas image")
class ServantField(BaseField):
name = ma.fields.String(description="Name of servant", example="Scáthach")
level = ma.fields.Integer(description="Servant level", example=120)
2023-10-03 16:25:35 +00:00
modifiers = ma.fields.List(ma.fields.String(example="HYPER"))
2023-10-02 18:18:21 +00:00
class CeField(BaseField):
name = ma.fields.String(description="Name of CE", example="Holy Night Supper")
mlb = ma.fields.Boolean(description="If the CE should be MLB or not", example=True)
class RequestFieldContent(ma.Schema):
servant = ma.fields.Nested(ServantField)
ce = ma.fields.Nested(CeField)
class RequestPostData(ma.Schema):
username = ma.fields.String(description="Username of the requesting person", example="Firq")
description = ma.fields.String(description="Short description for what the request is used", example="DB 7T attempts with Scathach")
friendcode = ma.fields.String(description="Friendcode of the requesting person", example="000,000,000")
request = ma.fields.Nested(RequestFieldContent)
class RequestDatabaseEntry(RequestPostData):
uuid = ma.fields.String(description="UUID v4 of the request")
2023-10-03 16:25:35 +00:00
status = ma.fields.Enum(RequestStatus)