feat(imports): Access Pass products through the importer's signed-in account (#20)
Release / release (push) Successful in 4s
CI / test (push) Successful in 7m28s
CI / image (apps/api/Dockerfile, t5de-hub-api) (push) Successful in 5s
CI / image (apps/web/Dockerfile, t5de-hub-web) (push) Successful in 16s

Co-authored-by: dhkatz <[email protected]>
This commit was merged in pull request #20.
This commit is contained in:
dhkatz authored and dhkatz committed 2026-11-08 16:10:34 +00:00
1 parent 56d25f7507
commit cc6959082c
12 files changed
+4871 -51

No files matched your search

@@ -0,0 +1,4 @@
DROP INDEX "import_job_open";--> statement-breakpoint
ALTER TABLE "import_grant" ADD COLUMN "shop_listed_signed_in" boolean DEFAULT false NOT NULL;--> statement-breakpoint
CREATE UNIQUE INDEX "import_job_list_open" ON "import_job" USING btree ("catalog_id","imvu_product") WHERE "import_job"."status" in ('queued', 'claimed') and "import_job"."kind" = 'list';--> statement-breakpoint
CREATE UNIQUE INDEX "import_job_open" ON "import_job" USING btree ("catalog_id","imvu_product") WHERE "import_job"."status" in ('queued', 'claimed') and "import_job"."kind" <> 'list';
File diff suppressed because it is too large. Load diff
+7
View File
@@ -141,6 +141,13 @@
"when": 1794092472616,
"tag": "0019_shop_listing",
"breakpoints": true
},
{
"idx": 20,
"version": "7",
"when": 1794150630963,
"tag": "0020_importer_signed_in",
"breakpoints": true
}
]
}
+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'`),
],
);