Main Page

Main Page Design

From main page, we can conclude that we need an API to display category list and an API to display daily transaction. To calculate the total of each category, the value can be derived from a user’s transaction data. As a result, we don’t need a specific API to do that.

Add Transaction Page

Add Transaction Page (There should be a “Notes” section here)

In this page, we need an API to get category list for a user and an API to add a new transaction.

Add Category Page

Add Category Page

In this page, we need an API to upload a category icon and an API to add a new category.

Merge into One

From the three pages, we can conclude that we need these functionalities:

  • Get category list per user
  • Get transaction list per user and per date
  • Add transaction data
  • Add category data
  • Upload category icon

Other than the main functionalities, I add APIs related to user management:

  • Get user data
  • Add user data

In the next session, I will describe the appropriate request and response for each function.

API Contract

I will only explain the expected request and its expected response. Note that the contract is only valid for the current version, meaning that it does not reflect future versions.

Category

ColumnTypeNot nullNotes
category_idInteger
category_nameString
category_iconString
category_typeStringTwo possible String: EARNING, or EXPENSE

Get Categories List

The expected input is a user’s ID, and the system will return an array that contains Category object

Get categories list

Request

ColumnTypeRequired
user_idInteger

Response

ColumnTypeRequired
categoriesCategory[]

Save Category Data

Save category data

Request

ColumnTypeRequired
user_idInteger
category_nameString
icon_locationString
transaction_typeString

Response

ColumnTypeRequired
category_idInteger
messageString

Upload Category Icon

There is no limitation for file types uploaded and image dimension for now. This function will be revisited later.

Upload category icon

Request

ColumnTypeRequired
fileBinary Data

Response

ColumnTypeRequiredNotes
pathStringURL of the image
messageString

Transaction

ColumnTypeNot nullNotes
transaction_idInteger
category_idInteger
amountInteger
dateDate
noteString

Get Transaction List

Get transaction list based on user ID and transaction date

Get transaction list

Request

ColumnTypeNot null
user_idInteger
dateDate

Response

ColumnTypeNot null
transaction_listTransaction[]

Add Transaction

Add transaction

Request

ColumnTypeNot null
user_idInteger
category_idInteger
amountInteger
transaction_dateDate
noteString

Response

ColumnTypeNot null
transaction_idInteger
messageString

User

A user object stores a user ID, a username, and an email.

ColumnTypeNot null
user_idString
usernameString
emailString

Add User Data

Add user data

Request

ColumnTypeNot null
usernameString
emailString

Response

ColumnTypeNot null
user_idInteger
messageString

Get User Data

Get user data

Request

ColumnTypeNot null
user_idInteger

Response

ColumnTypeNot null
userUser