---
# System prepended metadata

title: Pair Programming

---

# Pair Programming 

## Agenda

* 14:00 - 14:15: boas-vindas e agenda
* 14:15 - 14:40: definição de escopo e arquitetura com o time
* 14:40 - 16:00: programação com Barbara Mariani
* 16:00 - 16:10: intervalo
* 16:10 - 17:30: programação com Guilherme Simas
* 17:30 - 18:00: apresentação do projeto, discussão e perguntas

## Backlog

Stakeholders have requested the following features as an addition to the API.

-----
1. If all the risk answers are false and the user has an income lower than 25k, then he is ineligible for all insurance lines.


* Add a new Ineligible rule
* Apply the new rule to all insurance lines - consider refactoring



    *Input*

    ```jsx
    {
      "age": 35,
      "dependents": 2,
      "house": {"ownership_status": "owned"},
      "income": 20000,
      "marital_status": "married",
      "risk_questions": [0, 0, 0],
      "vehicle": {"year": 2018}
    }
    ```

    *Output*

    ```jsx
    {
        "auto": "ineligible",
        "disability": "ineligible",
        "home": "ineligible",
        "life": "ineligible"
    }
    ```
    
-------
2. Houses have a status ( owned and rented). If owned she is eligible for Home insurance. If rented she is eligible for Renters insurance and Home rules are applied to it.

* Initial idea: make the insurance plan recommendation more dynamic
* The goal is to change the response to accomodate multiple lines of the same type
* Considering also that when the user does not have a house, both Home and Renters are ineligible
* Remove rules that apply to MORTGAGED -> the documentation says that the houses can either be Owned or Rented

    *Input*

    ```jsx
    {
      "age": 35,
      "dependents": 2,
      "house": {"ownership_status": "rented"},
    // "house": {"ownership_status": "owned"},
      "income": 0,
      "marital_status": "married",
      "risk_questions": [0, 1, 0],
      "vehicle": {"year": 2018}
    }
    ```

    *Output*

    ```jsx
    {
        "auto": "regular",
        "disability": "ineligible",
        "renters": "economic",
    //  "home": "economic, 
        "life": "regular"
    }
    ```

----
3. Add `Umbrella` insurance line. If the user got an economic score in any of the four main lines of insurance (life, disability, home & auto), he is eligible to get umbrella insurance. Base rules are applied to it.


* Add a new hierarchy of rules that also consider the insurance plans already recommended
* This new hierarchy of rules will be applied to another tipe of Insurance Line, which is not the "MainLine" - adapt that business rule in the code
    
    *Input*
    
    ```jsx
    {
      "age": 35,
      "dependents": 2,
      "house": {"ownership_status": "owned"},
      "income": 0,
      "marital_status": "married",
      "risk_questions": [0, 1, 0],
      "vehicle": {"year": 2018}
    }
    ```
    
    ```jsx
    {
        "auto": "regular",
        "disability": "ineligible",
        "home": "economic",
        "life": "regular",
    		"umbrella": "economic"
    }
    ```
    

Tech debts:
- Enhance calculate_risk_profile
- Use a design pattern for the InsurancePlanRecommendation class