Initial commit from monorepo
This commit is contained in:
21
purchase_requests/models.py
Normal file
21
purchase_requests/models.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.db import models
|
||||
import uuid
|
||||
|
||||
|
||||
class Request(models.Model):
|
||||
"""Заявка покупателя (RFQ - Request For Quotation)"""
|
||||
uuid = models.CharField(max_length=100, unique=True, default=uuid.uuid4)
|
||||
product_uuid = models.CharField(max_length=100)
|
||||
quantity = models.DecimalField(max_digits=10, decimal_places=2)
|
||||
source_location_uuid = models.CharField(max_length=100)
|
||||
user_id = models.CharField(max_length=255)
|
||||
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
db_table = 'calculations' # Keep old table name for data compatibility
|
||||
ordering = ['-created_at']
|
||||
|
||||
def __str__(self):
|
||||
return f"Заявка {self.uuid} - {self.quantity}"
|
||||
Reference in New Issue
Block a user