Add bottle size, bourbon list modal, and stat improvements
- Add bottle_size field to User model and UserResponse/UserUpdate schemas - Settings modal includes bottle size input (shots capacity) - Community bottles and My Bottle page show fill bar based on bottle size - Community bottle cards are clickable — opens searchable bourbon list modal - Add total_shots_added stat to replace duplicate net volume on dashboard - Reorder dashboard stats: Bourbons Added, Total Poured In, Shots Remaining, Est. Proof - Theme-matched custom scrollbar (amber on dark) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ def _calc_stats(entries: list[Entry]) -> BottleStats:
|
||||
|
||||
return BottleStats(
|
||||
total_add_entries=len(adds),
|
||||
total_shots_added=round(total_add_shots, 2),
|
||||
current_total_shots=round(current_total, 2),
|
||||
estimated_proof=round(estimated_proof, 1) if estimated_proof is not None else None,
|
||||
)
|
||||
@@ -61,9 +62,8 @@ async def create_entry(
|
||||
amount_shots=body.amount_shots,
|
||||
notes=body.notes,
|
||||
)
|
||||
async with db.begin():
|
||||
db.add(entry)
|
||||
|
||||
db.add(entry)
|
||||
await db.commit()
|
||||
await db.refresh(entry)
|
||||
return entry
|
||||
|
||||
@@ -81,8 +81,8 @@ async def delete_entry(
|
||||
if not entry:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Entry not found")
|
||||
|
||||
async with db.begin():
|
||||
await db.delete(entry)
|
||||
await db.delete(entry)
|
||||
await db.commit()
|
||||
|
||||
|
||||
@router.get("/stats", response_model=BottleStats)
|
||||
|
||||
Reference in New Issue
Block a user