|
|
@ -259,6 +259,57 @@ class Ad(models.Model):
|
|
|
|
return cls.objects.filter(id=ad_id, user=user, enabled=True).first()
|
|
|
|
return cls.objects.filter(id=ad_id, user=user, enabled=True).first()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Transaction(models.Model):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
A transaction on an aggregator.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
|
|
|
|
|
|
|
aggregator = models.ForeignKey(Aggregator, on_delete=models.CASCADE)
|
|
|
|
|
|
|
|
account_id = models.CharField(max_length=255)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ts_added = ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
recipient = models.CharField(max_length=255, null=True, blank=True)
|
|
|
|
|
|
|
|
sender = models.CharField(max_length=255, null=True, blank=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
amount = models.FloatField()
|
|
|
|
|
|
|
|
currency = models.CharField(max_length=16)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
note = models.CharField(max_length=255, null=True, blank=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reconciled = models.BooleanField(default=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Trade(models.Model):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
A trade on a Platform.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
|
|
|
|
|
|
|
platform = models.ForeignKey(Platform, on_delete=models.CASCADE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contact_id = models.CharField(max_length=255)
|
|
|
|
|
|
|
|
reference = models.CharField(max_length=255)
|
|
|
|
|
|
|
|
buyer = models.CharField(max_length=255)
|
|
|
|
|
|
|
|
seller = models.CharField(max_length=255)
|
|
|
|
|
|
|
|
amount_fiat = models.FloatField()
|
|
|
|
|
|
|
|
currency = models.CharField(max_length=16)
|
|
|
|
|
|
|
|
amount_crypto = models.FloatField()
|
|
|
|
|
|
|
|
coin = models.CharField(max_length=16)
|
|
|
|
|
|
|
|
provider = models.CharField(max_length=255)
|
|
|
|
|
|
|
|
type = models.CharField(max_length=255)
|
|
|
|
|
|
|
|
ad_id = models.CharField(max_length=255)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
status = models.CharField(max_length=255)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
linked = models.ManyToManyField(Transaction)
|
|
|
|
|
|
|
|
reconciled = models.BooleanField(default=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
released = models.BooleanField(default=False)
|
|
|
|
|
|
|
|
release_response = models.JSONField(default=dict)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets = {
|
|
|
|
assets = {
|
|
|
|
"XMR": "Monero",
|
|
|
|
"XMR": "Monero",
|
|
|
|
"BTC": "Bitcoin",
|
|
|
|
"BTC": "Bitcoin",
|
|
|
|