major claude changes

This commit is contained in:
2026-01-28 21:54:58 -05:00
parent 6316309184
commit ac4354716b
15 changed files with 269 additions and 95 deletions

View File

@@ -1,3 +1,4 @@
import logging
from fastapi import APIRouter
from fastapi.responses import JSONResponse
from fastapi.encoders import jsonable_encoder
@@ -9,6 +10,8 @@ from decimal import Decimal
from app.models.auto import Auto_Delivery, Tickets_Auto_Delivery, Auto_Temp
from app.models.delivery import Delivery
logger = logging.getLogger(__name__)
# Constants from fuel_estimator
HOT_WATER_DAILY_USAGE = Decimal('1.0')
K_FACTOR_SMOOTHING_WEIGHT = Decimal('0.7')
@@ -33,6 +36,7 @@ def fix_customer_last_delivered():
Returns statistics and a list of changes made.
"""
logger.info("GET /fixstuff/lastdelivered - Fixing customer last delivered dates")
auto_deliveries = session.query(Auto_Delivery).all()
changes = []
total_customers = len(auto_deliveries)
@@ -76,6 +80,7 @@ def estimate_customer_gallons(update_db: int):
Multiple deliveries: use historical average. Includes address and scaling factor.
When update_db=1, updates estimated_gallons_left and house_factor in database.
"""
logger.info(f"GET /fixstuff/estimate_gallons/{update_db} - Estimating customer gallons (update_db={update_db})")
auto_deliveries = session.query(Auto_Delivery).all()
estimates = []
for ad in auto_deliveries: