<commit_before># -*- coding: utf-8 -*-
'''
    Mango accounts models and messages.
'''

# This file is part of mango.

# Distributed under the terms of the last AGPL License.
# The full license is in the file LICENCE, distributed as part of this software.

__author__ = '<NAME>'


import uuid

from schematics import models
from schematics import types
from schematics.types import compound

from mango.messages import Resource



class RequiredBase(models.Model):
    '''
    '''
    uuid = types.UUIDType(default=uuid.uuid4)
    active = types.BooleanType(default=True)
    status = types.StringType(required=False)
    account = types.StringType(required=True)
    name = types.StringType(required=False)
    email = types.EmailType(required=True)
    is_admin = types.BooleanType(default=False)
    phone_number = types.StringType()
    country_code = types.StringType()
    timezone = types.StringType()
    location = types.StringType()
    resources = compound.ModelType(Resource)
    
    routes = compound.ListType(compound.ModelType(Route))
    url = types.URLType(required=False)

    # move this to howler and spider?
    max_channels = types.IntType()

class CleanBase(models.Model):
    '''
    '''
    uuid = types.UUIDType()
    active = types.BooleanType()
    status = types.StringType()
    account = types.StringType()
    name = types.StringType()
    email = types.EmailType()
    is_admin = types.BooleanType()
    phone_number = types.StringType()
    country_code = types.StringType()
    timezone = types.StringType()
    location = types.StringType()
    resources = compound.ModelType(Resource)
    
    routes = compound.ListType(compound.ModelType(Route))

    url = types.URLType()

    # move this to howler or spider?
    max_channels = types.IntType()

class BaseAccount(models.Model):
    '''
        Base account
    '''
    uuid = types.UUIDType(default=uuid.uuid4)
    active = types.BooleanType(default=True)
    status = types.StringType(required=False)
    account = types.StringType(required=True)
    name = types.StringType(required=False)
    email = types.EmailType(required=True)
    is_admin = types.BooleanType(default=False)
    phone_number = types.StringType()
    country_code = types.StringType()
    timezone = types.StringType()
    location = types.StringType()
    resources = compound.ModelType(Resource)
    
    routes = compound.ListType(compound.ModelType(Route))

    uri = types.StringType(required=False)
    url = types.URLType() #?

    # move this to howler and spider?
    max_channels = types.IntType()


class User(BaseAccount):
    '''
        User account
    '''
    first_name = types.StringType()
    last_name = types.StringType()
    account_type = types.StringType(default='user')
    orgs = compound.ListType(types.StringType())
    password = types.StringType(required=True)
    
    # move company to baseAccount class?
    company = types.StringType()

    # clx stuff, please move this to another place that makes more sense.
    UserId = types.IntType()
    AccountNum = types.StringType()


class ModifyUser(BaseAccount):
    '''
        Modify account
    '''
    account_type = types.StringType(default='user')
    orgs = compound.ListType(types.StringType())
    password = types.StringType()
    
    # move company to baseAccount class?
    company = types.StringType()

    # clx stuff, please move this to another place that makes more sense.
    UserId = types.IntType()
    AccountNum = types.StringType()


class Team(models.Model):
    '''
        Org team
    '''
    name = types.StringType(required=True)
    permission = types.StringType(choices=['read',
                                           'write',
                                           'admin'], required=True)
    members = compound.ListType(types.StringType())
    resources = compound.ModelType(Resource)


class Org(BaseAccount):
    '''
        Org account
    '''
    account_type = types.StringType(default='org')
    
    # tests for members and teams.
    members = compound.ListType(types.StringType())<commit_msg>keep it clean<commit_after># -*- coding: utf-8 -*-
'''
    Mango accounts models and messages.
'''

# This file is part of mango.

# Distributed under the terms of the last AGPL License.
# The full license is in the file LICENCE, distributed as part of this software.

__author__ = '<NAME>'


import uuid

from schematics import models
from schematics import types
from schematics.types import compound

from mango.messages import Resource



class RequiredBase(models.Model):
    '''
        Required base class
    '''
    active = types.BooleanType(default=True)
    status = types.StringType(required=False)
    account = types.StringType(required=True)
    name = types.StringType(required=False)
    email = types.EmailType(required=True)
    is_admin = types.BooleanType(default=False)
    phone_number = types.StringType()
    country_code = types.StringType()
    timezone = types.StringType()
    company = types.StringType()
    location = types.StringType()
    resources = compound.ModelType(Resource)
    routes = compound.ListType(compound.ModelType(Route))
    url = types.URLType(required=False)
    max_channels = types.IntType()

class CleanBase(models.Model):
    '''
        Clean base class
    '''
    active = types.BooleanType()
    status = types.StringType()
    account = types.StringType()
    name = types.StringType()
    email = types.EmailType()
    is_admin = types.BooleanType()
    phone_number = types.StringType()
    country_code = types.StringType()
    timezone = types.StringType()
    company = types.StringType()
    location = types.StringType()
    resources = compound.ModelType(Resource)
    routes = compound.ListType(compound.ModelType(Route))
    url = types.URLType()
    max_channels = types.IntType()

class BaseAccount(RequiredBase):
    '''
        Base account
    '''
    uuid = types.UUIDType(default=uuid.uuid4)

class CleanBaseAccount(CleanBase):
    '''
        Clean base account
    '''
    uuid = types.UUIDType()

class User(BaseAccount):
    '''
        User account
    '''
    first_name = types.StringType()
    last_name = types.StringType()
    account_type = types.StringType(default='user')
    orgs = compound.ListType(types.StringType())
    password = types.StringType(required=True)
    
    # move company to baseAccount class?
    company = types.StringType()

    # clx stuff, please move this to another place that makes more sense.
    UserId = types.IntType()
    AccountNum = types.StringType()


class ModifyUser(CleanBaseAccount):
    '''
        Modify account
    '''
    first_name = types.StringType()
    last_name = types.StringType()
    account_type = types.StringType(default='user')
    orgs = compound.ListType(types.StringType())
    password = types.StringType()

    # clx stuff, please move this to another place that makes more sense.
    UserId = types.IntType()
    AccountNum = types.StringType()


class Team(models.Model):
    '''
        Org team
    '''
    name = types.StringType(required=True)
    permission = types.StringType(choices=['read',
                                           'write',
                                           'admin'], required=True)
    members = compound.ListType(types.StringType())
    resources = compound.ModelType(Resource)


class Org(BaseAccount):
    '''
        Org account
    '''
    account_type = types.StringType(default='org')
    
    # tests for members and teams.
    members = compound.ListType(types.StringType())
{'fraction_non_alphanumeric': 0.10939357907253269, 'fraction_numerical': 0.0006605892456070815, 'mean_word_length': 3.03948772678762, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1431588', 'n_tokens_mistral': 2161, 'n_tokens_neox': 2135, 'n_words': 509}