Add full application: receipt scanning, auth, billing, and account deletion
Brings the working codebase (Next.js app, auth system, Stripe billing, Docker/deploy config, tests, docs) into version control on top of the placeholder initial commit, and adds account self-deletion (Danger Zone in Settings, password + typed-email confirmation, cascading DB cleanup, Stripe cancellation) per GDPR right-to-erasure. Excludes local build caches, node_modules, and internal agent scratch files; .gitignore hardened to keep those out going forward. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
27
scripts/test_extractor_live.mjs
Normal file
27
scripts/test_extractor_live.mjs
Normal file
@@ -0,0 +1,27 @@
|
||||
import fs from "fs";
|
||||
import { extractReceiptData } from "../src/lib/ai/extractor.ts";
|
||||
|
||||
const envContent = fs.readFileSync(".env.local", "utf-8");
|
||||
const apiKeyMatch = envContent.match(/OPENROUTER_API_KEY=([^\r\n]+)/);
|
||||
process.env.OPENROUTER_API_KEY = apiKeyMatch ? apiKeyMatch[1].trim() : "";
|
||||
|
||||
const demoImgPath = "public/demo/01_aral_tankbeleg_muenchen.jpg";
|
||||
const imgBase64 = fs.readFileSync(demoImgPath).toString("base64");
|
||||
const dataUrl = `data:image/jpeg;base64,${imgBase64}`;
|
||||
|
||||
async function testExtractorLive() {
|
||||
console.log("=== TESTING LIVE EXTRACTOR WITH OPENROUTER ===");
|
||||
const result = await extractReceiptData({
|
||||
base64DataUrl: dataUrl,
|
||||
fileName: "random_real_receipt_photo.jpg"
|
||||
});
|
||||
|
||||
console.log("Extracted Merchant:", result.merchant.name);
|
||||
console.log("Extracted Gross Total:", result.totalAmount.value, result.currency);
|
||||
console.log("Extracted Date:", result.date.isoDate);
|
||||
console.log("Extracted Tax Breakdown:", JSON.stringify(result.taxBreakdown));
|
||||
console.log("Extracted Line Items:", JSON.stringify(result.lineItems));
|
||||
console.log("Validation:", JSON.stringify(result.validation));
|
||||
}
|
||||
|
||||
testExtractorLive().catch(console.error);
|
||||
Reference in New Issue
Block a user