preferences/apps/api/models.py
2024-07-20 10:33:45 +03:30

19 lines
677 B
Python

from django.db import models
from oauth2_provider.models import get_application_model
from apps.users.models import User
Application = get_application_model()
class Invoke(models.Model):
caller_application = models.ForeignKey(to=Application, on_delete=models.PROTECT)
callee_application = models.CharField(to=Application, on_delete=models.PROTECT)
caller_user = models.ForeignKey(to=User, on_delete=models.PROTECT)
cost = models.DecimalField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
# TODO: move to external model
request = models.JSONField()
response = models.JSONField()