Chore: Pushing changes to migrate from windows/wsl to fedora
This commit is contained in:
@@ -49,11 +49,12 @@ class Product(SQLModel, table=True):
|
||||
"""
|
||||
__table_args__ = (UniqueConstraint("product_code"),)
|
||||
|
||||
id: Optional[int] = Field(nullable=False, primary_key=True)
|
||||
id: Optional[int] = Field(default=None, primary_key=True)
|
||||
product_code: str = Field(max_length=10, nullable=False)
|
||||
product_name: str = Field(max_length=20, nullable=False, unique=True)
|
||||
purchase_price: int = Field(nullable=False)
|
||||
date_modified: datetime = Field(
|
||||
default=None,
|
||||
sa_column=Column(DateTime,
|
||||
server_default=func.now(),
|
||||
server_onupdate=func.now())
|
||||
@@ -77,6 +78,7 @@ class Payment(SQLModel, table=True):
|
||||
amount: int = Field(nullable=False)
|
||||
payment_method: str = Field(max_length=24, nullable=False)
|
||||
date: datetime = Field(
|
||||
default=None,
|
||||
sa_column=Column(DateTime, server_default=func.now())
|
||||
)
|
||||
|
||||
@@ -96,5 +98,6 @@ class Credit(SQLModel, table=True):
|
||||
qty: int = Field(nullable=False)
|
||||
amount: int = Field(nullable=False)
|
||||
date: datetime = Field(
|
||||
default=None,
|
||||
sa_column=Column(DateTime, server_default=func.now())
|
||||
)
|
||||
|
||||
@@ -1,7 +1,38 @@
|
||||
from sqlmodel import SQLModel
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ClientCreate(SQLModel):
|
||||
tin_number: int
|
||||
names: str
|
||||
phone_number: str
|
||||
|
||||
|
||||
class ClientUpdate(SQLModel):
|
||||
tin_number: Optional[int] = None
|
||||
names: Optional[str] = None
|
||||
phone_number: Optional[str] = None
|
||||
|
||||
|
||||
class SupplierCreate(SQLModel):
|
||||
tin_number: int
|
||||
names: str
|
||||
phone_number: str
|
||||
|
||||
|
||||
class SupplierUpdate(ClientUpdate):
|
||||
tin_number: Optional[int] = None
|
||||
names: Optional[str] = None
|
||||
phone_number: Optional[str] = None
|
||||
|
||||
|
||||
class ProductCreate(SQLModel):
|
||||
product_code: str
|
||||
product_name: str
|
||||
purchase_price: int
|
||||
|
||||
|
||||
class ProductUpdate(SQLModel):
|
||||
product_code: Optional[str] = None
|
||||
product_name: Optional[str] = None
|
||||
purchase_price: Optional[int] = None
|
||||
|
||||
Reference in New Issue
Block a user