Skip to content

Architecture

Denys edited this page Dec 3, 2016 · 7 revisions

Logical Components

  • CashModule
  • CardModule
  • Core

UI Modules

ATM

  • Display
  • Buttons
  • Card Reader
  • Cash Output
  • Check Output

Additional

  • CardHolder
  • CashLoader

CardModule

Module wraps logic of working with card data

Proposed API

  • readCard(cardDataModel) - loads card model into module
  • checkPin(pin) - check pin, throws PinIncorrectError()
  • isAuthorized() - return true if pin was correct
  • getBalance() - return card balance
  • updateBalance(sum) - change balance
  • ...

CashModule

Wraps logic of holding money

Proposed API

  • getCash(amount, nominal)
    • return money as an list(?) of notes different nominal
    • parameter amount is total sum of notes
    • parameter nominal is value from Enum(BIG, SMALL, FREE), parameter is not required
    • throws NotEnoughMoneyError

Display(DisplayView)

should have next methods

  • showText(text)
  • showInput(text, inputValue, hide)
    • text - text above input
    • inputValue - value of input
    • hide - if true show inputValue with ****
  • showButtons(text, buttonsArray)
    • text in the middle of screen
    • buttonsArray - list of 8 items ["title1", "title2", ..., null, "title8"]

Feel Free to ask questions or edit!

Clone this wiki locally