# GCash Mini
## _User Service_
GCash Mini is a financial system that allows a person to send and receive money to someone and add funds through top up or over the counter methods
- Account creation
- Account verification
- Account login
- Add money to account
### Account Creation
Allows client to create an account.
| Field | Description | Type/Sample |
| ------ | ------ | ------ |
| `ID` | Randomly generated ID | `string` "123456" |
| `email` | User email address, must be a valid email. This will be used as username | `string` "mileskm@gmail.com" |
| `firstName` | First name of the account owner. Required| `string` "Miles" |
| `middleName` | Optional middle name of the account owner| `string` "Miles" |
| `lastName` | Last name of the account owner. Required| `string` "Kilom" |
| `password` | Given password of user, must be minimum of 6 characters | `string` password123 |
```json
POST /account
Header Reference-No: 123141
{
"email": "mileskm@gmail.com",
"firstName": "Miles",
"middleName": "Meter",
"lastName": "Kilom",
"password": "password123"
}
```
_Response_
`200` Account successfully created
`400` Bad request: email already registered
```json
{
"message": "Email already registered"
}
```
`400` Bad request: wrong password format
```json
{
"message": "Password must contain at least 6 characters"
}
```
`500` Something went wrong in creating the account
### Login
| Field | Description | Sample |
|-----------|--------------------------------------|-----------------|
| email | registered email for created user | `string` "mileskm@gmail.com" |
| password | registered password for created user | `string` "password123" |
`200` Login successful
`400` Bad request: email not registered
```json
{
"message": "User does not exist"
}
```
`400` Bad request: wrong password
```json
{
"message": "Password is incorrect"
}
```
## _Transaction Service_
### Transaction
| Field | Description | Sample |
|-----------|--------------------------------------|-----------------|
| email | registered email for created user | `string` "mileskm@gmail.com" |
| amount | amount of funds to deposit | `double` 100.00 |
| balance | current balance | `double` 100.00 |
```json
POST /cashIn
Header Reference-No: 123141
{
"startingBalance": 0
"amount": 100
}
```
`200` Cash In successful
`400` Bad request: invalid amount
```json
{
"message": "Invalid amount"
}
```
### Cash Out
| Field | Description | Sample |
|-----------|--------------------------------------|-----------------|
| email | registered email for created user | `string` "mileskm@gmail.com" |
| amount | current balance | `double` 100.00 |
`200` Cash Out successful
`400` Bad request: insufficient balance
```json
{
"message": "Insufficient Balance"
}
```
## _Admin Service_
| Field | Description | Sample |
|-----------|--------------------------------------|-----------------|
| email | registered email for created user | `string` "mileskm@gmail.com" |
## _Activity Service_
| Field | Description | Sample |
|-----------|--------------------------------------|-----------------|
| email | registered email for created user | `string` "mileskm@gmail.com" |
| balance | current balance | `int` 100 |