---
# System prepended metadata

title: Use Case Model

---

# Use Case Model

*This is the template for your use case model. The parts in italics are concise explanations of what should go in the corresponding sections and should not appear in the final document.*

**Author**: Team 099

## 1 Use Case Diagram

*This section should contain a use case diagram with all the actors and use cases for the system, suitably connected.*

## 2 Use Case Descriptions

### Use Case 1: enter or edit current job details

- Requirements:
    - User will be shown a user interface to enter the current job details if this is the first time.
    - User will be able to edit the current job details if they have entered information for current job before.
    - User will be able to save the job details or cancel the editing without saving.
    - User will be able to return to the main menu after saving or canceling saving of the details.
    
- Pre-conditions: 
    - The user must open the app and see the main menu. From which they should choose the section to enter/edit current job details on the main menu. And then they can enter or edit information for current job.
    - The information entered by user must be valid and need to be passed with the type check. eg: cannot enter alphabetical string for yearly salary.
    
- Post-conditions: 
    - If the user chooses the save button. The entered information will be saved for current job.
    - If the user chooses the cancel and exit button. The entered information won't be saved. 
    - In both cases, user will be redirected back to main menu.

- Scenarios:
    - Normal: User enters current job details and saves the result:
        - User opens app and is shown with main menu.
        - User chooses the section to enter/edit the current job.
        - User is redirected to the UI to enter all information for current job.
        - After entering / editting all the information, user chooses save button.
        - All information gets saved and user is redirected to main menu automatically.
    - Alternate: User enters / edits current job details but decides not to save the result:
        - User opens app and is shown with main menu.
        - User chooses the section to enter/edit the current job.
        - User is redirected to the UI to enter all information for current job.
        - After entering / editting all the information, user chooses button for canceling and exiting without saving .
        - Nothing gets saved and user is redirected to main menu automatically.


### Use Case 2: enter job offers

- Requirements:
    - User will be shown a user interface to enter information for job offer. All information required to be entered is same as that of current job.
    - User will be able to save the entered job offer information or cancel the editing without saving. 
    - User will be able to choose to enter information about another job offer after deciding to save or cancel saving of the just entered job offer. 
    - User will be able to return to the main menu.
    - User will be able to compare the job offers if at least two offers have been saved.
    - User will be able to compare the job offers with current job. If current job details have been saved and at least one job offer information has been entered.
    
- Pre-conditions: 
    - The user must open the app and see the main menu. From which they should choose the section to enter job offers details on the main menu. And then they can enter or edit information for job offers.
    - The information entered by user must be valid and need to be passed with the type check. eg: cannot enter alphabetical string for yearly salary.
    - If the user wants to perform job comparision function, at least two job offers have to be presented if there is no current job information. If the current job details has been saved, at least one job offer information has to be saved before conducting the comparision. 
    
- Post-conditions: 
    - If the user chooses the save button. The entered information will be saved for this job offer.
    - If the user chooses the cancel and exit button. The entered information won't be saved. 
    - After perform the save / cancel saving operation, user will be offered with options to enter another job offer, or return to main menu or compare the offer.
    
- Scenarios:
    - Normal: User enters a job offer's information and chooses to compare the job:
        - User opens app and is shown with main menu.
        - User chooses the section to enter the job offer.
        - User is redirected to the UI to enter all information for job offer.
        - After entering / editting all the information, user chooses save button.
        - All information gets saved. User is presented with options: enter another offer / return to main menu / compare the offer.
        - User chooses to compare the job and get redirected to job comparision interface.
    - Alternate: User enters a job offer's information and saves the result:
        - User opens app and is shown with main menu.
        - User chooses the section to enter the job offer.
        - User is redirected to the UI to enter all information for job offer.
        - After entering / editting all the information, user chooses cancel saving button.
        - No information gets saved. User is presented with options: enter another offer / return to main menu / compare the offer.
    - Alternate: User chooses to enter another offer after making save options for this job offer.
        - User opens app and is shown with main menu.
        - User chooses the section to enter/edit the current job.
        - User is redirected to the UI to enter all information for current job.
        - After entering / editting all the information, user chooses button for canceling and exiting without saving .
        - All information gets saved. User is presented with options: enter another offer / return to main menu / compare the offer. User chooses to enter another offer.


