<reponame>jalanb/portals
from marshmallow import fields, post_load
from portals.wwits.apis.rest import BaseSchemaExcludeFields as Schema
from .models import ParmModel, WOEtaModel


class ParmSchema(Schema):
    Version = fields.Str()
    Env = fields.Str()
    UserID = fields.Str()
    Session = fields.Integer()
    Source = fields.Str()
    OrderNum = fields.Str()
    ETA_DateTime = fields.Str()
    PostEdStart = fields.Str()
    CSRCode = fields.Str()
    RC = fields.Integer()
    ResultMsg = fields.Str()

    @post_load
    def make_schema(self, data, **kwargs):
        return ParmModel(**data)


class WOEtaSchema(Schema):
    Parms = fields.Nested(ParmSchema)

    @post_load
    def make_schema(self, data, **kwargs):
        return WOEtaModel(**data)

from marshmallow import fields, post_load
from portals.wwits.apis.rest import BaseSchemaExcludeFields as Schema
from .models import ParmModel, WOEtaModel


class ParmSchema(Schema):
    Version = fields.Str()
    Env = fields.Str()
    UserID = fields.Str()
    Session = fields.Integer()
    Source = fields.Str()
    OrderNum = fields.Str()
    ETA_DateTime = fields.Str()
    PostEdStart = fields.Str()
    CSRCode = fields.Str()
    RC = fields.Integer()
    ResultMsg = fields.Str()

    @post_load
    def make_schema(self, data, **kwargs):
        return ParmModel(**data)


class WOEtaSchema(Schema):
    Parms = fields.Nested(ParmSchema)

    @post_load
    def make_schema(self, data, **kwargs):
        return WOEtaModel(**data)