From a35d2d85fcab1be2eb53e3c766269656d4959ef6 Mon Sep 17 00:00:00 2001 From: Diishhaa Date: Tue, 14 Jul 2026 23:30:20 +0530 Subject: [PATCH] =?UTF-8?q?Convert=20currency=20from=20USD=20($)=20to=20In?= =?UTF-8?q?dian=20Rupees=20(=E2=82=B9)=20across=20application=20and=20fix?= =?UTF-8?q?=20supabase=20offline=20startup=20crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.jsx | 6 ++-- src/ai/accountant.js | 2 +- src/ai/agentRunner.js | 28 +++++++-------- src/ai/treasury.js | 10 +++--- src/components/AgentChat.jsx | 58 +++++++++++++++--------------- src/components/Dashboard.jsx | 4 +-- src/components/Invoices.jsx | 6 ++-- src/components/MonthlyCardDeck.jsx | 6 ++-- src/components/Simulator.jsx | 32 ++++++++--------- src/utils/dbService.js | 42 +++++++++++----------- src/utils/supabaseClient.js | 7 ++-- 11 files changed, 100 insertions(+), 101 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 62b56cf..5683aa2 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -288,7 +288,7 @@ export default function App() {
- $ +
- The salary buffer capacity will be scaled to 6x this paycheck size (${(parseFloat(paycheckInput) * 6 || 0).toLocaleString()}). + The salary buffer capacity will be scaled to 6x this paycheck size (₹{(parseFloat(paycheckInput) * 6 || 0).toLocaleString('en-IN')}).
- $ + $${endIncome.toLocaleString()}...`); + await simulateThought(toolsRegistry, `Calculating progressive tax bracket for YTD income transition: ₹${startIncome.toLocaleString('en-IN')} -> ₹${endIncome.toLocaleString('en-IN')}...`); let newBracket = 0.10; if (endIncome > 250000) { @@ -346,7 +346,7 @@ export async function runAgentLoop({ }); } - await simulateThought(toolsRegistry, `OmniFlow Routed: tax=$${taxAlloc}, salary=$${salaryAlloc}, reserve=$${reserveAlloc}, yield=$${yieldAlloc}`); + await simulateThought(toolsRegistry, `OmniFlow Routed: tax=₹${taxAlloc}, salary=₹${salaryAlloc}, reserve=₹${reserveAlloc}, yield=₹${yieldAlloc}`); // Retroactive adjustment shoring if tax bracket shifted let retroactiveAdjustment = 0; @@ -370,7 +370,7 @@ export async function runAgentLoop({ description: `Recall for retroactive tax shoring` }); } - await simulateThought(toolsRegistry, `Progressive retroactive shoring completed. Transferred $${retroactiveAdjustment} to Tax Pool.`); + await simulateThought(toolsRegistry, `Progressive retroactive shoring completed. Transferred ₹${retroactiveAdjustment} to Tax Pool.`); } } @@ -410,7 +410,7 @@ export async function runAgentLoop({ actionTaken = recallAmount > 0; } - await simulateThought(toolsRegistry, `Calculated Runway: ${runwayMonths} months based on monthly burn of $${monthlyBurn}. (Salary buffer: $${salaryBuffer}, Yield Pool: $${yieldPool})`); + await simulateThought(toolsRegistry, `Calculated Runway: ${runwayMonths} months based on monthly burn of ₹${monthlyBurn}. (Salary buffer: ₹${salaryBuffer}, Yield Pool: ₹${yieldPool})`); await toolsRegistry.submitTreasuryEvaluation({ runwayMonths, @@ -451,7 +451,7 @@ export async function runAgentLoop({ amount: recallAmount, description: 'Yield recall for paycheck deficit shoring' }); - await simulateThought(toolsRegistry, `Deficit shored. Recalled $${recallAmount} from Ondo yield pool to liquid Salary Buffer.`); + await simulateThought(toolsRegistry, `Deficit shored. Recalled ₹${recallAmount} from Ondo yield pool to liquid Salary Buffer.`); } } } @@ -467,7 +467,7 @@ export async function runAgentLoop({ amount: targetPaycheck, description: 'Bi-weekly paycheck payout' }); - await simulateThought(toolsRegistry, `Paycheck of $${targetPaycheck} successfully dispatched.`); + await simulateThought(toolsRegistry, `Paycheck of ₹${targetPaycheck} successfully dispatched.`); } else { // Partial paycheck dispatch const partial = currentBuffer; @@ -481,7 +481,7 @@ export async function runAgentLoop({ description: 'Partial paycheck payout' }); } - await simulateThought(toolsRegistry, `CRITICAL: Insufficient funds in salary buffer! Dispatched partial paycheck of $${partial}.`); + await simulateThought(toolsRegistry, `CRITICAL: Insufficient funds in salary buffer! Dispatched partial paycheck of ₹${partial}.`); } const monthlyBurn = targetPaycheck * 2; @@ -497,10 +497,10 @@ export async function runAgentLoop({ } } else if (prompt.includes('manual') || prompt.includes('recall') || prompt.includes('Recall')) { // Manual recall yield - const amountMatch = prompt.match(/recall of \$?([0-9,]+(?:\.[0-9]{2})?)/i); + const amountMatch = prompt.match(/recall of [₹\$]?([0-9,]+(?:\.[0-9]{2})?)/i); const recallVal = amountMatch ? parseFloat(amountMatch[1].replace(/,/g, '')) : 0; - await simulateThought(toolsRegistry, `Executing manual recall of $${recallVal} from Ondo USDY yield pool...`); + await simulateThought(toolsRegistry, `Executing manual recall of ₹${recallVal} from Ondo USDY yield pool...`); if (toolsRegistry.getBalances && toolsRegistry.updateBalances && toolsRegistry.addTransaction && toolsRegistry.submitTreasuryEvaluation) { const balances = await toolsRegistry.getBalances(); @@ -517,7 +517,7 @@ export async function runAgentLoop({ amount: actualRecall, description: 'Manual Ondo Yield Recall' }); - await simulateThought(toolsRegistry, `Recalled $${actualRecall} to liquid checking buffer.`); + await simulateThought(toolsRegistry, `Recalled ₹${actualRecall} to liquid checking buffer.`); } await toolsRegistry.submitTreasuryEvaluation({ diff --git a/src/ai/treasury.js b/src/ai/treasury.js index 5e662d2..20293e4 100644 --- a/src/ai/treasury.js +++ b/src/ai/treasury.js @@ -81,12 +81,12 @@ Call the database tools to inspect profile/balances, update balances, and log re You MUST submit your findings by calling the tool "submitTreasuryEvaluation".`; const prompt = `Please evaluate the runway status and check for paycheck cycles: -Salary Buffer: $${salaryBuffer} -Yield Pool: $${yieldPool} -Reserve Floor: $${reserveFloor} -Target Paycheck: $${targetPaycheck} +Salary Buffer: ₹${salaryBuffer} +Yield Pool: ₹${yieldPool} +Reserve Floor: ₹${reserveFloor} +Target Paycheck: ₹${targetPaycheck} Proposed Runway: ${runwayMonths} months -Proposed Recall Amount: $${recallAmount} (Action Taken: ${actionTaken})`; +Proposed Recall Amount: ₹${recallAmount} (Action Taken: ${actionTaken})`; await runAgentLoop({ agentName: 'Treasury', diff --git a/src/components/AgentChat.jsx b/src/components/AgentChat.jsx index 63b5207..bbd3892 100644 --- a/src/components/AgentChat.jsx +++ b/src/components/AgentChat.jsx @@ -10,10 +10,10 @@ const AGENTS_METADATA = { colorBg: 'bg-blue-500/10 text-blue-600 border-blue-500/20', dotColor: 'bg-blue-500', capabilities: ['Expense Auditing', 'Tax Bracket Shoring', 'Write-Off Optimization'], - initialMsg: 'Hello! I am your Tax Accountant Agent. You can ask me to audit a receipt (e.g., "Audit receipt: AWS Hosting, Amount: $300") or evaluate your current progressive tax bracket status.', + initialMsg: 'Hello! I am your Tax Accountant Agent. You can ask me to audit a receipt (e.g., "Audit receipt: AWS Hosting, Amount: ₹300") or evaluate your current progressive tax bracket status.', suggestions: [ - { label: 'Audit Receipt: AWS ($300)', prompt: 'Audit receipt: AWS Hosting, Amount: $300' }, - { label: 'Audit Receipt: Staples ($45)', prompt: 'Audit receipt: Staples Paper, Amount: $45' }, + { label: 'Audit Receipt: AWS (₹300)', prompt: 'Audit receipt: AWS Hosting, Amount: ₹300' }, + { label: 'Audit Receipt: Staples (₹45)', prompt: 'Audit receipt: Staples Paper, Amount: ₹45' }, { label: 'Check Tax Bracket Status', prompt: 'Run a progressive tax evaluation and check my current bracket' } ] }, @@ -26,10 +26,10 @@ const AGENTS_METADATA = { colorBg: 'bg-emerald-500/10 text-emerald-600 border-emerald-500/20', dotColor: 'bg-emerald-500', capabilities: ['Runway Stress-Testing', 'Yield Optimization', 'Reserve Shore-Up'], - initialMsg: 'Hi there! I am your Treasury Agent. I monitor cash runway and Ondo yield. You can ask me to stress-test your runway or recall funds (e.g., "Recall $5,000 from Ondo yield pool").', + initialMsg: 'Hi there! I am your Treasury Agent. I monitor cash runway and Ondo yield. You can ask me to stress-test your runway or recall funds (e.g., "Recall ₹5,000 from Ondo yield pool").', suggestions: [ { label: 'Stress-Test Cash Runway', prompt: 'Stress-test my runway and cash buffers' }, - { label: 'Recall $5,000 from Yield Pool', prompt: 'Recall $5,000 from Ondo yield pool' }, + { label: 'Recall ₹5,000 from Yield Pool', prompt: 'Recall ₹5,000 from Ondo yield pool' }, { label: 'Get Treasury Status', prompt: 'Summarize my current liquid buffers and yield allocations' } ] }, @@ -84,14 +84,14 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT const lowerText = textToExecute.toLowerCase(); if (lowerText.includes('audit') || lowerText.includes('receipt') || lowerText.includes('upload')) { let amount = null; - const amtMatch = textToExecute.match(/\$?([0-9]+(?:\.[0-9]{2})?)/); + const amtMatch = textToExecute.match(/[₹\$]?([0-9]+(?:\.[0-9]{2})?)/); if (amtMatch) amount = parseFloat(amtMatch[1]); const receiptText = textToExecute.replace(/audit|receipt|upload/gi, '').trim(); const rec = await dbService.simulateReceiptUpload(receiptText || 'Generic business expense', amount); if (rec) { - finalResponse = `[Accountant Audit Result]\n\n• Amount: $${rec.amount.toFixed(2)}\n• Category: ${rec.category}\n• Write-off Eligible: ${rec.is_eligible_writeoff ? 'Yes (Released tax savings)' : 'No (Personal expense)'}\n• Analysis: ${rec.explanation}`; + finalResponse = `[Accountant Audit Result]\n\n• Amount: ₹${rec.amount.toFixed(2)}\n• Category: ${rec.category}\n• Write-off Eligible: ${rec.is_eligible_writeoff ? 'Yes (Released tax savings)' : 'No (Personal expense)'}\n• Analysis: ${rec.explanation}`; } else { finalResponse = 'Receipt audit processed. Check the transaction ledger for tax pool changes.'; } @@ -103,18 +103,18 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT const res = await dbService.simulateInvoicePaid(0); const updatedProfile = await dbService.getProfile(); - finalResponse = `I have run a progressive tax evaluation.\n\n• Current marginal tax bracket: ${(updatedProfile.taxBracket * 100).toFixed(0)}%\n• Year-To-Date Income: $${updatedProfile.ytdIncome.toLocaleString()}\n\nAll progressive tax reserves are fully shored up in the Tax Pool account.`; + finalResponse = `I have run a progressive tax evaluation.\n\n• Current marginal tax bracket: ${(updatedProfile.taxBracket * 100).toFixed(0)}%\n• Year-To-Date Income: ₹${updatedProfile.ytdIncome.toLocaleString('en-IN')}\n\nAll progressive tax reserves are fully shored up in the Tax Pool account.`; } } else if (selectedAgent === 'treasury') { const lowerText = textToExecute.toLowerCase(); if (lowerText.includes('recall') || lowerText.includes('withdraw') || lowerText.includes('transfer')) { let amount = 1000; - const amtMatch = textToExecute.match(/\$?([0-9,]+(?:\.[0-9]{2})?)/); + const amtMatch = textToExecute.match(/[₹\$]?([0-9,]+(?:\.[0-9]{2})?)/); if (amtMatch) amount = parseFloat(amtMatch[1].replace(/,/g, '')); await dbService.manualRecallYield(amount); - finalResponse = `Yield recall complete! Recalled $${amount.toLocaleString()} from Ondo USDY yield pool back to your liquid Salary Buffer.`; + finalResponse = `Yield recall complete! Recalled ₹${amount.toLocaleString('en-IN')} from Ondo USDY yield pool back to your liquid Salary Buffer.`; } else if (lowerText.includes('stress') || lowerText.includes('cancellation') || lowerText.includes('runway')) { await dbService.simulateClientCancellation(); @@ -124,7 +124,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT const totalAvailable = (balances.salary_buffer || 0) + (balances.yield_pool || 0) + (balances.reserve_floor || 0); const runway = monthlyBurn > 0 ? (totalAvailable / monthlyBurn).toFixed(1) : '99.0'; - finalResponse = `Treasury Runway Stress-Test complete:\n\n• Liquid Salary Buffer: $${balances.salary_buffer.toLocaleString()}\n• Reserve Floor Cushion: $${balances.reserve_floor.toLocaleString()}\n• Ondo USDY Yield Pool: $${balances.yield_pool.toLocaleString()}\n• Active Cash Runway: ${runway} months (burn rate of $${monthlyBurn.toLocaleString()}/mo).\n\nIf runway drops below paycheck requirements, I will automatically trigger yield recalls.`; + finalResponse = `Treasury Runway Stress-Test complete:\n\n• Liquid Salary Buffer: ₹${balances.salary_buffer.toLocaleString('en-IN')}\n• Reserve Floor Cushion: ₹${balances.reserve_floor.toLocaleString('en-IN')}\n• Ondo USDY Yield Pool: ₹${balances.yield_pool.toLocaleString('en-IN')}\n• Active Cash Runway: ${runway} months (burn rate of ₹${monthlyBurn.toLocaleString('en-IN')}/mo).\n\nIf runway drops below paycheck requirements, I will automatically trigger yield recalls.`; } else { const balances = await dbService.getBalances(); const profile = await dbService.getProfile(); @@ -132,7 +132,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT const totalAvailable = (balances.salary_buffer || 0) + (balances.yield_pool || 0) + (balances.reserve_floor || 0); const runway = monthlyBurn > 0 ? (totalAvailable / monthlyBurn).toFixed(1) : '99'; - finalResponse = `Current Treasury Status:\n\n• Liquid Buffer: $${balances.salary_buffer.toLocaleString()}\n• Yield Pool: $${balances.yield_pool.toLocaleString()}\n• Cash Runway: ${runway} months.\n\nAll funds exceeding the salary cap have been routed to yield pools.`; + finalResponse = `Current Treasury Status:\n\n• Liquid Buffer: ₹${balances.salary_buffer.toLocaleString('en-IN')}\n• Yield Pool: ₹${balances.yield_pool.toLocaleString('en-IN')}\n• Cash Runway: ${runway} months.\n\nAll funds exceeding the salary cap have been routed to yield pools.`; } } else if (selectedAgent === 'invoice_sentinel') { @@ -181,7 +181,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT // 1. Accountant Receipt Audit Result if (text.includes('[Accountant Audit Result]')) { - const amountMatch = text.match(/• Amount:\s*\$?([0-9,.]+)/); + const amountMatch = text.match(/• Amount:\s*[₹\$]?([0-9,.]+)/); const categoryMatch = text.match(/• Category:\s*(.+)/); const writeoffMatch = text.match(/• Write-off Eligible:\s*([^\n]+)/); const analysisMatch = text.split('• Analysis:'); @@ -205,7 +205,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT
Audited Amount -
${amount}
+
₹{amount}
@@ -247,7 +247,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT // 2. Tax Bracket Status Evaluation if (text.includes('progressive tax evaluation')) { const bracketMatch = text.match(/marginal tax bracket:\s*([0-9]+%)/); - const incomeMatch = text.match(/Year-To-Date Income:\s*\$?([0-9,.]+)/); + const incomeMatch = text.match(/Year-To-Date Income:\s*[₹\$]?([0-9,.]+)/); const bracket = bracketMatch ? bracketMatch[1] : '24%'; const income = incomeMatch ? incomeMatch[1] : '0'; @@ -258,7 +258,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT
YTD Self-Employment Income - ${income} + ₹{income}
Current Marginal Bracket @@ -280,11 +280,11 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT
- $0 - $11k - $44k - $95k - $182k+ + ₹0 + ₹11k + ₹44k + ₹95k + ₹182k+
@@ -299,11 +299,11 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT // 3. Treasury Runway Stress-Test complete or Current Status if (text.includes('Runway Stress-Test complete') || text.includes('Current Treasury Status')) { const isStress = text.includes('Runway Stress-Test complete'); - const bufferMatch = text.match(/(?:Liquid Buffer|Liquid Salary Buffer):\s*\$?([0-9,.]+)/); - const floorMatch = text.match(/Reserve Floor Cushion:\s*\$?([0-9,.]+)/); - const yieldMatch = text.match(/(?:Yield Pool|Ondo USDY Yield Pool):\s*\$?([0-9,.]+)/); + const bufferMatch = text.match(/(?:Liquid Buffer|Liquid Salary Buffer):\s*[₹\$]?([0-9,.]+)/); + const floorMatch = text.match(/Reserve Floor Cushion:\s*[₹\$]?([0-9,.]+)/); + const yieldMatch = text.match(/(?:Yield Pool|Ondo USDY Yield Pool):\s*[₹\$]?([0-9,.]+)/); const runwayMatch = text.match(/(?:Active Cash Runway|Cash Runway):\s*([0-9.]+)\s*months/); - const burnMatch = text.match(/burn rate of\s*\$?([0-9,.]+)/); + const burnMatch = text.match(/burn rate of\s*[₹\$]?([0-9,.]+)/); const buffer = bufferMatch ? bufferMatch[1] : '0'; const floor = floorMatch ? floorMatch[1] : null; @@ -348,7 +348,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT
Salary Buffer Checking - ${buffer} + ₹{buffer}
@@ -360,7 +360,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT
Checking Reserve Floor Cushion - ${floor} + ₹{floor}
@@ -372,7 +372,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT
Ondo USDY Yield Pool - ${yieldPool} + ₹{yieldPool}
@@ -383,7 +383,7 @@ export default function AgentChat({ dbService, onTriggerReload, logs, setActiveT {burn && (
Monthly Burn Rate - ${burn}/month + ₹{burn}/month
)}
diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx index d1e1773..165db16 100644 --- a/src/components/Dashboard.jsx +++ b/src/components/Dashboard.jsx @@ -52,7 +52,7 @@ export default function Dashboard({ profile, balances, transactions, invoices, r const totalInvoicesCount = invoices.length; const formatCurrency = (val) => - (val || 0).toLocaleString('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0 }); + (val || 0).toLocaleString('en-IN', { style: 'currency', currency: 'INR', minimumFractionDigits: 0, maximumFractionDigits: 0 }); const getTxTypeStyle = (type) => { switch (type) { @@ -85,7 +85,7 @@ export default function Dashboard({ profile, balances, transactions, invoices, r label: 'Revenue', value: formatCurrency(revenue), sub1: `Net ${formatCurrency(revenue)}`, - sub2: 'VAT $0', + sub2: 'GST ₹0', valueClass: 'text-[#111]', }, { diff --git a/src/components/Invoices.jsx b/src/components/Invoices.jsx index 6849432..27803ef 100644 --- a/src/components/Invoices.jsx +++ b/src/components/Invoices.jsx @@ -49,7 +49,7 @@ export default function Invoices({ invoices, drafts, dbService, onTriggerReload }); const formatCurrency = (val) => - (val || 0).toLocaleString('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0 }); + (val || 0).toLocaleString('en-IN', { style: 'currency', currency: 'INR', minimumFractionDigits: 0, maximumFractionDigits: 0 }); return (
@@ -85,9 +85,9 @@ export default function Invoices({ invoices, drafts, dbService, onTriggerReload
- +
- $ +
- Revenue ${card.revenue.toLocaleString('en-US')} + Revenue ₹{card.revenue.toLocaleString('en-IN')}
- Expenses ${card.expenses.toLocaleString('en-US')} + Expenses ₹{card.expenses.toLocaleString('en-IN')}
diff --git a/src/components/Simulator.jsx b/src/components/Simulator.jsx index 9d9843b..1005636 100644 --- a/src/components/Simulator.jsx +++ b/src/components/Simulator.jsx @@ -16,13 +16,13 @@ export default function Simulator({ dbService, onTriggerReload, invoices, drafts const handleInvoicePaid = async (amount) => { await dbService.simulateInvoicePaid(Number(amount)); - triggerFeedback(`Simulated invoice payment of $${amount} received!`); + triggerFeedback(`Simulated invoice payment of ₹${amount} received!`); onTriggerReload(); }; const handleMilestonePaid = async (amount) => { await dbService.simulateMilestonePaid(Number(amount)); - triggerFeedback(`Simulated milestone payout of $${amount} received!`); + triggerFeedback(`Simulated milestone payout of ₹${amount} received!`); onTriggerReload(); }; @@ -55,7 +55,7 @@ export default function Simulator({ dbService, onTriggerReload, invoices, drafts const handleRecallYield = async (amount) => { await dbService.manualRecallYield(Number(amount)); - triggerFeedback(`Recalled $${amount} from Ondo yield pool to liquid buffer!`); + triggerFeedback(`Recalled ₹${amount} from Ondo yield pool to liquid buffer!`); setRecallAmount(''); onTriggerReload(); }; @@ -106,13 +106,13 @@ export default function Simulator({ dbService, onTriggerReload, invoices, drafts onClick={() => handleInvoicePaid(10000)} className="flex-1 bg-cardLight hover:bg-cardLight/80 text-white text-xs font-semibold py-2 px-3 rounded border border-border/80 transition-colors" > - + $10,000 Invoice Paid + + ₹10,000 Invoice Paid
@@ -176,7 +176,7 @@ export default function Simulator({ dbService, onTriggerReload, invoices, drafts Due Date: {inv.due_date} ({inv.status})
- ${inv.amount.toLocaleString()} + ₹{inv.amount.toLocaleString('en-IN')}
@@ -255,7 +255,7 @@ export default function Simulator({ dbService, onTriggerReload, invoices, drafts
setCustomReceiptAmount(e.target.value)} className="flex-1 bg-background text-white text-xs px-3 py-2 rounded border border-border focus:outline-none focus:border-accent" @@ -345,7 +345,7 @@ export default function Simulator({ dbService, onTriggerReload, invoices, drafts
setRecallAmount(e.target.value)} className="flex-1 bg-background text-white text-xs px-3 py-2 rounded border border-border focus:outline-none focus:border-accent" diff --git a/src/utils/dbService.js b/src/utils/dbService.js index 93be6de..ab5fb70 100644 --- a/src/utils/dbService.js +++ b/src/utils/dbService.js @@ -54,27 +54,27 @@ const DEFAULT_TRANSACTIONS = [ ]; const DEFAULT_LOGS = [ - { agent: 'treasury', message: 'Treasury Agent initialized. Salary buffer floor set to $5,000, target paycheck set to $3,500.', created_at: '2026-04-01T00:01:00Z' }, - { agent: 'treasury', message: 'Detected incoming deposit of $8,000.00 from Acme Corp Invoice #101.', created_at: '2026-04-03T10:00:00Z' }, - { agent: 'accountant', message: 'Tax Accountant Agent computed 22% tax allocation ($1,760.00) from Acme Corp deposit.', created_at: '2026-04-03T10:01:00Z' }, - { agent: 'treasury', message: 'OmniFlow routing: Allocated $1,760.00 to Tax Pool, $6,240.00 to Salary Buffer.', created_at: '2026-04-03T10:02:00Z' }, - { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of $3,500.00 to personal spending account.', created_at: '2026-04-10T09:00:00Z' }, - { agent: 'accountant', message: 'Tax Accountant Agent audited receipt: $150.00 for Ergonomic office chair. Approved as eligible business write-off.', created_at: '2026-04-15T14:30:00Z' }, - { agent: 'accountant', message: 'Released $33.00 (22% of $150.00) from Tax Pool back to Salary Buffer.', created_at: '2026-04-15T14:35:00Z' }, - { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of $3,500.00 to personal spending account.', created_at: '2026-04-24T09:00:00Z' }, - { agent: 'treasury', message: 'Detected incoming deposit of $15,000.00 from Wayne Enterprises Invoice #102.', created_at: '2026-05-02T11:00:00Z' }, - { agent: 'accountant', message: 'Tax Accountant Agent computed 22% tax allocation ($3,300.00) from Wayne Enterprises deposit.', created_at: '2026-05-02T11:01:00Z' }, - { agent: 'treasury', message: 'OmniFlow routing: Allocated $3,300.00 to Tax Pool, $11,700.00 to Salary Buffer.', created_at: '2026-05-02T11:02:00Z' }, - { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of $3,500.00 to personal spending account.', created_at: '2026-05-08T09:00:00Z' }, - { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of $3,500.00 to personal spending account.', created_at: '2026-05-22T09:00:00Z' }, - { agent: 'treasury', message: 'Detected incoming deposit of $18,000.00 from Stark Industries Invoice #103.', created_at: '2026-05-25T15:00:00Z' }, - { agent: 'accountant', message: 'Tax Accountant Agent computed 22% tax allocation ($3,960.00) from Stark Industries deposit.', created_at: '2026-05-25T15:01:00Z' }, - { agent: 'treasury', message: 'OmniFlow routing: Allocated $3,960.00 to Tax Pool, $12,027.00 to Salary Buffer (filled to cap), and routed remaining $2,013.00 to Ondo USDY Yield Pool.', created_at: '2026-05-25T15:02:00Z' }, - { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of $3,500.00 to personal spending account.', created_at: '2026-06-05T09:00:00Z' }, - { agent: 'accountant', message: 'Tax Accountant Agent detected YTD income ($71,000.00) crossed threshold. Tax bracket increased from 22% to 24%. Calculated retroactive shortfall of $820.00.', created_at: '2026-06-12T10:29:00Z' }, - { agent: 'treasury', message: 'Detected incoming deposit of $30,000.00 from Stark Industries Milestone #2.', created_at: '2026-06-12T10:30:00Z' }, - { agent: 'treasury', message: 'OmniFlow routing: Allocated $8,020.00 to Tax Pool (24% of $30k + $820.00 adjustment), $3,500.00 to Salary Buffer (filled to cap), and routed remaining $18,480.00 to Ondo USDY Yield Pool.', created_at: '2026-06-12T10:32:00Z' }, - { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of $3,500.00 to personal spending account.', created_at: '2026-06-19T09:00:00Z' }, + { agent: 'treasury', message: 'Treasury Agent initialized. Salary buffer floor set to ₹5,000, target paycheck set to ₹3,500.', created_at: '2026-04-01T00:01:00Z' }, + { agent: 'treasury', message: 'Detected incoming deposit of ₹8,000.00 from Acme Corp Invoice #101.', created_at: '2026-04-03T10:00:00Z' }, + { agent: 'accountant', message: 'Tax Accountant Agent computed 22% tax allocation (₹1,760.00) from Acme Corp deposit.', created_at: '2026-04-03T10:01:00Z' }, + { agent: 'treasury', message: 'OmniFlow routing: Allocated ₹1,760.00 to Tax Pool, ₹6,240.00 to Salary Buffer.', created_at: '2026-04-03T10:02:00Z' }, + { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of ₹3,500.00 to personal spending account.', created_at: '2026-04-10T09:00:00Z' }, + { agent: 'accountant', message: 'Tax Accountant Agent audited receipt: ₹150.00 for Ergonomic office chair. Approved as eligible business write-off.', created_at: '2026-04-15T14:30:00Z' }, + { agent: 'accountant', message: 'Released ₹33.00 (22% of ₹150.00) from Tax Pool back to Salary Buffer.', created_at: '2026-04-15T14:35:00Z' }, + { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of ₹3,500.00 to personal spending account.', created_at: '2026-04-24T09:00:00Z' }, + { agent: 'treasury', message: 'Detected incoming deposit of ₹15,000.00 from Wayne Enterprises Invoice #102.', created_at: '2026-05-02T11:00:00Z' }, + { agent: 'accountant', message: 'Tax Accountant Agent computed 22% tax allocation (₹3,300.00) from Wayne Enterprises deposit.', created_at: '2026-05-02T11:01:00Z' }, + { agent: 'treasury', message: 'OmniFlow routing: Allocated ₹3,300.00 to Tax Pool, ₹11,700.00 to Salary Buffer.', created_at: '2026-05-02T11:02:00Z' }, + { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of ₹3,500.00 to personal spending account.', created_at: '2026-05-08T09:00:00Z' }, + { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of ₹3,500.00 to personal spending account.', created_at: '2026-05-22T09:00:00Z' }, + { agent: 'treasury', message: 'Detected incoming deposit of ₹18,000.00 from Stark Industries Invoice #103.', created_at: '2026-05-25T15:00:00Z' }, + { agent: 'accountant', message: 'Tax Accountant Agent computed 22% tax allocation (₹3,960.00) from Stark Industries deposit.', created_at: '2026-05-25T15:01:00Z' }, + { agent: 'treasury', message: 'OmniFlow routing: Allocated ₹3,960.00 to Tax Pool, ₹12,027.00 to Salary Buffer (filled to cap), and routed remaining ₹2,013.00 to Ondo USDY Yield Pool.', created_at: '2026-05-25T15:02:00Z' }, + { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of ₹3,500.00 to personal spending account.', created_at: '2026-06-05T09:00:00Z' }, + { agent: 'accountant', message: 'Tax Accountant Agent detected YTD income (₹71,000.00) crossed threshold. Tax bracket increased from 22% to 24%. Calculated retroactive shortfall of ₹820.00.', created_at: '2026-06-12T10:29:00Z' }, + { agent: 'treasury', message: 'Detected incoming deposit of ₹30,000.00 from Stark Industries Milestone #2.', created_at: '2026-06-12T10:30:00Z' }, + { agent: 'treasury', message: 'OmniFlow routing: Allocated ₹8,020.00 to Tax Pool (24% of ₹30k + ₹820.00 adjustment), ₹3,500.00 to Salary Buffer (filled to cap), and routed remaining ₹18,480.00 to Ondo USDY Yield Pool.', created_at: '2026-06-12T10:32:00Z' }, + { agent: 'treasury', message: 'Treasury Agent dispatched bi-weekly salary of ₹3,500.00 to personal spending account.', created_at: '2026-06-19T09:00:00Z' }, { agent: 'invoice_sentinel', message: 'Invoice Sentinel scanned LexCorp Invoice #i0000005. Overdue by 19 days. Drafted urgent follow-up reminder email.', created_at: '2026-06-20T18:00:00Z' } ]; diff --git a/src/utils/supabaseClient.js b/src/utils/supabaseClient.js index cbe49be..65c4c2a 100644 --- a/src/utils/supabaseClient.js +++ b/src/utils/supabaseClient.js @@ -10,7 +10,6 @@ if (!supabaseUrl || !supabaseAnonKey) { ); } -export const supabase = createClient( - supabaseUrl || '', - supabaseAnonKey || '' -); +export const supabase = (supabaseUrl && supabaseAnonKey) + ? createClient(supabaseUrl, supabaseAnonKey) + : null;