# By: Riasat Ullah
# This file contains values that will remain constant throughout the project.

import datetime

#############################
# Multi region support data
#############################

# regions for data hosting
aws_europe_paris = 'aws-europe-paris'
aws_us_ohio = 'aws-us-ohio'

domain_europe = 'taskcallapp.com'
domain_us = 'us.taskcallapp.com'

# internal - regional url mapping
regional_urls = {
    aws_europe_paris: {
        'url_base': 'https://api.taskcallapp.com',
        'web_app_base_url': 'https://app.taskcallapp.com',
        'integrations_api_base_url': 'https://integrations.taskcallapp.com',
        'allowed_hosts': ["api.taskcallapp.com", "incidents-api.taskcallapp.com", "integrations.taskcallapp.com",
                          "127.0.0.1", "localhost"],
        'domain': domain_europe
    },
    aws_us_ohio: {
        'url_base': 'https://api.us.taskcallapp.com',
        'web_app_base_url': 'https://app.us.taskcallapp.com',
        'integrations_api_base_url': 'https://integrations.us.taskcallapp.com',
        'allowed_hosts': ["api.us.taskcallapp.com", "incidents-api.us.taskcallapp.com",
                          "integrations.us.taskcallapp.com", "127.0.0.1", "localhost"],
        'domain': domain_us
    }
}

regional_test_server_urls = {
    aws_europe_paris: {
        'url_base': 'https://khghc6-test-rest-server.taskcallapp.com',
        'web_app_base_url': 'https://s1vrqp-test-app-server.taskcallapp.com',
        'integrations_api_base_url': 'https://khghc6-test-integrations.taskcallapp.com',
        'allowed_hosts': ["khghc6-test-rest-server.taskcallapp.com", "127.0.0.1",
                          "khghc6-test-incidents-api.taskcallapp.com",
                          "khghc6-test-integrations.taskcallapp.com"],
        'domain': domain_europe
    },
    aws_us_ohio: {
        'url_base': 'https://khghc6-test-rest-server.us.taskcallapp.com',
        'web_app_base_url': 'https://s1vrqp-test-app-server.us.taskcallapp.com',
        'integrations_api_base_url': 'https://khghc6-test-integrations.us.taskcallapp.com',
        'allowed_hosts': ["khghc6-test-rest-server.us.taskcallapp.com", "127.0.0.1",
                          "khghc6-test-incidents-api.us.taskcallapp.com",
                          "khghc6-test-integrations.us.taskcallapp.com"],
        'domain': domain_us
    }
}

##########################
# Everything else
##########################

# internal - access methods
app = 'APP'
call = 'CALL'
email = 'EMAIL'
incidents_api = 'INCIDENTS_API'
integrations_api = 'INTEGRATIONS_API'
internal = 'INTERNAL'
live_call_routing = 'LIVE_CALL_ROUTING'
rundeck = 'RUNDECK'
text = 'TEXT'
web = 'WEBSITE'
webhook = 'WEBHOOK'

# account verification
account_closure_verification = 'ACCOUNT_CLOSING'
new_account_verification = 'NEW_ACCOUNT'
password_reset_verification = 'PASSWORD_RESET'
verification_code_length = 6

# action code conventions
ack_code = 1
resolve_code = 2
escalate_code = 3
standard_code_diff = 10

# analytics (qualitative)
below_ideal_metrics = 'below_ideal'
far_below_ideal_metrics = 'far_below_ideal'
ideal_metrics = 'ideal'

# api access types and versions
api_full_access = 'Full Access'
api_version_incidents_one = 'Incidents API v.1'

# assignee types
group_assignee = 'GROUP'
organization_assignee = 'ORGANIZATION'
policy_assignee = 'POLICY'
team_assignee = 'TEAM'
user_assignee = 'USER'

# check types
check = 'CHECK'
heartbeat = 'HEARTBEAT'

# check ping types
http = 'HTTP'

# conditional routing alert handling values
cancel_alert = 'CANCEL'
normal_alert = 'NORMAL'
resolve_alert = 'RESOLVE'
re_route_alert = 'RE_ROUTE'
re_route_service = 'RE_ROUTE_SERVICE'

