Spaces:
Running
Running
MichaelEdou Claude Opus 4.6 commited on
Commit ·
fe203ef
1
Parent(s): d2cc9d2
Set default branch to Montreal for unclassified Interac transactions
Browse files- files/scanService.ts +1 -1
- packages/server/src/services/pdfService.ts +2 -2
- packages/server/src/services/scanService.ts +1 -1
- packages/shared/src/constants/branches.ts +1 -1
- packages/web/src/components/dashboard/TransactionTable.tsx +3 -3
- packages/web/src/components/reports/BranchChart.tsx +1 -1
- packages/web/src/components/reports/ExportSection.tsx +1 -1
- packages/web/src/components/review/ValidationForm.tsx +1 -1
files/scanService.ts
CHANGED
|
@@ -172,7 +172,7 @@ export async function executeScan(
|
|
| 172 |
// Stage 3: Route to branch
|
| 173 |
const branch = parsed.recipient_email
|
| 174 |
? resolveBranch(parsed.recipient_email)
|
| 175 |
-
: '
|
| 176 |
|
| 177 |
// Build complete transaction
|
| 178 |
const transaction: InteracTransaction = {
|
|
|
|
| 172 |
// Stage 3: Route to branch
|
| 173 |
const branch = parsed.recipient_email
|
| 174 |
? resolveBranch(parsed.recipient_email)
|
| 175 |
+
: 'Montreal';
|
| 176 |
|
| 177 |
// Build complete transaction
|
| 178 |
const transaction: InteracTransaction = {
|
packages/server/src/services/pdfService.ts
CHANGED
|
@@ -81,7 +81,7 @@ export function generateReceipt(transaction: InteracTransaction): Promise<Buffer
|
|
| 81 |
['Devise', transaction.currency || 'CAD'],
|
| 82 |
['Référence', transaction.reference || 'N/A'],
|
| 83 |
['Message', transaction.message || '—'],
|
| 84 |
-
['Succursale', (transaction as any).branch || '
|
| 85 |
['Statut', STATUS_LABELS[transaction.status] || transaction.status],
|
| 86 |
];
|
| 87 |
|
|
@@ -155,7 +155,7 @@ export async function generateBatchReceipts(txns: InteracTransaction[]): Promise
|
|
| 155 |
['Montant', formatCurrencyPdf(tx.amount)],
|
| 156 |
['Référence', tx.reference || 'N/A'],
|
| 157 |
['Message', tx.message || '—'],
|
| 158 |
-
['Succursale', (tx as any).branch || '
|
| 159 |
['Statut', STATUS_LABELS[tx.status] || tx.status],
|
| 160 |
];
|
| 161 |
|
|
|
|
| 81 |
['Devise', transaction.currency || 'CAD'],
|
| 82 |
['Référence', transaction.reference || 'N/A'],
|
| 83 |
['Message', transaction.message || '—'],
|
| 84 |
+
['Succursale', (transaction as any).branch || 'Montreal'],
|
| 85 |
['Statut', STATUS_LABELS[transaction.status] || transaction.status],
|
| 86 |
];
|
| 87 |
|
|
|
|
| 155 |
['Montant', formatCurrencyPdf(tx.amount)],
|
| 156 |
['Référence', tx.reference || 'N/A'],
|
| 157 |
['Message', tx.message || '—'],
|
| 158 |
+
['Succursale', (tx as any).branch || 'Montreal'],
|
| 159 |
['Statut', STATUS_LABELS[tx.status] || tx.status],
|
| 160 |
];
|
| 161 |
|
packages/server/src/services/scanService.ts
CHANGED
|
@@ -272,7 +272,7 @@ async function runScan(jobId: string, scanRequest: ScanRequest, userId: string,
|
|
| 272 |
const recipientEmail = parsed.recipient_email || extractEmailAddress(email.to);
|
| 273 |
const branch = recipientEmail
|
| 274 |
? await resolveBranch(recipientEmail)
|
| 275 |
-
: '
|
| 276 |
|
| 277 |
// Screenshots are deferred to background after scan completes (see Phase 6b)
|
| 278 |
|
|
|
|
| 272 |
const recipientEmail = parsed.recipient_email || extractEmailAddress(email.to);
|
| 273 |
const branch = recipientEmail
|
| 274 |
? await resolveBranch(recipientEmail)
|
| 275 |
+
: 'Montreal';
|
| 276 |
|
| 277 |
// Screenshots are deferred to background after scan completes (see Phase 6b)
|
| 278 |
|
packages/shared/src/constants/branches.ts
CHANGED
|
@@ -50,5 +50,5 @@ export const BRANCH_MAPPING: Record<string, string> = {
|
|
| 50 |
};
|
| 51 |
|
| 52 |
export function resolveBranch(recipientEmail: string): string {
|
| 53 |
-
return BRANCH_MAPPING[recipientEmail.toLowerCase()] ?? '
|
| 54 |
}
|
|
|
|
| 50 |
};
|
| 51 |
|
| 52 |
export function resolveBranch(recipientEmail: string): string {
|
| 53 |
+
return BRANCH_MAPPING[recipientEmail.toLowerCase()] ?? 'Montreal';
|
| 54 |
}
|
packages/web/src/components/dashboard/TransactionTable.tsx
CHANGED
|
@@ -160,7 +160,7 @@ export default function TransactionTable() {
|
|
| 160 |
[t('table.amount')]: tx.amount,
|
| 161 |
'Currency': tx.currency || 'CAD',
|
| 162 |
[t('table.reference')]: tx.reference || '',
|
| 163 |
-
[t('table.branch')]: tx.branch || '
|
| 164 |
[t('table.accuracy')]: accuracy === -1 ? '' : `${accuracy}%`,
|
| 165 |
[t('table.status')]: tx.reviewed ? t('status.verified') : t('status.notVerified'),
|
| 166 |
'Email': tx.recipientEmail || '',
|
|
@@ -464,10 +464,10 @@ export default function TransactionTable() {
|
|
| 464 |
{tx.reference || '—'}
|
| 465 |
</span>
|
| 466 |
</TableCell>
|
| 467 |
-
<TableCell className="px-3 py-4 text-slate-600 truncate" title={tx.branch || '
|
| 468 |
<div className="flex items-center gap-2 min-w-0">
|
| 469 |
<span className={cn('h-2 w-2 rounded-full flex-shrink-0', getBranchColor(tx.branch || ''))} />
|
| 470 |
-
<span className="truncate">{tx.branch || '
|
| 471 |
</div>
|
| 472 |
</TableCell>
|
| 473 |
<TableCell className="px-3 py-4 text-center">
|
|
|
|
| 160 |
[t('table.amount')]: tx.amount,
|
| 161 |
'Currency': tx.currency || 'CAD',
|
| 162 |
[t('table.reference')]: tx.reference || '',
|
| 163 |
+
[t('table.branch')]: tx.branch || 'Montreal',
|
| 164 |
[t('table.accuracy')]: accuracy === -1 ? '' : `${accuracy}%`,
|
| 165 |
[t('table.status')]: tx.reviewed ? t('status.verified') : t('status.notVerified'),
|
| 166 |
'Email': tx.recipientEmail || '',
|
|
|
|
| 464 |
{tx.reference || '—'}
|
| 465 |
</span>
|
| 466 |
</TableCell>
|
| 467 |
+
<TableCell className="px-3 py-4 text-slate-600 truncate" title={tx.branch || 'Montreal'}>
|
| 468 |
<div className="flex items-center gap-2 min-w-0">
|
| 469 |
<span className={cn('h-2 w-2 rounded-full flex-shrink-0', getBranchColor(tx.branch || ''))} />
|
| 470 |
+
<span className="truncate">{tx.branch || 'Montreal'}</span>
|
| 471 |
</div>
|
| 472 |
</TableCell>
|
| 473 |
<TableCell className="px-3 py-4 text-center">
|
packages/web/src/components/reports/BranchChart.tsx
CHANGED
|
@@ -129,7 +129,7 @@ export default function BranchChart({ branches, isLoading }: BranchChartProps) {
|
|
| 129 |
color.hover
|
| 130 |
)}
|
| 131 |
>
|
| 132 |
-
{branch.branch ||
|
| 133 |
</span>
|
| 134 |
</div>
|
| 135 |
);
|
|
|
|
| 129 |
color.hover
|
| 130 |
)}
|
| 131 |
>
|
| 132 |
+
{branch.branch || 'Montreal'}
|
| 133 |
</span>
|
| 134 |
</div>
|
| 135 |
);
|
packages/web/src/components/reports/ExportSection.tsx
CHANGED
|
@@ -46,7 +46,7 @@ export default function ExportSection() {
|
|
| 46 |
[t('table.amount')]: tx.amount,
|
| 47 |
'Currency': tx.currency || 'CAD',
|
| 48 |
[t('table.reference')]: tx.reference || '',
|
| 49 |
-
[t('table.branch')]: tx.branch || '
|
| 50 |
[t('table.status')]: tx.reviewed ? t('status.verified') : t('status.notVerified'),
|
| 51 |
'Email': tx.recipientEmail || '',
|
| 52 |
'Message': tx.message || '',
|
|
|
|
| 46 |
[t('table.amount')]: tx.amount,
|
| 47 |
'Currency': tx.currency || 'CAD',
|
| 48 |
[t('table.reference')]: tx.reference || '',
|
| 49 |
+
[t('table.branch')]: tx.branch || 'Montreal',
|
| 50 |
[t('table.status')]: tx.reviewed ? t('status.verified') : t('status.notVerified'),
|
| 51 |
'Email': tx.recipientEmail || '',
|
| 52 |
'Message': tx.message || '',
|
packages/web/src/components/review/ValidationForm.tsx
CHANGED
|
@@ -330,7 +330,7 @@ export default function ValidationForm({ transaction }: ValidationFormProps) {
|
|
| 330 |
<SelectValue placeholder="Sélectionner une succursale..." />
|
| 331 |
</SelectTrigger>
|
| 332 |
<SelectContent>
|
| 333 |
-
<SelectItem value="
|
| 334 |
{branchNames.map((name) => (
|
| 335 |
<SelectItem key={name} value={name}>{name}</SelectItem>
|
| 336 |
))}
|
|
|
|
| 330 |
<SelectValue placeholder="Sélectionner une succursale..." />
|
| 331 |
</SelectTrigger>
|
| 332 |
<SelectContent>
|
| 333 |
+
<SelectItem value="Montreal">Montreal</SelectItem>
|
| 334 |
{branchNames.map((name) => (
|
| 335 |
<SelectItem key={name} value={name}>{name}</SelectItem>
|
| 336 |
))}
|