예제 #1
0
 def fulfill(self, transaction):
     """
     Fulfill the transaction
     """
     if not self.can_fulfill(transaction):
         raise StregForbudError
     self.balance += transaction.change()
예제 #2
0
    def can_fulfill(self, transaction):
        """
        Can the member fulfill the transaction
        """

        if self.balance + transaction.change() < 0:
            return False
        return True
예제 #3
0
 def rollback(self, transaction):
     """
     Rollback transaction
     """
     self.balance -= transaction.change()