support-organizer/backend/fgo-request-manager/models/requestentry.py
2023-11-24 20:50:18 +01:00

31 lines
1.3 KiB
Python

import marshmallow as ma
from .requests import RequestStatus
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)
modifiers = ma.fields.List(ma.fields.String(example="HYPER"))
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")
status = ma.fields.Enum(RequestStatus)