This Smart Contract manages a designated space for luggage storage. Such spaces exist inside airports, train and bus stations etc. Depending on the category a suitcase belongs to, the owner has to pay a deposit when he drops off the luggage. He will receive this deposit back when he takes the suitcase and pays for the storage time. Suitcase categories are defined by the system manager.
Exposed methods and variables
manager the ethereum address of system manager, given as parameter at contract creation
catList returns the details about a particular category (the index of each category will be logged using an event)
suitcaseList returns the details about a particular suitcase (the index of each suitcase will be logged using an eve
addCategory function called by the manager when he wants to add a new category to the list and emits the CategoryAdded event
|maxLength||integer||the maximum length of a suitcase to fit in this category|
|maxWidth||integer||the maximum width of a suitcase to fit in this category|
|maxHeight||integer||the maximum height of a suitcase to fit in this category|
|_ppHour||integer||the price for an hour of storage|
|_ppDay||integer||the price for a day of storage|
|_deposit||integer||the amount the client need to pay at drop off|
checkinSuitcase called by a client who wants to drop off a suitcase. He needs to send to the contract a sum equal to the deposit set by the manager for the category of the client's suitcase. It emits SuitcaseStored event.
|categoryID||integer||unique identifier of the category|
checkoutSuitcase called by a client who wants to take back his suitcase. He needs to send to the contract the price calculated for the amount of time the suitcase was stored. The time is assumed to be determined outside of the contract.
|suitcaseID||integer||unique identifier of the suitcase|
transferMoney allows the owner to transfer money from the contract's balance to his own account
|amount||integer||the sum the manager wants to transfer|
getBalance returns the balance of the contract when called by the manager
|catID||integer||the unique identifier of the added category|
|suitcaseID||integer||the unique identifier of the stored suitcase|