"""
    Mapping between steps in the pre-qualification stage and the questions on each
    step. Useful for showing a human readable link and message when a question is not
    answered. The user can click the link to take them back to the step containing the
    unanswered question.
"""
pre_qual_step_question_mapping = {
    '01': {
        'married_marriage_like'
    },
    '02': {
        'lived_in_bc',
        'lived_in_bc_at_least_year'
    },
    '03': {
        'separation_date',
        'try_reconcile_after_separated',
        'reconciliation_period'
    },
    '04': {
        'children_of_marriage',
        'number_children_under_19',
        'number_children_over_19',
        'children_financial_support',
        'children_live_with_others'
    },
    '05': {
        'original_marriage_certificate',
        'provide_certificate_later',
        'marriage_certificate_in_english'
    },
    '06': {
        'divorce_reason',
    }
}

children_substep_question_mapping = {
    'your_children': {
        'claimant_children'
    },
    'income_expenses': {
        'how_will_calculate_income',
        'annual_gross_income',
        'spouse_annual_gross_income',
        'payor_monthly_child_support_amount',
        'special_extraordinary_expenses',
        'child_care_expenses',
        'children_healthcare_premiums',
        'health_related_expenses',
        'extraordinary_educational_expenses',
        'post_secondary_expenses',
        'extraordinary_extracurricular_expenses',
        'total_section_seven_expenses',
        'your_proportionate_share_percent',
        'your_proportionate_share_amount',
        'spouse_proportionate_share_percent',
        'spouse_proportionate_share_amount',
        'describe_order_special_extra_expenses',
    },
    'facts': {
        'child_support_payor',
        # Fact sheet B
        'number_of_children',
        'time_spent_with_you',
        'time_spent_with_spouse',
        'your_child_support_paid_b',
        'your_spouse_child_support_paid_b',
        'additional_relevant_spouse_children_info',
        # Fact sheet C
        'number_of_children_claimant',
        'your_spouse_child_support_paid_c',
        'number_of_children_claimant_spouse',
        'your_child_support_paid_c',
        # Fact sheet D
        'agree_to_guideline_child_support_amount',
        'appropriate_spouse_paid_child_support',
        'suggested_child_support',
        # Fact sheet E
        'claiming_undue_hardship',
        'claimant_debts',
        'claimant_expenses',
        'supporting_non_dependents',
        'supporting_dependents',
        'supporting_disabled',
        'undue_hardship',
        'income_others',
        # Fact sheet F
        'number_children_seeking_support_you',
        'child_support_amount_under_high_income_you',
        'percent_income_over_high_income_limit_you',
        'amount_income_over_high_income_limit_you',
        'total_guideline_amount_you',
        'agree_to_child_support_amount_you',
        'agreed_child_support_amount_you',
        'reason_child_support_amount_you',
        'number_children_seeking_support_spouse',
        'child_support_amount_under_high_income_spouse',
        'percent_income_over_high_income_limit_spouse',
        'amount_income_over_high_income_limit_spouse',
        'total_guideline_amount_spouse',
        'agree_to_child_support_amount_spouse',
        'agreed_child_support_amount_spouse',
        'reason_child_support_amount_spouse',
    },
    'payor_medical': {
        'medical_coverage_available',
        'whose_plan_is_coverage_under',
        'child_support_payments_in_arrears',
        'child_support_arrears_amount',
    },
    'what_for': {
        # child_support_in_order is not here because it can get pre-populated, and we don't want
        # it to be counted as an "answer" for determining Skipped and Started statuses
        'order_monthly_child_support_amount',
        'child_support_in_order_reason',
        'claimants_agree_to_child_support_amount',
        'child_support_payment_special_provisions',
        'have_separation_agreement',
        'have_court_order',
        'what_parenting_arrangements',
        'want_parenting_arrangements',
        'order_respecting_arrangement',
        'order_for_child_support',
        'child_support_act'
    },
}

