forked from Yara724/api
fix: keep AI provider and billing metadata out of case results
This commit is contained in:
@@ -187,7 +187,19 @@ describe("durable AI jobs", () => {
|
||||
{
|
||||
imageKey: aiImageKey(image.path),
|
||||
status: "completed",
|
||||
result,
|
||||
result: {
|
||||
...result,
|
||||
requestId: "PRIVATE_REQUEST",
|
||||
pipeline: { price_model: "PRIVATE_MODEL" },
|
||||
pricing: {
|
||||
car: "پژو",
|
||||
totals: { overall: 1200000 },
|
||||
costUsd: 0.04,
|
||||
model: "PRIVATE_MODEL",
|
||||
durationMs: 1000,
|
||||
},
|
||||
},
|
||||
errorRequestId: "PRIVATE_ERROR_REQUEST",
|
||||
path: "private",
|
||||
attempts: 1,
|
||||
},
|
||||
@@ -204,6 +216,16 @@ describe("durable AI jobs", () => {
|
||||
result,
|
||||
});
|
||||
expect(view.images[0]).not.toHaveProperty("path");
|
||||
expect(view.images[0]).not.toHaveProperty("errorRequestId");
|
||||
expect(view.images[0].result).not.toHaveProperty("requestId");
|
||||
expect(view.images[0].result).not.toHaveProperty("pipeline");
|
||||
expect(view.images[0].result.pricing).toMatchObject({
|
||||
car: "پژو",
|
||||
totals: { overall: 1200000 },
|
||||
});
|
||||
for (const key of ["costUsd", "model", "durationMs"])
|
||||
expect(view.images[0].result.pricing).not.toHaveProperty(key);
|
||||
expect(JSON.stringify(view)).not.toContain("PRIVATE_");
|
||||
});
|
||||
it("manual retry affects only failed jobs for current claim/photos", async () => {
|
||||
const { service, jobs } = setup();
|
||||
|
||||
Reference in New Issue
Block a user