"""This module holds constants used by the ``accounts`` app."""

from extended_choices import Choices

from django.utils.translation import ugettext_lazy as _


# This is the GroupType that contains internal Groups,
# i.e. groups that are necessary to the proper operation
# of any MTP instance.
GROUPTYPE_INTERNAL = 'mtp'

# This is the GroupType that contains job profiles.
# These Groups are used in the assessment feature to create
# competency trees.
GROUPTYPE_JOB_PROFILE = 'job_profile'

# These GroupTypes are used to record more precise data
# about a user's job.
GROUPTYPE_JOB_NAME = 'job_name'
GROUPTYPE_JOB_TYPE = 'job_type'

# This is the GroupType that contains business units.
# Right now these Groups are mostly used for sharing/translation purposes.
GROUPTYPE_BUSINESS_UNIT = 'business_unit'

# This is the GroupType that contains business levels.
# Right now these Groups are mostly used for analytics purposes.
GROUPTYPE_BUSINESS_LEVEL = 'business_unit'

# This is the GroupType that contains business targets (B2B, B2C, ...).
GROUPTYPE_BUSINESS_TARGET = 'business_target'

# This is the GroupType that contains business types.
GROUPTYPE_BUSINESS_TYPE = 'business_type'

# This is the GroupType that contains business zones.
GROUPTYPE_BUSINESS_ZONE = 'business_zone'

COMMON_GROUPTYPES = (
    GROUPTYPE_INTERNAL,
    GROUPTYPE_JOB_PROFILE,
)

# This Group is used to determine if an MTPUser is a trainer.
INTERNAL_GROUP_TRAINER = 'trainer'

# This Group is used to determine if an MTPUser is a trainee.
INTERNAL_GROUP_TRAINEE = 'trainee'

# This Group is used in conjunction with the "Who's who" feature.
INTERNAL_GROUP_WHOSWHO = 'whoswho'

INTERNAL_GROUPS = (
    INTERNAL_GROUP_TRAINER,
    INTERNAL_GROUP_TRAINEE,
    INTERNAL_GROUP_WHOSWHO,
)


POTENTIAL_DUPLICATE_REASONS = Choices(
    ('SAME_LAST_AND_FIRST_NAME', 'same_last_and_first_name', _('Same last and first name')),
    ('USERNAME_CONFLICT', 'username_conflict', _('Conflicting username'))
)
