- Auto Import page replaced with a static Import Guide: step-by-step
instructions for CGD/Trade Republic/generic CSV export, duplicate
detection explanation, and a curl example for headless automation
- Removed POST /auto-import and DELETE /auto-import/{id} routes and
their handler logic; schedule CRUD was misleading since no bank
exposes an unauthenticated CSV endpoint
- Nav label changed from "Auto Import" to "Import Guide"
- Transactions page now renders an amber banner when redirected with
?notice=all_duplicates (every row in the uploaded file was skipped)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
83 lines
4.7 KiB
HTML
83 lines
4.7 KiB
HTML
{{template "base" .}}
|
|
|
|
{{define "content"}}
|
|
{{$d := .}}
|
|
<style>
|
|
.guide-step { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:20px 24px; margin-bottom:16px; display:flex; gap:16px; }
|
|
.step-num { font-size:1.2rem; font-weight:800; color:var(--accent); min-width:28px; }
|
|
.step-body h3 { margin:0 0 6px; font-size:0.95rem; font-weight:700; }
|
|
.step-body p { margin:0; font-size:0.85rem; color:var(--muted); line-height:1.5; }
|
|
.format-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:12px; margin-top:12px; }
|
|
.format-card { background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:14px 16px; }
|
|
.format-card .name { font-weight:700; font-size:0.9rem; margin-bottom:4px; }
|
|
.format-card .desc { font-size:0.8rem; color:var(--muted); }
|
|
.tip { background:rgba(99,102,241,0.08); border:1px solid rgba(99,102,241,0.25); border-radius:10px; padding:14px 18px; font-size:0.85rem; color:var(--text); margin-top:20px; }
|
|
.tip strong { color:var(--accent); }
|
|
code { font-family:monospace; font-size:0.82rem; background:var(--bg); border:1px solid var(--border); border-radius:5px; padding:1px 6px; }
|
|
</style>
|
|
|
|
<div style="display:flex; align-items:center; gap:14px; margin-bottom:28px;">
|
|
<div>
|
|
<h1 style="margin:0 0 4px;">Import Guide</h1>
|
|
<p style="margin:0; font-size:0.85rem; color:var(--muted);">How to get your bank transactions into the app</p>
|
|
</div>
|
|
<a href="/import" class="btn btn-primary" style="margin-left:auto;">Upload CSV →</a>
|
|
</div>
|
|
|
|
<div class="guide-step">
|
|
<div class="step-num">1</div>
|
|
<div class="step-body">
|
|
<h3>Export a CSV from your bank</h3>
|
|
<p>Log into your bank's online portal and download a transaction extract for the period you want. Most Portuguese banks offer this under <em>Movimentos</em> or <em>Extratos</em>.</p>
|
|
<div class="format-grid" style="margin-top:14px;">
|
|
<div class="format-card">
|
|
<div class="name">CGD (Caixa Geral de Depósitos)</div>
|
|
<div class="desc">Netbanco → Consultas → Movimentos de Conta → Exportar. Choose <strong>CSV</strong>.</div>
|
|
</div>
|
|
<div class="format-card">
|
|
<div class="name">Trade Republic</div>
|
|
<div class="desc">App → Profile → Documents → Activity. Export as CSV.</div>
|
|
</div>
|
|
<div class="format-card">
|
|
<div class="name">Generic / Other banks</div>
|
|
<div class="desc">Any CSV with columns: <code>Date</code>, <code>Description</code>, <code>Amount</code>. The importer auto-detects column order.</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="guide-step">
|
|
<div class="step-num">2</div>
|
|
<div class="step-body">
|
|
<h3>Upload and preview</h3>
|
|
<p>Go to <a href="/import" style="color:var(--accent);">Import</a>, pick the account and format, then select your file. You'll see a preview of every row with auto-suggested categories. Rows already in the database are shown greyed out and will be skipped automatically — safe to re-upload the same file.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="guide-step">
|
|
<div class="step-num">3</div>
|
|
<div class="step-body">
|
|
<h3>Review categories and confirm</h3>
|
|
<p>Adjust any auto-categorised rows using the dropdown selectors, then click <strong>Confirm Import</strong>. Only new transactions are saved.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tip">
|
|
<strong>Tip — avoid duplicates:</strong> the importer fingerprints each row by date, description, amount, and account. Re-uploading a file that overlaps with a previous import is safe; duplicates are detected and skipped at both preview and confirm time.
|
|
</div>
|
|
|
|
<div style="margin-top:28px; background:var(--card); border:1px solid var(--border); border-radius:12px; padding:20px 24px;">
|
|
<h3 style="margin:0 0 8px; font-size:0.95rem;">Automate with a script</h3>
|
|
<p style="font-size:0.85rem; color:var(--muted); margin:0 0 14px;">
|
|
If you export your CSV on a schedule (e.g. via a cron job or n8n), you can push it directly to the import endpoint without going through the UI:
|
|
</p>
|
|
<pre style="background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:14px 16px; font-size:0.8rem; overflow-x:auto; margin:0;">curl -X POST https://<your-host>/import/preview \
|
|
-H "X-Auth-User-Id: <user-id>" \
|
|
-H "X-Auth-Email: <email>" \
|
|
-F "account_id=<account-id>" \
|
|
-F "format=cgd" \
|
|
-F "file=@movements.csv"</pre>
|
|
<p style="font-size:0.8rem; color:var(--muted); margin:12px 0 0;">The preview endpoint returns an HTML page; for headless import pipe the confirmed rows to <code>POST /import/confirm</code> with the same <code>account_id</code>, <code>format</code>, <code>raw_data</code>, and <code>categories[]</code> fields.</p>
|
|
</div>
|
|
{{end}}
|