# conditional routing rule comparators
rule_contains = 'contains'
rule_equals = 'equals'
rule_exists = 'exists'
rule_matches = 'matches'
rule_not_contains = 'not_contains'
rule_not_equals = 'not_equals'
rule_not_exists = 'not_exists'
rule_not_matches = 'not_matches'

# coupon types
re_engagement_coupon = 'RE-ENGAGEMENT'
welcome_coupon = 'WELCOME'

# currencies
eur_curr = 'EUR'
usd_curr = 'USD'

# database names
prod_db_europe = 'taskcall-prod-db'
prod_db_us = 'taskcall-us-prod-db'
redis_cache_europe = 'taskcall-redis-prod'
redis_cache_us = 'taskcall-us-redis-prod'
test_db_europe = 'taskcall-test-db'
test_db_us = 'taskcall-us-test-db'

# date and time constants
date_format = '%Y%m%d'
date_hyphen_format = '%Y-%m-%d'
date_month_day_format = '%m/%d'
end_date = datetime.date(9999, 1, 1)
end_date_str = '9999-01-01'
end_timestamp = datetime.datetime(9999, 1, 1, 0, 0, 0)
end_timestamp_str = '9999-01-01 00:00:00'
json_timestamp_format = '%Y-%m-%dT%H:%M:%S'
json_timestamp_milli_format = '%Y-%m-%dT%H:%M:%S.%f'
json_timestamp_milli_format_with_tz = '%Y-%m-%dT%H:%M:%S.%fZ'
json_time_format = '%H:%M:%S'
time_format = '%H:%M'
time_words_format = '%I:%M %p'
timestamp_format = '%Y-%m-%d %H:%M:%S'
timestamp_milli_format = '%Y-%m-%d %H:%M:%S.%f'
timestamp_words_format = '%b %d, %Y %I:%M %p'

# discount types
all_discount_type = 'ALL'
live_call_routing_volume_discount_type = 'LIVE_CALL_ROUTING_VOLUME'
user_plan_discount_type = 'USER_PLAN'

# email account types - this is internal account types set on the credentials file
billings_email_account = 'billings'
notifier_email_account = 'notifier'
team_email_account = 'team'

# email related params
email_accept = 'ACCEPT'
email_reject = 'REJECT'
root_destination = 'root'
status_dashboard_url_extension = 'status_dashboard'

# event types
acknowledge_event = 'ACKNOWLEDGE'
add_conference_bridge_event = 'ADD CONFERENCE BRIDGE'
add_impacted_business_service_event = 'ADD IMPACTED BUSINESS SERVICE'
add_responders_event = 'ADD RESPONDERS'
add_subscribers_event = 'ADD SUBSCRIBERS'
call_answered_event = 'CALL ANSWERED'
call_ended_event = 'CALL ENDED'
call_forwarding_event = 'CALL FORWARDING'
call_outgoing_event = 'CALL OUTGOING'
call_voicemail_prompt_event = 'CALL VOICEMAIL PROMPT'
custom_action_event = 'CUSTOM ACTION'
dispatch_event = 'DISPATCH'
edit_title_event = 'EDIT TITLE'
escalate_event = 'ESCALATE'
merge_event = 'MERGE'
notate_event = 'NOTATE'
reassign_event = 'REASSIGN'
remove_impacted_business_service_event = 'REMOVE IMPACTED BUSINESS SERVICE'
remove_subscribers_event = 'REMOVE SUBSCRIBERS'
resolve_event = 'RESOLVE'
run_workflow_event = 'RUN WORKFLOW'
send_chat_message_event = 'SEND CHAT MESSAGE'
send_external_email_event = 'SEND EXTERNAL EMAIL'
send_external_sms_event = 'SEND EXTERNAL SMS'
snooze_event = 'SNOOZE'
status_update_event = 'STATUS UPDATE'
trigger_event = 'TRIGGER'
un_acknowledge_event = 'UN-ACKNOWLEDGE'
un_merge_event = 'UN-MERGE'
update_tags_event = 'UPDATE TAGS'
urgency_amendment_event = 'URGENCY AMENDMENT'

