22 lines
570 B
Python
22 lines
570 B
Python
import json
|
|
|
|
class SellOrder():
|
|
def __init__(self, cardId=None, items=[], price=0, fee=0):
|
|
super().__init__(
|
|
orderType = "sell",
|
|
cardId = cardId,
|
|
fee = fee
|
|
)
|
|
self.items = items
|
|
self.price = price
|
|
|
|
def add_transaction(self, transaction):
|
|
if transaction.cardId in self.items:
|
|
# TODO: update database
|
|
self.items.pop(transaction.cardId)
|
|
self.transactions.append(transaction)
|
|
|
|
def validate(self):
|
|
# TODO: no duplicate items
|
|
return
|