feat(25-01): Zod schemas, upsert service functions, passing tests
- Add upsertGlobalItemSchema and bulkUpsertGlobalItemsSchema to schemas.ts - Add UpsertGlobalItemInput and BulkUpsertGlobalItemsInput types to types.ts - Implement upsertGlobalItem with onConflictDoUpdate and tag sync - Implement bulkUpsertGlobalItems processing array in single transaction - Fix migration 0003 to only add new columns + unique constraint - All 21 tests pass including 8 new upsert operation tests
This commit is contained in:
@@ -312,9 +312,13 @@ describe("Global Item Service", () => {
|
||||
imageSourceUrl: "https://apidura.com/images/handlebar-pack.jpg",
|
||||
});
|
||||
|
||||
expect(result.item.sourceUrl).toBe("https://apidura.com/shop/handlebar-pack/");
|
||||
expect(result.item.sourceUrl).toBe(
|
||||
"https://apidura.com/shop/handlebar-pack/",
|
||||
);
|
||||
expect(result.item.imageCredit).toBe("Apidura Ltd");
|
||||
expect(result.item.imageSourceUrl).toBe("https://apidura.com/images/handlebar-pack.jpg");
|
||||
expect(result.item.imageSourceUrl).toBe(
|
||||
"https://apidura.com/images/handlebar-pack.jpg",
|
||||
);
|
||||
});
|
||||
|
||||
it("upsertGlobalItem with tags creates tags and links them", async () => {
|
||||
|
||||
Reference in New Issue
Block a user