Compare commits

..

4 Commits

Author SHA1 Message Date
Gitea Actions
5bc8f6a42b ci: Bump version to 0.12.25 [skip ci] 2026-01-31 03:35:28 +05:00
4fd5e900af minor test fixes
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 25m22s
2026-01-30 14:29:45 -08:00
Gitea Actions
39ab773b82 ci: Bump version to 0.12.24 [skip ci] 2026-01-30 06:23:37 +05:00
75406cd924 typescript fix
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 25m7s
2026-01-29 17:21:55 -08:00
6 changed files with 32 additions and 11 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "flyer-crawler", "name": "flyer-crawler",
"version": "0.12.23", "version": "0.12.25",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "flyer-crawler", "name": "flyer-crawler",
"version": "0.12.23", "version": "0.12.25",
"dependencies": { "dependencies": {
"@bull-board/api": "^6.14.2", "@bull-board/api": "^6.14.2",
"@bull-board/express": "^6.14.2", "@bull-board/express": "^6.14.2",

View File

@@ -1,7 +1,7 @@
{ {
"name": "flyer-crawler", "name": "flyer-crawler",
"private": true, "private": true,
"version": "0.12.23", "version": "0.12.25",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "concurrently \"npm:start:dev\" \"vite\"", "dev": "concurrently \"npm:start:dev\" \"vite\"",

View File

@@ -404,8 +404,10 @@ describe('useUserProfileDataQuery', () => {
// Both calls should have been made nearly simultaneously (within 50ms) // Both calls should have been made nearly simultaneously (within 50ms)
// This verifies Promise.all is being used for parallel execution // This verifies Promise.all is being used for parallel execution
expect(Math.abs((profileCallTime as number) - (achievementsCallTime as number))).toBeLessThan( expect(
50, Math.abs(
); (profileCallTime as unknown as number) - (achievementsCallTime as unknown as number),
),
).toBeLessThan(50);
}); });
}); });

View File

@@ -331,7 +331,9 @@ describe('FlyerAiProcessor', () => {
expect(result.needsReview).toBe(true); expect(result.needsReview).toBe(true);
expect(logger.warn).toHaveBeenCalledWith( expect(logger.warn).toHaveBeenCalledWith(
expect.objectContaining({ qualityIssues: ['Missing both valid_from and valid_to dates'] }), expect.objectContaining({
qualityIssues: ['Missing validity dates (valid_from or valid_to)'],
}),
expect.stringContaining('AI response has quality issues.'), expect.stringContaining('AI response has quality issues.'),
); );
}); });
@@ -358,10 +360,10 @@ describe('FlyerAiProcessor', () => {
qualityIssues: [ qualityIssues: [
'Missing store name', 'Missing store name',
'No items were extracted', 'No items were extracted',
'Missing both valid_from and valid_to dates', 'Missing validity dates (valid_from or valid_to)',
], ],
}, },
'AI response has quality issues. Flagging for review. Issues: Missing store name, No items were extracted, Missing both valid_from and valid_to dates', 'AI response has quality issues. Flagging for review. Issues: Missing store name, No items were extracted, Missing validity dates (valid_from or valid_to)',
); );
}); });
}); });

View File

@@ -99,8 +99,8 @@ export class FlyerAiProcessor {
} }
// 4. Check for flyer validity dates. // 4. Check for flyer validity dates.
if (!valid_from && !valid_to) { if (!valid_from || !valid_to) {
qualityIssues.push('Missing both valid_from and valid_to dates'); qualityIssues.push('Missing validity dates (valid_from or valid_to)');
} }
const needsReview = qualityIssues.length > 0; const needsReview = qualityIssues.length > 0;

View File

@@ -296,6 +296,23 @@ describe('E2E Receipt Processing Journey', () => {
expect(reprocessResponse.status).toBe(200); expect(reprocessResponse.status).toBe(200);
expect(reprocessResponse.body.data.message).toContain('reprocessing'); expect(reprocessResponse.body.data.message).toContain('reprocessing');
// Wait for the reprocess job to complete before deleting
await poll(
async () => {
const statusResponse = await getRequest()
.get(`/api/v1/receipts/${receipt2Result.rows[0].receipt_id}`)
.set('Authorization', `Bearer ${authToken}`);
return statusResponse.status === 200
? statusResponse.body
: { data: { receipt: { status: 'pending' } } };
},
(result) => {
const status = result.data?.receipt?.status;
return status === 'completed' || status === 'failed';
},
{ timeout: 15000, interval: 1000, description: 'receipt reprocessing' },
);
// Step 17: Delete the failed receipt // Step 17: Delete the failed receipt
const deleteResponse = await getRequest() const deleteResponse = await getRequest()
.delete(`/api/v1/receipts/${receipt2Result.rows[0].receipt_id}`) .delete(`/api/v1/receipts/${receipt2Result.rows[0].receipt_id}`)