# http request attributes
accept_language_attribute = 'Accept-Language'
authorization_attribute = 'AUTHORIZATION'
ip_address_attribute = 'REMOTE_ADDR'

# incident workflows supported data fields to inject into field values

# incident.id	{{incident.id}}
# created_at	{{incident.created_at}}
# incident.resolved_at	{{incident.resolved_at}}
# incident.title	{{incident.title}}
# incident.status	{{incident.status}}
# incident.url	{{incident.url}}
# incident.urgency	{{incident.urgency}}
# incident.priority	{{incident.priority}}
# incident.service.id	{{incident.service.id}}
# incident.service.name	{{incident.service.name}}

# -- incident_id
# created_on
# resolve_on
# incident_url
# -- title
# -- status
# -- urgency_level
# service_name
# source_payload.*

# step['reassign-1'].field['channel_link']


# ip library info
ip_country_attribute = 'country'
ip_country_code_attribute = 'countryCode'
ip_library_site = 'http://ip-api.com/json/'
ip_timezone_attribute = 'timezone'

# languages
lang_de = 'de'
lang_en = 'en'
lang_es = 'es'
lang_fr = 'fr'

# live call statuses
answered_state = 'ANSWERED'
blocked_state = 'BLOCKED'
message_left_state = 'MESSAGE_LEFT'
no_answer_state = 'NO_ANSWER'
outgoing = 'OUTGOING'

# login attempts
excessive_login_fails = 'EXCESSIVE LOGIN FAILS'
excessive_password_reset_fails = 'EXCESSIVE PASSWORD RESET FAILS'

# onboarding email strategy criteria
application_monitoring = 'application_monitoring'
call_routing = 'call_routing'
chat_ops = 'chat_ops'
ticketing = 'ticketing'

# payment details
handler_stripe = 'STRIPE'

# policy_types
group_policy = 'GROUP'
user_policy = 'USER'

# postmortem report reviewer role
collaborator = 'COLLABORATOR'
reviewer = 'REVIEWER'

# postmortem report statuses
closed = 'CLOSED'
draft = 'DRAFT'
in_review = 'IN_REVIEW'
reviewed = 'REVIEWED'

# request content types
content_type_json = 'application/json'
content_type_url_encoded = 'application/x-www-form-urlencoded'
content_type_xml = 'text/xml'

# service statuses
disabled = 'DISABLED'
enabled = 'ENABLED'
impacted = 'IMPACTED'
maintenance = 'MAINTENANCE'

# sides used in database
incoming_side = 1
outgoing_side = 2

# status page impact types
major_impact = 'MAJOR'
minor_impact = 'MINOR'
no_impact = 'NO_IMPACT'

# status page post types
incident = 'INCIDENT'
status_update = 'STATUS_UPDATE'

# subscription types
add_on_subscription_type = 'ADD_ON'
base_subscription_type = 'BASE'
supplement_subscription_type = 'SUPPLEMENT'

# subscription units
call_unit = 'CALL'
text_unit = 'TEXT'
user_unit = 'USER'

# subscription usage types
api_calls = 'API_CALLS'
email_triggers = 'EMAIL_TRIGGERS'
max_users = 'MAX_USERS'

# task statuses
acknowledged_state = 'ACKNOWLEDGED'
cancelled_state = 'CANCELLED'
completed_state = 'COMPLETED'
grouped_state = 'GROUPED'
identified_state = 'IDENTIFIED'
in_progress_state = 'IN_PROGRESS'
investigating_state = 'INVESTIGATING'
monitoring_state = 'MONITORING'
open_state = 'OPEN'
operational_state = 'OPERATIONAL'
outage_state = 'OUTAGE'
partial_outage_state = 'PARTIAL_OUTAGE'
resolved_state = 'RESOLVED'
scheduled_state = 'SCHEDULED'
suppressed_state = 'SUPPRESSED'
triggered_state = 'TRIGGERED'
verifying_state = 'VERIFYING'

