Skip to content

Instantly share code, notes, and snippets.

@tvolk131
Created September 18, 2017 16:44
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 tvolk131/6cfd05ce4b48040299a20ffcbfee3810 to your computer and use it in GitHub Desktop.
Save tvolk131/6cfd05ce4b48040299a20ffcbfee3810 to your computer and use it in GitHub Desktop.
class Cashinator {
constructor (initialAmount, taxPercentage, itemList) {
}
/**
* @return {*Current balance in the register}
*/
getBalance () {
}
/**
*
* @param {*String to filter by} query
* @return {*List of items that have been purchased since register initialization}
*/
filterItemsPurchased (query) {
}
/**
* @return {*List of all prior transactions}
*/
getTransactions () {
}
startTransaction () {
}
/**
* Adds an item to the active transaction
* @param {*ID of item to add to current transaction} itemId
*/
addItem (itemId) {
}
/**
* @return {*The most recently scanned item in the current transaction}
*/
getMostRecentItem () {
}
/**
* @return {*Current cost of active transaction}
*/
getTransactionTotal () {
}
/**
* Saves the active transaction and resets to allow for a new transaction
*/
saveTransaction () {
}
/**
*
* @param {*Adds money towards a transaction} amount
*/
addPayment (amount) {
}
/**
* @return {*The amount of change that is due}
*/
getChange () {
}
/**
* @return {*List of all items in current transaction}
*/
getTransactionItems () {
}
/**
*
* @param {*The amount of money that was given to the cashier} amountPaid
* @return {*The amount of change due}
*/
closeTransaction (amountPaid) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment