Skip to content

Instantly share code, notes, and snippets.

@gayanvirajith
Last active March 20, 2021 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gayanvirajith/580d8a3251672d3aca07b1b31a7c52cf to your computer and use it in GitHub Desktop.
Save gayanvirajith/580d8a3251672d3aca07b1b31a7c52cf to your computer and use it in GitHub Desktop.
swimlanes atm flow - https://swimlanes.io/u/RmBOzqZbX
autonumber

Title: ATM Flow

_: ** Withdraw cash **

USER -> ATM: Insert card

ATM -> BANK: Verify card

...: {fas-spinner} 

_: ** Card validation process **

if: if the card is valid 

	ATM <-- BANK: Card ok

	USER <- ATM: Request PIN
 
	USER -> ATM: Enter PIN
  
else: **else**
	
ATM <-- BANK: Card invalid
  
USER <- ATM: Eject card
  
end

_: ** PIN validation process **

USER --> ATM: Enter PIN

ATM -> BANK: Verify PIN

if: if PIN valid

	ATM <-- BANK: PIN ok

	USER <- ATM: Enter amount

else: **else**
	
  ATM <- BANK: PIN invalid
  
  USER <- ATM: Eject card
  
end

_: ** Transaction process**

USER --> ATM: Enters amount

ATM -> BANK: Initiate transaction

BANK -> BANK ACCOUNT: Sufficient funds?

note: Check particular bank account has sufficient funds before doing the transaction

if: if funds sufficient

BANK <-- BANK ACCOUNT: Has funds

BANK -> BANK ACCOUNT: Withdraw amount

BANK <-- BANK ACCOUNT: withdraw success

ATM <-- BANK: Transaction complete

USER <- ATM: Dispense Cash

else: **else**

BANK <-- BANK ACCOUNT: Insufficient fund

ATM <-- BANK: Transaction unsuccessful

end

USER <- ATM: Eject card
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment