From 305a0c42ff4113e7fcc4f9a1f4c1ec7dc697ebbb Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 18 Aug 2026 19:34:34 +0200 Subject: [PATCH] Derive catalog offer_id from furnidata sprite id Import used a hardcoded offer_id of -1, while the matching FurnitureData.json entry already carries offerid = spriteId. Set catalog_items.offer_id to the sprite id on insert and update so purchases resolve to the correct furni offer. --- src/lib/services/furni-import.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/services/furni-import.ts b/src/lib/services/furni-import.ts index 392f75dbd9..400db6b04e 100644 --- a/src/lib/services/furni-import.ts +++ b/src/lib/services/furni-import.ts @@ -783,7 +783,7 @@ export async function importSingleFurni(params: { const price = autoPriceFurni(classname); await db.execute(sql` UPDATE catalog_items - SET page_id = ${pageIdStr}, cost_credits = ${price.credits}, cost_points = ${price.points}, points_type = ${price.pointsType} + SET page_id = ${pageIdStr}, cost_credits = ${price.credits}, cost_points = ${price.points}, points_type = ${price.pointsType}, offer_id = ${spriteId} WHERE id = ${catalogItemId} `); catalogUpdated = true; @@ -803,7 +803,7 @@ export async function importSingleFurni(params: { catalogItemId = await allocateCatalogItemId(async (nextCatalogId) => { await db.execute(sql` INSERT INTO catalog_items (id, page_id, item_ids, catalog_name, cost_credits, cost_points, points_type, amount, order_number, offer_id, extradata) - VALUES (${nextCatalogId}, ${pageIdStr}, ${itemIdStr}, ${classname}, ${price.credits}, ${price.points}, ${price.pointsType}, 1, 1, '-1', '') + VALUES (${nextCatalogId}, ${pageIdStr}, ${itemIdStr}, ${classname}, ${price.credits}, ${price.points}, ${price.pointsType}, 1, 1, ${spriteId}, '') `); return nextCatalogId; });