Exemplo n.º 1
0
    def get_transaction(created, location, category):

        merchants = Merchant.from_foursquare(
            near=location,
            categories=[]
        )

        merchants = merchants.get(category)

        if merchants:
            merchant = random.choice(merchants)
            amount = random.randint(10, 40)

            return Transaction(
                expand='merchant',
                account_balance=BALANCE,
                amount=amount,
                created=created,
                currency=CURRENCY,
                description='%s at %s' % (merchant['category'], merchant['name']),
                id=random_string(10),
                category=merchant.get_category(),
                merchant=merchant,
                metadata=MetaData(),
                notes='',
                is_load=False,
                settled=True
            )
        else:
            return None
Exemplo n.º 2
0
 def __init__(self, _id: object = None) -> None:
     _id = _id or random_string()
     super(Query, self).__init__(_id)
Exemplo n.º 3
0
 def __init__(self, _id: object = None) -> None:
     _id = _id or random_string()
     super(Query, self).__init__(_id)