fix: harden furni import pipeline for production
- importSingleFurni: actually update an existing item instead of failing on a primary key INSERT collision; refuse to reassign a spriteId owned by a different classname - reconcileFurniDataWithItemsBase: also sync each entry's offerid to the DB sprite id, not just the id - Move the full-table interaction_modes_count verification out of the per-item import hot path and run it once per batch/single import - clone-import: apply the auto-detected interaction_type (was hardcoded 'default'), set FurnitureData offerid and catalog_items.offer_id to the new local sprite id (was the source hotel's id / -1) - clone batch route: run the same post-import reconcile/verify/ownership/RCON consolidation as the furni batch route - upload-import: set offer_id to the allocated id in both the direct insert and the generated SQL migration (was -1) - generateCatalogSql: use the classname as catalog_name and the item id as offer_id so rows match the app-managed import convention - stats + missing-nitro endpoints: match catalog membership via item_ids instead of the catalog_name join, so translated display names no longer break counts - deleteImportedItem/rollback: delete catalog rows by the canonical item_ids link only - classifyFurni: wall items always classify as 'walls' before prefix rules (rare_/val_/xmas_) can misfile them
This commit is contained in:
1 parent
2b9a015afb
commit
6021a91ef7
9 files changed
+162
-66
No files matched your search
@@ -83,6 +83,9 @@ export const CLASSNAME_RULES: Array<{
|
||||
|
||||
/** Determine the catalog category for a furniture item based on its classname and type. */
|
||||
export function classifyFurni(classname: string, itemType: string): string {
|
||||
// Wall items are authoritative by type — a prefix rule (rare_, val_, xmas_,
|
||||
// …) must never pull a wall item out of the "walls" category.
|
||||
if (itemType === "wallitem" || itemType === "i") return "walls";
|
||||
for (const rule of CLASSNAME_RULES) {
|
||||
if (rule.test(classname, itemType)) return rule.cat;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user