diff --git a/src/features/catalog/domain/bulk-offers.ts b/src/features/catalog/domain/bulk-offers.ts index 265f7d9446..0c7dce4b04 100644 --- a/src/features/catalog/domain/bulk-offers.ts +++ b/src/features/catalog/domain/bulk-offers.ts @@ -1,6 +1,10 @@ import { z } from "zod"; import { CatalogInputError } from "./hierarchy"; -import { EMULATOR_POINTS_TYPES, offerIdSchema, offerInteger } from "./offer-input"; +import { + EMULATOR_POINTS_TYPES, + offerIdSchema, + offerInteger, +} from "./offer-input"; const priceChange = z .object({ @@ -27,7 +31,9 @@ export const bulkOfferChangesSchema = z .refine( (v) => v.pointsType === undefined || - EMULATOR_POINTS_TYPES.includes(v.pointsType as (typeof EMULATOR_POINTS_TYPES)[number]), + EMULATOR_POINTS_TYPES.includes( + v.pointsType as (typeof EMULATOR_POINTS_TYPES)[number], + ), "Points type is not supported by the emulator", ); export const bulkOfferInputSchema = z diff --git a/src/features/catalog/domain/offer-input.test.ts b/src/features/catalog/domain/offer-input.test.ts index 751dbdea8d..982e2e21fd 100644 --- a/src/features/catalog/domain/offer-input.test.ts +++ b/src/features/catalog/domain/offer-input.test.ts @@ -70,12 +70,8 @@ describe("emulator offer constraints", () => { expect(offerPatchSchema.parse({ amount: 1 })).toEqual({ amount: 1 }); }); it("rejects unsupported pointsType values", () => { - expect(offerPatchSchema.safeParse({ pointsType: 101 }).success).toBe( - false, - ); - expect(offerPatchSchema.safeParse({ pointsType: 103 }).success).toBe( - false, - ); + expect(offerPatchSchema.safeParse({ pointsType: 101 }).success).toBe(false); + expect(offerPatchSchema.safeParse({ pointsType: 103 }).success).toBe(false); expect(offerPatchSchema.safeParse({ pointsType: -1 }).success).toBe(false); }); it("accepts supported pointsType values", () => { @@ -88,12 +84,10 @@ describe("emulator offer constraints", () => { }); it("rejects limitedStack below limitedSells", () => { expect( - offerPatchSchema.safeParse({ limitedStack: 0, limitedSells: 1 }) - .success, + offerPatchSchema.safeParse({ limitedStack: 0, limitedSells: 1 }).success, ).toBe(false); expect( - offerPatchSchema.safeParse({ limitedStack: 5, limitedSells: 10 }) - .success, + offerPatchSchema.safeParse({ limitedStack: 5, limitedSells: 10 }).success, ).toBe(false); }); it("accepts limitedStack >= limitedSells", () => { diff --git a/src/features/catalog/domain/offer-input.ts b/src/features/catalog/domain/offer-input.ts index 3db16aff84..b26a9d71c4 100644 --- a/src/features/catalog/domain/offer-input.ts +++ b/src/features/catalog/domain/offer-input.ts @@ -52,7 +52,9 @@ export const offerPatchSchema = z .refine( (data) => data.pointsType === undefined || - EMULATOR_POINTS_TYPES.includes(data.pointsType as (typeof EMULATOR_POINTS_TYPES)[number]), + EMULATOR_POINTS_TYPES.includes( + data.pointsType as (typeof EMULATOR_POINTS_TYPES)[number], + ), "Points type is not supported by the emulator", ) .refine( diff --git a/src/lib/services/catalog-asset-repair-live.test.ts b/src/lib/services/catalog-asset-repair-live.test.ts index 58d7e18eba..8dc4ccec3e 100644 --- a/src/lib/services/catalog-asset-repair-live.test.ts +++ b/src/lib/services/catalog-asset-repair-live.test.ts @@ -30,7 +30,7 @@ describe.skipIf(!runLive)("catalog asset repair (live)", () => { process.env[m[1]] = value; } } - process.env["SKIP_ENV_VALIDATION"] = "1"; + process.env.SKIP_ENV_VALIDATION = "1"; [repairIcons, repairNitros] = await Promise.all([ import("@/lib/services/repair-icons").then((m) => m.repairMissingIcons), @@ -56,7 +56,7 @@ describe.skipIf(!runLive)("catalog asset repair (live)", () => { } if (evt.type === "error") log(`ICON ERROR: ${evt.message ?? ""}`); }); - log("icon result: " + JSON.stringify(iconResult)); + log(`icon result: ${JSON.stringify(iconResult)}`); log("=== NITRO REPAIR START ==="); lastPct = -1; @@ -73,10 +73,10 @@ describe.skipIf(!runLive)("catalog asset repair (live)", () => { } if (evt.type === "error") log(`NITRO ERROR: ${evt.message ?? ""}`); }); - log("nitro result: " + JSON.stringify(nitroResult)); + log(`nitro result: ${JSON.stringify(nitroResult)}`); log("=== ASSET REPAIR COMPLETE ==="); - log("icons: " + JSON.stringify(iconResult)); - log("nitros: " + JSON.stringify(nitroResult)); + log(`icons: ${JSON.stringify(iconResult)}`); + log(`nitros: ${JSON.stringify(nitroResult)}`); }, 1800000); }); diff --git a/src/lib/services/catalog-repair-direct-live.test.ts b/src/lib/services/catalog-repair-direct-live.test.ts index 1ea2187938..c5fb18d9da 100644 --- a/src/lib/services/catalog-repair-direct-live.test.ts +++ b/src/lib/services/catalog-repair-direct-live.test.ts @@ -48,11 +48,11 @@ describe.skipIf(!runLive)("catalog repair direct (live)", () => { log("=== ORPHANED REPAIR ==="); const orphan = await repair.repairOrphanedCatalog(); - log("orphaned result: " + JSON.stringify(orphan)); + log(`orphaned result: ${JSON.stringify(orphan)}`); log("=== DUPLICATE REPAIR ==="); const dup = await repair.repairDuplicateClassnames(); - log("duplicate result: " + JSON.stringify(dup)); + log(`duplicate result: ${JSON.stringify(dup)}`); log("=== VERIFY DUPLICATES ==="); const [dupRows] = (await db.execute(sql` @@ -61,6 +61,6 @@ describe.skipIf(!runLive)("catalog repair direct (live)", () => { GROUP BY item_name HAVING cnt > 1 `)) as unknown as [Array<{ item_name: string; cnt: number }>, unknown]; - log("remaining duplicate groups: " + JSON.stringify(dupRows)); + log(`remaining duplicate groups: ${JSON.stringify(dupRows)}`); }, 300000); });