ifixkart-admin/Backend/app/models/StockMovementModel.py
Adithiyan bbd3a3e959 feat: initial commit — full platform snapshot
- Backend: FastAPI app with all models, services, schemas, routes
- Admin Panel: Next.js dashboard with all modules
  (CRM, POS, repairs, warranties, billing, notifications, etc.)
- Ecommerce: storefront (submodule) + product catalog
- AI Agents: .agents/ skill library for Antigravity IDE
- Docs: architecture, billing, notification gateway markdown
- Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
2026-10-13 12:59:47 +05:30

15 lines
863 B
Python

from sqlalchemy import Column, String, Integer, DateTime
from sqlalchemy.sql import func
from app.core.database.db_session import Base
class StockMovement(Base):
__tablename__ = "stock_movements"
movement_id = Column(String(26), primary_key=True)
entity_type = Column(String(20), nullable=False) # 'variant' or 'part'
entity_id = Column(String(26), nullable=False) # product variant id or part id
movement_type = Column(String(30), nullable=False) # Purchase, Sale, Repair, Adjustment, Return, Transfer, Damage
quantity = Column(Integer, nullable=False) # can be negative (outflow) or positive (inflow)
reference_type = Column(String(50), nullable=False) # e.g. Order, PurchaseOrder, RepairBooking, ManualAdjustment
reference_id = Column(String(36), nullable=False)
created_at = Column(DateTime, server_default=func.now())