feat(imports): Access Pass products through the importer's signed-in account

IMVU hides Access Pass products from the signed out, so the hub learns about them from the importer: a "list" job
has it list a whole shop signed in (queued with each listing once its importer has an account that signed in with
Access Pass), and a job's product the hub can't see is looked up by the importer first (/info). The console no
longer says an account has no Access Pass when IMVU merely doesn't show it publicly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-11-08 07:21:49 -08:00
1 parent 56d25f7507
commit e2308aa0aa
12 files changed
+4865 -51

No files matched your search

+7 -3
View File
@@ -757,6 +757,7 @@ export const importGrant = pgTable(
// IMVU lists no Access Pass products to the signed out).
shopListedAt: timestamp("shop_listed_at", { withTimezone: true }),
shopListed: integer("shop_listed").notNull().default(0),
shopListedSignedIn: boolean("shop_listed_signed_in").notNull().default(false), // by the importer, signed in: AP products too
// "pending" (the catalog's team hasn't accepted), "active", "declined", "suspended", "withdrawn".
status: text("status").notNull().default("pending"),
statusReason: text("status_reason").notNull().default(""),
@@ -799,7 +800,7 @@ export const importJob = pgTable(
.notNull()
.references(() => importGrant.id, { onDelete: "cascade" }),
imvuProduct: bigint("imvu_product", { mode: "number" }).notNull(),
kind: text("kind").notNull(), // "import", "recheck"
kind: text("kind").notNull(), // "import", "recheck", "list" (a whole shop, signed in: imvuProduct is the creator's IMVU ID)
status: text("status").notNull().default("queued"), // "queued", "claimed", "done", "failed"
imvuRevision: integer("imvu_revision"), // done: the revision imported (or found unchanged)
reason: text("reason").notNull().default(""), // why it failed (last attempt)
@@ -811,10 +812,13 @@ export const importJob = pgTable(
},
(t) => [
index("import_job_queue").on(t.catalogId, t.status, t.nextAt),
// One open job per product and catalog.
// One open job per product and catalog, and one open listing per shop and catalog.
uniqueIndex("import_job_open")
.on(t.catalogId, t.imvuProduct)
.where(sql`${t.status} in ('queued', 'claimed')`),
.where(sql`${t.status} in ('queued', 'claimed') and ${t.kind} <> 'list'`),
uniqueIndex("import_job_list_open")
.on(t.catalogId, t.imvuProduct)
.where(sql`${t.status} in ('queued', 'claimed') and ${t.kind} = 'list'`),
],
);