fix error in gitignore
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
from django.db import models
|
||||
|
||||
from apps.core.models import TimeStampedModel, UUIDModel
|
||||
|
||||
|
||||
class Invoice(UUIDModel, TimeStampedModel):
|
||||
class SyncState(models.TextChoices):
|
||||
PENDING = "pending", "Pending"
|
||||
PROCESSING = "processing", "Processing"
|
||||
SYNCHRONIZED = "synchronized", "Synchronized"
|
||||
FAILED = "failed", "Failed"
|
||||
RETRYING = "retrying", "Retrying"
|
||||
CANCELLED = "cancelled", "Cancelled"
|
||||
|
||||
order = models.ForeignKey("orders.ProcessingOrder", on_delete=models.PROTECT, related_name="invoices")
|
||||
number = models.CharField(max_length=40, unique=True)
|
||||
amount = models.DecimalField(max_digits=18, decimal_places=2)
|
||||
currency = models.CharField(max_length=8, default="IRR")
|
||||
sync_state = models.CharField(max_length=16, choices=SyncState.choices, default=SyncState.PENDING)
|
||||
odoo_invoice_id = models.CharField(max_length=120, blank=True)
|
||||
last_error = models.TextField(blank=True)
|
||||
synced_at = models.DateTimeField(null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["-created_at"]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.number
|
||||
Reference in New Issue
Block a user