Skip to content

Use Cases 2: Habit Events

Adil Malik edited this page Nov 4, 2017 · 2 revisions

02.01.01:
User Story: As a participant, I want to add a habit event to my habit history when I have done a habit as planned. (US 02.01.01)
Use Case Name: CreateHabitEvent
Primary Actors: User
Goal: Allow the user to add a habit event to their habit history
Trigger: The user selects the create habit event option
Precondition: User has completed the habit that the event is based off of on time
Post-condition: The user has a new habit event in their habit history
Extends: AddHabitEventPhoto

Flow:

  1. The user enters the details of the habit event
  2. The system adds the habit event to the user's habit history

02.02.01:
User Story: As a participant, I want a habit event to have an optional comment of no more than 20 characters. (US 02.02.01)
Use Case Name: SetHabitEventComment
Primary Actors: User
Goal: Allow the user to add some optional comment of at most 20 characters to a habit event
Trigger: User selects the input box acting as a view for the comment
Precondition: The user knows what they want the event's comment to be
Post-condition: On success, the habit event will have it's comment set to what the user entered

Flow:

  1. User is prompted for input to use as the comment, and the controller prevents them from entering more than 20 characters
  2. The user selects the finish option
  3. The system sets the user's input as the habit event's comment

02.03.01:
User Story: As a participant, I want a habit event to have an optional photograph to record what happened. (US 02.03.01)
Use Case Name: AddHabitEventPhoto
Primary Actors: User
Goal: Allow the user to add an optional photo to a habit event
Trigger: The user selects the pick photo option
Precondition: The user has a photo which that they want to use
Post-condition: The user's chosen photo will be assigned to the habit event
Includes: StorePhoto

Flow:

  1. User chooses the photo that they want to upload
  2. The system assigns the selected photo to the habit event

02.04.01:
User Story: As a participant, I want to view a given habit event and all its available details. (US 02.04.01)
Use Case Name: ViewHabitEvent
Primary Actors: User
Goal: User can view the details of a selected habit event
Trigger: User selects the habit event they want to view
Precondition: The user is connected to the internet
Post-condition: The user is shown the details of the selected habit event
Related: ViewHabitHistory

Flow:

  1. The system gets the details of the selected habit event
  2. The system displays the event's details

02.05.01:
User Story: As a participant, I want to edit the details of a habit event of mine. (US 02.05.01)
Use Case Name: EditHabitEvent
Primary Actors: User
Goal: The user is able to edit the selected habit event in their own habit history
Trigger: User selects the edit option when viewing the details of the event
Precondition: The user knows what details they want to change and is connected to the internet
Post-condition: The user is able to change details of that habit event
Includes: ViewHabitEvent

Flow:

  1. The user edits the details comprising the habit event
  2. The user selects the save option
  3. The system updates the details of the event with what the user chose
  4. The system displays the new details of the event

02.06.01:
User Story: As a participant, I want to delete a habit event of mine. (US 02.06.01)
Use Case Name: DeleteHabitEvent
Primary Actors: User
Goal: Allow the user to delete a habit event in their own habit history
Trigger: User selects the delete option when viewing a habit event in their history
Precondition: The user is viewing the event they want to delete
Post-condition: The habit event now no longer exists within the system

Flow:

  1. The system removes the deleted habit event from the user's history
  2. The user is taken back to the page they were previously on

02.07.01
User Story: As a system administrator, I want the storage for each photographic image to be under 65536 bytes. (US 02.07.01)
Use Case Name: StorePhoto
Primary Actors: User
Goal: Allow the user to store any image in the system, with a size under 65536 bytes
Trigger: User picks an image to upload into the system
Precondition: The user is connected to the internet, and the selected image has a valid format that is supported by the system
Post-condition: On success, the image will be stored into the system as is. Otherwise, the photo will be resized to be under 65536 bytes
Related: AddHabitEventPhoto

Flow:

  1. User selects the upload image option
  2. If the image size is not below 65536 bytes, the system resizes it so that it is no more than 65536 bytes
  3. The system uploads that photo to the database