Skip to content

Latest commit

 

History

History
187 lines (152 loc) · 3.8 KB

USECASES.md

File metadata and controls

187 lines (152 loc) · 3.8 KB

Naratives

As a user with an active internet connection I want to be able to register for an account

Data:-

  • email: Email
  • password: String

Response:

  • StatusCode: 200
Given the user has an active internet connection
    When the user tries to register an account
    the application should present the registration screen
    - email + password
    upon successful registration - 
    - User should receive an email to verify their account.     
Given the user doesn't have an active internet connection
    When the user tries to register an account
    the application should present notification asking them turn on internet
As a user with an active internet connection I want to be able to login to my account

Data:-

  • email: Email
  • password: String

Response:-

  • StatusCode: - 200

Data:

  • created_at: Date
  • updated_at: Date
  • email: Email
  • id: xid
  • access_token: valid JWT
Given the user has an active internet connection 
    when the user tries to login by providing their email and password.
    - If the credentials are valid the user should be proceed to main screen
    - If the credentials are not valid the user should be prompted that their combination is not correct

As a user with an active internet connection I want to be able to create a shortened url

Data:-

  • original_url : URL
  • custom_alias: String?
  • expires_on: Date (in the future, from now onwards)
  • keywords: [String]? - used for searching
  • description: String?

Response:

  • StatusCode: 201
  • Data
    • id: String
    • user_id: xid
    • original_url: URL
    • custom_alias: String
    • shortcode: String
    • expires_on: Date
    • created_at: Date
    • updated_at: Date
    • keywords: [String]
    • hits: Int

Response

  • StatusCode: 400
  • Data
    • error: String
Given a user has an active internet connection and has a valid token
    when the user tries to create a shortened url
    - if the provided information is correct / valid
    The user should receive a shortened url
    - if the provided information is not correct / not valid
    The user should receive an error response / message 
As a user with an active internet connection I want to be able to fetch all of my shortened urls

Response

  • Statuscode: 200

Data: Array

  • id: String
  • user_id: String
  • original_url: URL
  • custom_alias: String
  • shortcode: String
  • expires_on: Date
  • created_at: Date
  • updated_at: Date
  • keywords: [String]
  • hits: Int
Given a user has an active internet connection and has a valid token
    when the user tries to fetch all their shortened urls
    - The user should get all their shorted urls 
As a user with an active internet connection and a valid token I want to be able verify my shortened url

Data: Method: GET

  • urlPath : /:id

Response:

  • StatusCode: 200
  • Data
    • id: String
    • user_id: String
    • original_url: URL
    • custom_alias: String
    • shortcode: String
    • expires_on: Date
    • created_at: Date
    • updated_at: Date
    • keywords: [String]
    • hits: Int
Given a user has an active internet connection and has a valid token
    when the user tries to verify their shortened url
    - The user should get a verifed shortened url
As a user with an active internet connection and a valid token I want to be able delete my shortened url

Data:

  • Method: DELETE
  • urlPath : /:id

Response:

  • StatusCode: 202
Given a user has an active internet connection and has a valid token
    when the user tries to delete their shortened url
    - The user should get a confirmation on the status of the deletion