feat(catalog): prevent and repair Arcturus emulator data errors
Block invalid catalog_items writes at the API level (points currency allowlist, non-negative prices, positive amount, limited stack >= sold count, unique sibling order numbers) and auto-assign unique order numbers on bulk create. Add a catalog-maintenance scan + transactional repair that fixes pre-existing rows: resets unsupported points_type, clamps negative costs, sets amount to 1, raises limited_stack, renumbers duplicate orders and deletes offers with missing page/item references. Surface the issue count and a fix button in the admin maintenance panel. Also: add enabled/retired flag to clone sources, classify poster and currency furniture in item-kind, and remove the obsolete update-Nitrov3.sh.
This commit is contained in:
1 parent
ad65d80d41
commit
3e69b72513
26 files changed
+17651
-3844
No files matched your search
@@ -18,6 +18,12 @@ export interface CloneSource {
|
||||
* "https://virtualcity.nl/dcr/hof_furni/{revision}/{classname}.swf"
|
||||
*/
|
||||
sourceSwfBaseUrl?: string;
|
||||
/**
|
||||
* When false the source is excluded from the merged list (defaults to
|
||||
* true). Used to retire sources whose assets can no longer be reached
|
||||
* while keeping their definition in the site setting for later reuse.
|
||||
*/
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
const KEY = "clone_sources";
|
||||
@@ -215,7 +221,7 @@ export async function listSources(): Promise<CloneSource[]> {
|
||||
for (const src of stored) {
|
||||
if (src.id && src.furnidataUrl) merged.set(src.id, src);
|
||||
}
|
||||
return Array.from(merged.values());
|
||||
return Array.from(merged.values()).filter((s) => s.enabled !== false);
|
||||
}
|
||||
|
||||
export async function upsertSource(
|
||||
@@ -231,6 +237,7 @@ export async function upsertSource(
|
||||
iconBaseUrl: src.iconBaseUrl.trim().replace(/\/+$/, ""),
|
||||
hotel: (src.hotel ?? "").trim(),
|
||||
sourceSwfBaseUrl: swfBase || undefined,
|
||||
enabled: src.enabled ?? true,
|
||||
};
|
||||
const idx = sources.findIndex((s) => s.id === entry.id);
|
||||
if (idx >= 0) sources[idx] = entry;
|
||||
|
||||
Reference in new issue
Block a user