Initial commit: Add EAMCO Service API
- Add FastAPI service for managing oil delivery services - Implement service scheduling and management endpoints - Add customer service history tracking - Include database models for services, customers, and auto-delivery - Add authentication and authorization middleware - Configure Docker support for local, dev, and prod environments - Add comprehensive .gitignore for Python projects
This commit is contained in:
48
app/models/service.py
Normal file
48
app/models/service.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from sqlalchemy import Column, Integer, String, Numeric, DateTime, Text, Date
|
||||
from database import Base
|
||||
|
||||
|
||||
class Service_Service(Base):
|
||||
__tablename__ = 'service_service'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
customer_id = Column(Integer)
|
||||
customer_name = Column(String(1000))
|
||||
customer_address = Column(String(1000))
|
||||
customer_town = Column(String(140))
|
||||
customer_state = Column(String(140))
|
||||
customer_zip = Column(String(10))
|
||||
# tune-up = 0, no heat = 1, fix = 2, tank = 3, other = 4
|
||||
type_service_call = Column(Integer)
|
||||
when_ordered = Column(DateTime)
|
||||
scheduled_date = Column(DateTime)
|
||||
description = Column(Text)
|
||||
service_cost = Column(Numeric(10, 2), nullable=True)
|
||||
payment_type = Column(Integer, nullable=True)
|
||||
payment_card_id = Column(Integer, nullable=True)
|
||||
payment_status = Column(Integer, nullable=True)
|
||||
|
||||
|
||||
class Service_Parts(Base):
|
||||
__tablename__ = 'service_parts'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
customer_id = Column(Integer)
|
||||
oil_filter = Column(String(100))
|
||||
oil_filter_2 = Column(String(100))
|
||||
oil_nozzle = Column(String(10))
|
||||
oil_nozzle_2 = Column(String(10))
|
||||
hot_water_tank = Column(Integer)
|
||||
|
||||
|
||||
class Service_Plans(Base):
|
||||
__tablename__ = 'service_plans'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
customer_id = Column(Integer)
|
||||
contract_plan = Column(Integer, default=0) # 0=no contract, 1=standard, 2=premium
|
||||
contract_years = Column(Integer, default=1)
|
||||
contract_start_date = Column(Date)
|
||||
Reference in New Issue
Block a user