diff --git a/app/wowplatter_v1.py b/app/wowplatter_v1.py index c810dec..c6f6393 100644 --- a/app/wowplatter_v1.py +++ b/app/wowplatter_v1.py @@ -60,6 +60,7 @@ class IntakeIn(BaseModel): sleeve: str | None = None notes: str | None = None price: float | None = None + est_market_value: float | None = None # DealGod target/median, carried from the PRICEGOD overlay sku: str | None = None kind: str = "vinyl" @@ -85,17 +86,18 @@ async def inventory_intake(body: IntakeIn, ident=Depends(require_token), db=Depe sku = body.sku or _new_sku() await db.execute(text(""" INSERT INTO inventory (sku, store_id, kind, release_id, identifier, title, price, - condition, sleeve_cond, weight_g, notes, staged, status) + condition, sleeve_cond, weight_g, notes, est_market_value, staged, status) VALUES (:sku, :sid, :kind, :rid, :ident, :title, :price, - :cond, :sleeve, :wt, :notes, true, 'staged') + :cond, :sleeve, :wt, :notes, :emv, true, 'staged') ON CONFLICT (sku) DO UPDATE SET release_id = EXCLUDED.release_id, title = EXCLUDED.title, price = EXCLUDED.price, condition = EXCLUDED.condition, sleeve_cond = EXCLUDED.sleeve_cond, - notes = EXCLUDED.notes, updated_at = now() + notes = EXCLUDED.notes, est_market_value = EXCLUDED.est_market_value, updated_at = now() """), { "sku": sku, "sid": ident["store_id"], "kind": body.kind, "rid": body.release_id, "ident": body.identifier, "title": title, "price": body.price, "cond": body.condition, "sleeve": body.sleeve, "wt": weight, "notes": body.notes, + "emv": body.est_market_value, }) await db.commit() return {"ok": True, "sku": sku, "staged": True,