mcdulltii / CSC1109

SIT CSC1109 (Object Oriented Programming) Assignment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CSC1109 Project

  1. Account Information (e.g. how many accounts, account numbers, etc)
  2. Balance Check (e.g. remain balance, available balance, etc)
  3. Authentication (e.g. password check / reset, etc)
  4. Money Transfer(e.g. inter-account transfer, third-party transfer, etc)
  5. Settings (e.g. transfer limit, overseas withdraw limit, etc)

Dependencies

  • Maven
  • MySQL
  • Docker (For SQL and server setup without above dependencies)

Setup

  1. Install dependencies
  2. Connect to MySQL server
  • Create database by CREATE DATABASE oopasgdb;

  • Grant user:password to access MySQL database by

    CREATE USER testAdmin@localhost IDENTIFIED BY 'password1';
    GRANT ALL PRIVILEGES ON oopasgdb.* TO testAdmin@localhost;
  • Create transactions table by use oopasgdb; and

    CREATE TABLE `transactions` (
      `transactionId` varchar(8) NOT NULL,
      `accountNumber` varchar(50) NOT NULL,
      `transactionDate` date NOT NULL,
      `transactionDetails` varchar(100) DEFAULT NULL,
      `chqNumber` varchar(50) DEFAULT NULL,
      `valueDate` date NOT NULL,
      `withdrawal` decimal(15,2) DEFAULT NULL,
      `deposit` decimal(15,2) DEFAULT NULL,
      `balance` decimal(15,2) NOT NULL,
      PRIMARY KEY (`transactionId`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  • Create accounts table

    CREATE TABLE `accounts` (
      `CardNumber` BIGINT(20) NOT NULL,
      `AccountNumber` BIGINT(20) NOT NULL,
      `UserName` VARCHAR(45) NOT NULL,
      `Password` VARCHAR(128) NOT NULL,
      `FirstName` VARCHAR(45) NOT NULL,
      `LastName` VARCHAR(45) NOT NULL,
      `PasswordSalt` VARBINARY(128) NOT NULL,
      `AvailableBalance` FLOAT(45) NOT NULL,
      `TotalBalance` FLOAT(45) NOT NULL,
      `TransferLimit` FLOAT(45) NOT NULL,
      `IsAdmin` SMALLINT(1) NOT NULL,
      PRIMARY KEY (`AccountNumber`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Setup (Docker)

Ensure port 3306 is unused

  1. Start sql and server docker containers
  > ./start.sh
  1. Run client script
  > make build
  > make run
  1. Stop docker containers once done
  > ./stop.sh

Setup (Docker SQL only)

Ensure port 3306 is unused

  1. Start sql docker container
  > docker-compose --profile=sql up -d
  1. Run server.java
  2. Stop docker container once done
  > docker-compose --profile=sql down

Test

  1. Run standalone test
> cd atm
> mvn test
  1. During build time

Tests will automatically run during build time

Class Diagram

About

SIT CSC1109 (Object Oriented Programming) Assignment

License:MIT License


Languages

Language:Java 99.3%Language:Dockerfile 0.3%Language:Makefile 0.2%Language:Shell 0.2%