RUN go mod init github.com/Altamashattari/banking-application
RUN go mod tidy
go build ./banking-application
docker pull --platform linux/x86_64 mysql
docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -d mysql
SERVER_ADDRESS=localhost SERVER_PORT=8000 DB_USER=root DB_PASSWD=password DB_ADDR=localhost DB_PORT=3306 DB_NAME=banking go run main.go
- A new account can only be opened with a mininum deposit of 5000.00
- Account can only be of saving or checking type
- In case of an unexpected error, api should return status code 500 (Internal Server Error) along with the error message.
- The API should return the new account id, when the new account is opened with the status code as 201(created)
- transaction can only be withdrawl or deposit
- amount can't be negative
- withdrawal amount should be available in the account
- successful transaction, should return the updated balance with transaction id response
- error handling should be done for the bad request and unexpected errors from the server side and should return the appropriate http status code with message
- GET ALL CUSTOMERS GET /customer
- GET CUSTOMER BY ID GET /customer/{customer_id}
- CREATE NEW ACCOUNT POST /customer/{customer_id}/account
- MAKE A TRANSACTION POST /customer/{customer_id}/account/{account_id}
- GET CUSTOMER BY ID GET /customer/{customer_id}
- MAKE A TRANSACTION POST /customer/{customer_id}/account/{account_id}
SERVER_ADDRESS=localhost SERVER_PORT=8000 DB_USER=root DB_PASSWD=password DB_ADDR=localhost DB_PORT=3306 DB_NAME=banking go run main.go