feat: add receipt proxy tier guard, 422 forwarding, and tests (refs #139)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* @ai-summary Fastify routes for OCR API
|
||||
*/
|
||||
import { FastifyInstance, FastifyPluginAsync, FastifyPluginOptions } from 'fastify';
|
||||
import { requireTier } from '../../../core/middleware/require-tier';
|
||||
import { OcrController } from './ocr.controller';
|
||||
|
||||
export const ocrRoutes: FastifyPluginAsync = async (
|
||||
@@ -23,9 +24,9 @@ export const ocrRoutes: FastifyPluginAsync = async (
|
||||
handler: ctrl.extractVin.bind(ctrl),
|
||||
});
|
||||
|
||||
// POST /api/ocr/extract/receipt - Receipt-specific OCR extraction
|
||||
// POST /api/ocr/extract/receipt - Receipt-specific OCR extraction (Pro tier required)
|
||||
fastify.post('/ocr/extract/receipt', {
|
||||
preHandler: [requireAuth],
|
||||
preHandler: [requireAuth, requireTier('fuelLog.receiptScan')],
|
||||
handler: ctrl.extractReceipt.bind(ctrl),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user