# task urgency levels
minor_urgency = 1
low_urgency = 2
medium_urgency = 3
high_urgency = 4
critical_urgency = 5

# task internal service name
taskcall_service = 'TaskCall'

# phone (text/call) vendors
local = 'LOCAL'
mobile = 'MOBILE'
national = 'NATIONAL'
toll_free = 'TOLL_FREE'
twilio = 'TWILIO'
twilio_magic_number = '+15005550006'

# country codes
all_country_codes = {
    'AF': ['Afghanistan', '93'],
    'AL': ['Albania', '355'],
    'DZ': ['Algeria', '213'],
    'AS': ['American Samoa', '1'],
    'AD': ['Andorra', '376'],
    'AO': ['Angola', '244'],
    'AI': ['Anguilla', '1'],
    'AQ': ['Antarctica', '672'],
    'AG': ['Antigua and Barbuda', '1'],
    'AR': ['Argentina', '54'],
    'AM': ['Armenia', '374'],
    'AW': ['Aruba', '297'],
    'AU': ['Australia', '61'],
    'AT': ['Austria', '43'],
    'AZ': ['Azerbaijan', '994'],
    'BS': ['Bahamas', '1'],
    'BH': ['Bahrain', '973'],
    'BD': ['Bangladesh', '880'],
    'BB': ['Barbados', '1'],
    'BY': ['Belarus', '375'],
    'BE': ['Belgium', '32'],
    'BZ': ['Belize', '501'],
    'BJ': ['Benin', '229'],
    'BM': ['Bermuda', '1'],
    'BT': ['Bhutan', '975'],
    'BO': ['Bolivia', '591'],
    'BA': ['Bosnia and Herzegovina', '387'],
    'BW': ['Botswana', '267'],
    'BR': ['Brazil', '55'],
    'IO': ['British Indian Ocean Territory', '246'],
    'VG': ['British Virgin Islands', '1'],
    'BN': ['Brunei', '673'],
    'BG': ['Bulgaria', '359'],
    'BF': ['Burkina Faso', '226'],
    'BI': ['Burundi', '257'],
    'KH': ['Cambodia', '855'],
    'CM': ['Cameroon', '237'],
    'CA': ['Canada', '1'],
    'CV': ['Cape Verde', '238'],
    'KY': ['Cayman Islands', '1'],
    'CF': ['Central African Republic', '236'],
    'TD': ['Chad', '235'],
    'CL': ['Chile', '56'],
    'CN': ['China', '86'],
    'CX': ['Christmas Island', '61'],
    'CC': ['Cocos Islands', '61'],
    'CO': ['Colombia', '57'],
    'KM': ['Comoros', '269'],
    'CK': ['Cook Islands', '682'],
    'CR': ['Costa Rica', '506'],
    'HR': ['Croatia', '385'],
    'CU': ['Cuba', '53'],
    'CW': ['Curacao', '599'],
    'CY': ['Cyprus', '357'],
    'CZ': ['Czech Republic', '420'],
    'CD': ['Democratic Republic of the Congo', '243'],
    'DK': ['Denmark', '45'],
    'DJ': ['Djibouti', '253'],
    'DM': ['Dominica', '1'],
    'DO': ['Dominican Republic', '1'],
    'TL': ['East Timor', '670'],
    'EC': ['Ecuador', '593'],
    'EG': ['Egypt', '20'],
    'SV': ['El Salvador', '503'],
    'GQ': ['Equatorial Guinea', '240'],
    'ER': ['Eritrea', '291'],
    'EE': ['Estonia', '372'],
    'ET': ['Ethiopia', '251'],
    'FK': ['Falkland Islands', '500'],
    'FO': ['Faroe Islands', '298'],
    'FJ': ['Fiji', '679'],
    'FI': ['Finland', '358'],
    'FR': ['France', '33'],
    'PF': ['French Polynesia', '689'],
    'GA': ['Gabon', '241'],
    'GM': ['Gambia', '220'],
    'GE': ['Georgia', '995'],
    'DE': ['Germany', '49'],
    'GH': ['Ghana', '233'],
    'GI': ['Gibraltar', '350'],
    'GR': ['Greece', '30'],
    'GL': ['Greenland', '299'],
    'GD': ['Grenada', '1'],
    'GU': ['Guam', '1'],
    'GT': ['Guatemala', '502'],
    'GG': ['Guernsey', '44'],
    'GN': ['Guinea', '224'],
    'GW': ['Guinea-Bissau', '245'],
    'GY': ['Guyana', '592'],
    'HT': ['Haiti', '509'],
    'HN': ['Honduras', '504'],
    'HK': ['Hong Kong', '852'],
    'HU': ['Hungary', '36'],
    'IS': ['Iceland', '354'],
    'IN': ['India', '91'],
    'ID': ['Indonesia', '62'],
    'IR': ['Iran', '98'],
    'IQ': ['Iraq', '964'],
    'IE': ['Ireland', '353'],
    'IM': ['Isle of Man', '44'],
    'IL': ['Israel', '972'],
    'IT': ['Italy', '39'],
    'CI': ['Ivory Coast', '225'],
    'JM': ['Jamaica', '1'],
    'JP': ['Japan', '81'],
    'JE': ['Jersey', '44'],
    'JO': ['Jordan', '962'],
    'KZ': ['Kazakhstan', '7'],
    'KE': ['Kenya', '254'],
    'KI': ['Kiribati', '686'],
    'XK': ['Kosovo', '383'],
    'KW': ['Kuwait', '965'],
    'KG': ['Kyrgyzstan', '996'],
    'LA': ['Laos', '856'],
    'LV': ['Latvia', '371'],
    'LB': ['Lebanon', '961'],
    'LS': ['Lesotho', '266'],
    'LR': ['Liberia', '231'],
    'LY': ['Libya', '218'],
    'LI': ['Liechtenstein', '423'],
    'LT': ['Lithuania', '370'],
    'LU': ['Luxembourg', '352'],
    'MO': ['Macau', '853'],
    'MK': ['Macedonia', '389'],
    'MG': ['Madagascar', '261'],
    'MW': ['Malawi', '265'],
    'MY': ['Malaysia', '60'],
    'MV': ['Maldives', '960'],
    'ML': ['Mali', '223'],
    'MT': ['Malta', '356'],
    'MH': ['Marshall Islands', '692'],
    'MR': ['Mauritania', '222'],
    'MU': ['Mauritius', '230'],
    'YT': ['Mayotte', '262'],
    'MX': ['Mexico', '52'],
    'FM': ['Micronesia', '691'],
    'MD': ['Moldova', '373'],
    'MC': ['Monaco', '377'],
    'MN': ['Mongolia', '976'],
    'ME': ['Montenegro', '382'],
    'MS': ['Montserrat', '1'],
    'MA': ['Morocco', '212'],
    'MZ': ['Mozambique', '258'],
    'MM': ['Myanmar', '95'],
    'NA': ['Namibia', '264'],
    'NR': ['Nauru', '674'],
    'NP': ['Nepal', '977'],
    'NL': ['Netherlands', '31'],
    'AN': ['Netherlands Antilles', '599'],
    'NC': ['New Caledonia', '687'],
    'NZ': ['New Zealand', '64'],
    'NI': ['Nicaragua', '505'],
    'NE': ['Niger', '227'],
    'NG': ['Nigeria', '234'],
    'NU': ['Niue', '683'],
    'KP': ['North Korea', '850'],
    'MP': ['Northern Mariana Islands', '1'],
    'NO': ['Norway', '47'],
    'OM': ['Oman', '968'],
    'PK': ['Pakistan', '92'],
    'PW': ['Palau', '680'],
    'PS': ['Palestine', '970'],
    'PA': ['Panama', '507'],
    'PG': ['Papua New Guinea', '675'],
    'PY': ['Paraguay', '595'],
    'PE': ['Peru', '51'],
    'PH': ['Philippines', '63'],
    'PN': ['Pitcairn', '64'],
    'PL': ['Poland', '48'],
    'PT': ['Portugal', '351'],
    'PR': ['Puerto Rico', '1'],
    'QA': ['Qatar', '974'],
    'CG': ['Republic of the Congo', '242'],
    'RE': ['Reunion', '262'],
    'RO': ['Romania', '40'],
    'RU': ['Russia', '7'],
    'RW': ['Rwanda', '250'],
    'BL': ['Saint Barthelemy', '590'],
    'SH': ['Saint Helena', '290'],
    'KN': ['Saint Kitts and Nevis', '1'],
    'LC': ['Saint Lucia', '1'],
    'MF': ['Saint Martin', '590'],
    'PM': ['Saint Pierre and Miquelon', '508'],
    'VC': ['Saint Vincent and the Grenadines', '1'],
    'WS': ['Samoa', '685'],
    'SM': ['San Marino', '378'],
    'ST': ['Sao Tome and Principe', '239'],
    'SA': ['Saudi Arabia', '966'],
    'SN': ['Senegal', '221'],
    'RS': ['Serbia', '381'],
    'SC': ['Seychelles', '248'],
    'SL': ['Sierra Leone', '232'],
    'SG': ['Singapore', '65'],
    'SX': ['Sint Maarten', '1'],
    'SK': ['Slovakia', '421'],
    'SI': ['Slovenia', '386'],
    'SB': ['Solomon Islands', '677'],
    'SO': ['Somalia', '252'],
    'ZA': ['South Africa', '27'],
    'KR': ['South Korea', '82'],
    'SS': ['South Sudan', '211'],
    'ES': ['Spain', '34'],
    'LK': ['Sri Lanka', '94'],
    'SD': ['Sudan', '249'],
    'SR': ['Suriname', '597'],
    'SJ': ['Svalbard and Jan Mayen', '47'],
    'SZ': ['Swaziland', '268'],
    'SE': ['Sweden', '46'],
    'CH': ['Switzerland', '41'],
    'SY': ['Syria', '963'],
    'TW': ['Taiwan', '886'],
    'TJ': ['Tajikistan', '992'],
    'TZ': ['Tanzania', '255'],
    'TH': ['Thailand', '66'],
    'TG': ['Togo', '228'],
    'TK': ['Tokelau', '690'],
    'TO': ['Tonga', '676'],
    'TT': ['Trinidad and Tobago', '1'],
    'TN': ['Tunisia', '216'],
    'TR': ['Turkey', '90'],
    'TM': ['Turkmenistan', '993'],
    'TC': ['Turks and Caicos Islands', '1'],
    'TV': ['Tuvalu', '688'],
    'VI': ['U.S. Virgin Islands', '1'],
    'UG': ['Uganda', '256'],
    'UA': ['Ukraine', '380'],
    'AE': ['United Arab Emirates', '971'],
    'GB': ['United Kingdom', '44'],
    'US': ['United States', '1'],
    'UY': ['Uruguay', '598'],
    'UZ': ['Uzbekistan', '998'],
    'VU': ['Vanuatu', '678'],
    'VA': ['Vatican', '379'],
    'VE': ['Venezuela', '58'],
    'VN': ['Vietnam', '84'],
    'WF': ['Wallis and Futuna', '681'],
    'EH': ['Western Sahara', '212'],
    'YE': ['Yemen', '967'],
    'ZM': ['Zambia', '260'],
    'ZW': ['Zimbabwe', '263']
}

# country codes of EU member states - this will be used to set default EUR currency
eu_union_country_codes = ['AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'EL', 'ES',
                          'FI', 'FR', 'HR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'MT',
                          'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK']

us_region_country_codes = ['AI', 'AR', 'AW', 'BS', 'BB', 'BL', 'BM', 'BO', 'BR', 'BZ', 'CA', 'CL', 'CO', 'CR', 'CU',
                           'CW', 'DM', 'DO', 'EC', 'FK', 'GL', 'GP', 'GT', 'GY', 'HT', 'HN', 'JM', 'KN', 'KY', 'LC',
                           'MF', 'MX', 'MS', 'NI', 'PA', 'PY', 'PE', 'PR', 'PM', 'SR', 'SV', 'TT', 'US', 'UY', 'VC',
                           'VE', 'VG']