"""
    Mapping between questions and steps
    Usage: For each step title, list all questions_keys belong to that step
"""
question_step_mapping = {
    'prequalification': ['married_marriage_like',
                         'lived_in_bc',
                         'lived_in_bc_at_least_year',
                         'separation_date',
                         'try_reconcile_after_separated',
                         'reconciliation_period',
                         'children_of_marriage',
                         'number_children_under_19',
                         'number_children_over_19',
                         'children_financial_support',
                         'children_live_with_others',
                         'original_marriage_certificate',
                         'provide_certificate_later',
                         'provide_certificate_later_reason',
                         'not_provide_certificate_reason',
                         'marriage_certificate_in_english',
                         'divorce_reason'],
    'which_orders': ['want_which_orders'],
    'your_information': ['name_you',
                         'any_other_name_you',
                         'other_name_you',
                         'last_name_born_you',
                         'last_name_before_married_you',
                         'birthday_you',
                         'occupation_you',
                         'lived_in_bc_you',
                         'moved_to_bc_date_you',],
    'your_spouse': ['name_spouse',
                    'any_other_name_spouse',
                    'other_name_spouse',
                    'last_name_born_spouse',
                    'last_name_before_married_spouse',
                    'birthday_spouse',
                    'occupation_spouse',
                    'lived_in_bc_spouse',
                    'moved_to_bc_date_spouse',],
    'your_marriage': ['when_were_you_married',
                      'where_were_you_married_city',
                      'where_were_you_married_prov',
                      'where_were_you_married_country',
                      'where_were_you_married_other_country',
                      'marital_status_before_you',
                      'marital_status_before_spouse',
                      'when_were_you_live_married_like'],
    'your_separation': ['no_reconciliation_possible',
                        'no_collusion'],
    'your_children': ['claimant_children',
                      # Income & Expenses
                      'how_will_calculate_income',
                      'annual_gross_income',
                      'spouse_annual_gross_income',
                      'payor_monthly_child_support_amount',
                      # Fact sheet A
                      'special_extraordinary_expenses',
                      'child_care_expenses',
                      'children_healthcare_premiums',
                      'health_related_expenses',
                      'extraordinary_educational_expenses',
                      'post_secondary_expenses',
                      'extraordinary_extracurricular_expenses',
                      'describe_order_special_extra_expenses',
                      # Payor & Fact Sheets
                      'child_support_payor',
                      # Fact sheet B
                      'number_of_children',
                      'time_spent_with_you',
                      'time_spent_with_spouse',
                      'your_child_support_paid_b',
                      'your_spouse_child_support_paid_b',
                      'additional_relevant_spouse_children_info',
                      # Fact sheet C
                      'number_of_children_claimant',
                      'your_spouse_child_support_paid_c',
                      'number_of_children_claimant_spouse',
                      'your_child_support_paid_c',
                      # Fact sheet D
                      'agree_to_guideline_child_support_amount',
                      'appropriate_spouse_paid_child_support',
                      'suggested_child_support',
                      # Fact sheet E
                      'claiming_undue_hardship',
                      'claimant_debts',
                      'claimant_expenses',
                      'supporting_non_dependents',
                      'supporting_dependents',
                      'supporting_disabled',
                      'undue_hardship',
                      'income_others',
                      # Fact sheet F
                      'number_children_seeking_support_you',
                      'child_support_amount_under_high_income_you',
                      'percent_income_over_high_income_limit_you',
                      'amount_income_over_high_income_limit_you',
                      'total_guideline_amount_you',
                      'agree_to_child_support_amount_you',
                      'agreed_child_support_amount_you',
                      'reason_child_support_amount_you',
                      'number_children_seeking_support_spouse',
                      'child_support_amount_under_high_income_spouse',
                      'percent_income_over_high_income_limit_spouse',
                      'amount_income_over_high_income_limit_spouse',
                      'total_guideline_amount_spouse',
                      'agree_to_child_support_amount_spouse',
                      'agreed_child_support_amount_spouse',
                      'reason_child_support_amount_spouse',
                      # Medical and other expenses
                      'medical_coverage_available',
                      'whose_plan_is_coverage_under',
                      'child_support_payments_in_arrears',
                      'child_support_arrears_amount',
                      # What are you asking for
                      'child_support_in_order',
                      'order_monthly_child_support_amount',
                      'child_support_in_order_reason',
                      'claimants_agree_to_child_support_amount',
                      'child_support_payment_special_provisions',
                      'have_separation_agreement',
                      'have_court_order',
                      'what_parenting_arrangements',
                      'want_parenting_arrangements',
                      'order_respecting_arrangement',
                      'order_for_child_support',
                      'child_support_act'],
    'spousal_support': ['spouse_support_details',
                        'spouse_support_act'],
    'property_and_debt': ['deal_with_property_debt',
                          'how_to_divide_property_debt',
                          'other_property_claims'],
    'other_orders': ['name_change_you',
                     'name_change_you_fullname',
                     'name_change_spouse',
                     'name_change_spouse_fullname',
                     'other_orders_detail'],
    'other_questions': ['address_to_send_official_document_street_you',
                        'address_to_send_official_document_city_you',
                        'address_to_send_official_document_prov_you',
                        'address_to_send_official_document_country_you',
                        'address_to_send_official_document_other_country_you',
                        'address_to_send_official_document_postal_code_you',
                        'address_to_send_official_document_fax_you',
                        'address_to_send_official_document_email_you',
                        'address_to_send_official_document_street_spouse',
                        'address_to_send_official_document_city_spouse',
                        'address_to_send_official_document_prov_spouse',
                        'address_to_send_official_document_country_spouse',
                        'address_to_send_official_document_other_country_spouse',
                        'address_to_send_official_document_postal_code_spouse',
                        'address_to_send_official_document_fax_spouse',
                        'address_to_send_official_document_email_spouse',
                        'divorce_take_effect_on',
                        'divorce_take_effect_on_specific_date'],
    'filing_locations': ['court_registry_for_filing'],
}

page_step_mapping = {
    'prequalification': 'prequalification',
    'orders': 'which_orders',
    'claimant': 'your_information',
    'respondent': 'your_spouse',
    'marriage': 'your_marriage',
    'separation': 'your_separation',
    'children': 'your_children',
    'support': 'spousal_support',
    'property': 'property_and_debt',
    'other_orders': 'other_orders',
    'other_questions': 'other_questions',
    'location': 'filing_locations',
}

""" List of court registries """
list_of_registries = ['Fort St. John', 'Dawson Creek', 'Prince Rupert',
                      'Terrace', 'Smithers', 'Prince George', 'Quesnel',
                      'Williams Lake', 'Campbell River', 'Powell River',
                      'Courtenay', 'Port Alberni', 'Duncan', 'Nanaimo',
                      'Victoria', 'Golden', 'Kamloops', 'Salmon Arm', 'Vernon',
                      'Kelowna', 'Penticton', 'Nelson', 'Rossland', 'Cranbrook',
                      'Chilliwack', 'New Westminster', 'Vancouver',
                      'Fort Nelson', 'Revelstoke']
