DispenseInterface and OpenDispense Implimentation created and tested. Not curruntly...
[uccvend-vendserver.git] / VendServer / DispenseInterface.py
diff --git a/VendServer/DispenseInterface.py b/VendServer/DispenseInterface.py
new file mode 100644 (file)
index 0000000..81a3f06
--- /dev/null
@@ -0,0 +1,70 @@
+"""
+Author: Mitchell Pomery (bobgeorge33)
+
+Dispense is an abstract class that allows easy configuration between different systems. Anything that is 
+intended to talk to OpenDispense or similar should comply with this class. Using this class in particular 
+will cause you a lot of problems.
+"""
+
+class DispenseInterface(object):
+
+       """
+       Create a new dispense object.
+       """
+       def __init__(self, username=None, loggedIn=False, disabled=False):
+               pass
+
+       """
+       Create a new dispense interface as the supplied user.
+       """
+       @staticmethod
+       def authUsernamePin(username, pin):
+               pass
+
+       """
+       Create a new dispense interface as the supplied user.
+       """
+       @staticmethod
+       def authMifare(cardId):
+               pass
+
+       """
+       Check if creating the user worked correctly.
+       """
+       def isLoggedIn(self):
+               pass
+
+       """
+       Get the users username.
+       """
+       def getUsername(self, user):
+               pass
+
+       """
+       Get the users current balance.
+       """
+       def getBalance(self, user):
+               pass
+
+       """
+       Get the name and price of an item.
+       itemId is the number entered into the vending machine
+       """
+       @staticmethod
+       def getItemInfo(itemId):
+               pass
+
+       """
+       Check if the user is disabled.
+       """
+       def isDisabled(self):
+               pass
+
+       """
+       Dispense an item for the current user.
+       itemId is the number entered into the vending machine
+       """
+       def dispenseItem(self, itemId):
+               pass
+
+

UCC git Repository :: git.ucc.asn.au