# Path: netvisor/schemas/common.py
# class StringSchema(FlattenElementSchema):
#     text = fields.String(load_from='#text')
# 
# Path: netvisor/schemas/fields.py
# class Decimal(fields.Decimal):
#     def _deserialize(self, value, attr, data):
#         return super(Decimal, self)._deserialize(
#             value.replace(',', '.'),
#             attr,
#             data
#         )
# 
#     def serialize(self, attr, obj, accessor=None):
#         value = super(Decimal, self).serialize(attr, obj, accessor)
#         if value is missing:
#             return value
#         return str(value).replace('.', ',')


from marshmallow import Schema, fields
from ..common import StringSchema
from ..fields import Decimal
    :license: MIT, see LICENSE for more details.
"""



class CustomerBaseInformationSchema(Schema):
    internal_identifier = fields.String(allow_none=True)
    external_identifier = fields.String(allow_none=True)
    name = fields.String()
    name_extension = fields.String(allow_none=True)
    customer_group_netvisor_key = fields.Integer()
    customer_group_name = fields.String()
    email = fields.String(allow_none=True)
    email_invoicing_address = fields.String(allow_none=True)
    phone_number = fields.String(allow_none=True)
    fax_number = fields.String(allow_none=True)
    home_page_uri = fields.String(allow_none=True)
    is_active = fields.Boolean()
    street_address = fields.String(allow_none=True)
    city = fields.String(allow_none=True)
    post_number = fields.String(allow_none=True)
    country = fields.Nested(StringSchema, allow_none=True)


class CustomerFinvoiceDetailsSchema(Schema):
    finvoice_address = fields.String(allow_none=True)
    finvoice_router_code = fields.String(allow_none=True)


class CustomerAdditionalInformationSchema(Schema):

# Path: netvisor/schemas/common.py
# class StringSchema(FlattenElementSchema):
#     text = fields.String(load_from='#text')
# 
# Path: netvisor/schemas/fields.py
# class Decimal(fields.Decimal):
#     def _deserialize(self, value, attr, data):
#         return super(Decimal, self)._deserialize(
#             value.replace(',', '.'),
#             attr,
#             data
#         )
# 
#     def serialize(self, attr, obj, accessor=None):
#         value = super(Decimal, self).serialize(attr, obj, accessor)
#         if value is missing:
#             return value
#         return str(value).replace('.', ',')


# Path: netvisor/schemas/customers/get.py
from marshmallow import Schema, fields
from ..common import StringSchema
from ..fields import Decimal

    :license: MIT, see LICENSE for more details.
"""



class CustomerBaseInformationSchema(Schema):
    internal_identifier = fields.String(allow_none=True)
    external_identifier = fields.String(allow_none=True)
    name = fields.String()
    name_extension = fields.String(allow_none=True)
    customer_group_netvisor_key = fields.Integer()
    customer_group_name = fields.String()
    email = fields.String(allow_none=True)
    email_invoicing_address = fields.String(allow_none=True)
    phone_number = fields.String(allow_none=True)
    fax_number = fields.String(allow_none=True)
    home_page_uri = fields.String(allow_none=True)
    is_active = fields.Boolean()
    street_address = fields.String(allow_none=True)
    city = fields.String(allow_none=True)
    post_number = fields.String(allow_none=True)
    country = fields.Nested(StringSchema, allow_none=True)


class CustomerFinvoiceDetailsSchema(Schema):
    finvoice_address = fields.String(allow_none=True)
    finvoice_router_code = fields.String(allow_none=True)


class CustomerAdditionalInformationSchema(Schema):

    balance_limit = Decimal(allow_none=True)