### Use Case 3: adjust the comparision settings

- Requirements:
    - User will be shown a user interface to adjust the integer weights for different metrics.
    
- Pre-conditions: 
    - The user must open the app and see the main menu. From which they should choose the section to adjust comparision weight on the main menu. And then they can manually adjust the integer weights.
    - The information entered by user must be valid and need to be passed with the type check. Must enter integer value for weights.
    
- Post-conditions: 
    - If the user chooses the save button. The entered new weight values will be used for job comparision.
    - If the user chooses the cancel and exit button. The edited weight values won't be saved.
    - In both cases, user will be redirected back to main menu.

- Scenarios:
    - Normal: User enters new weight values for comparison and saves the result:
        - User opens app and is shown with main menu.
        - User chooses the section to adjust the comparision setting.
        - User is redirected to the UI to enter integer weights for metrics.
        - After entering / editting all the weights, user chooses save button.
        - All weight values gets saved and user is redirected to main menu automatically.
    - Alternate: User enters new weight values for comparison and cancels to save the result:
        - User opens app and is shown with main menu.
        - User chooses the section to adjust the comparision setting.
        - User is redirected to the UI to enter integer weights for metrics.
        - After entering / editting all the weights, user chooses cancel button.
        - No weight values gets saved. Job comparison will use weights got saved earlier. If there is no adjusted weights ever got saved before. The app will apply equal weights to job comparison process. User is redirected to main menu automatically.

### Use Case 4: compare job offers

- Requirements:
    - User will be shown a user interface of a list of job offers. All jobs are listed as Title and Company. The list is ranked by job scores calculated with weights for each metrics from high to low. That is the ranked list shows job offers from best to worst. The current job will also be included in the list if current job details got saved to the app before. 
    - User will be able to choose two jobs from the list to compare them. 
    - After choosing two job paris, user will be redirected to a table which lists all the metrics for these two job. So that user can have detail comparision of these two selected jobs.
    
- Pre-conditions: 
    - The user must open the app and see the main menu. From which they should choose the section to compare job offer on the main menu. 
    - If the current job details is not entered. At least two job offer information needs to be entered before the comparisions. Otherwise it will trigger a warning: only one job offer information was saved. Nothing to compare.
    - If the current job details is entered. At least one job offer information needs to be entered before the comparisions. Otherwise it will trigger a warning: only current job information was saved. There is no other saved job offer to compare. Please enter at least one more job offer information and save it. 
    
- Post-conditions: 
    - After triggering the comparision, the user will see the options button to return to main menu or perform another comparision.

- Scenarios:
    - Normal: User compares two job offers and then chooses to perform another comparision:
        - User opens app and is shown with main menu.
        - User chooses the section to compare job offers.
        - User is redirected to the UI of a ranked list of job offers (including the current job if the current job details were saved before) from best to worst.
        - Users can select two job offers from the list to do detail comparision.
        - Once the selection is confirmed, user will be redirected to a page of a table listing all the metrics value for these two job offers in detail.
        - User will be presented with two options below the table: return to main menu/ perform another comparision.
        - User chooses to perform another comparision.
     - Alternate: User compares a job offer with current job and then chooses to return to main menu:
        - User opens app and is shown with main menu.
        - User chooses the section to compare job offers.
        - User is redirected to the UI of a ranked list of job offers (including the current job if the current job details were saved before) from best to worst.
        - Users selects current job and a job offer from the list to do detail comparision.
        - Once the selection is confirmed, user will be redirected to a page of a table listing all the metrics value for the current job and the job offer in detail.
        - User will be presented with two options below the table: return to main menu/ perform another comparision.
        - User chooses to return to main menu.
    - Exceptional: User only entered one job offer before and triggered a warning of comparison:
        - User opens app and is shown with main menu.
        - User chooses the section to compare job offers.
        - User is redirected to the UI of a ranked list of job offers (including the current job if the current job details were saved before) from best to worst.
        - Users only saved one job offer / current job details before.
        - A message box shows up: Warning: There is only one job's informations got saved. Please return to main menu and enter more job offers information before using comparision section!
        - User will be offered with button to return to main menu.