fix: Initial barebones UI and API running

This commit is contained in:
2025-05-08 22:41:14 +12:00
parent a2942f6d7d
commit 5046ac67f1
3 changed files with 443 additions and 168 deletions

View File

@@ -404,7 +404,7 @@
});
},
addAccount() {
axios.post('/api/add_account', this.newAccount)
axios.post('/api/accounts', this.newAccount)
.then(response => {
if (response.data.status === 'success') {
this.fetchAccounts();
@@ -419,7 +419,7 @@
});
},
addBankAccount() {
axios.post('/api/add_bank_account', this.newBankAccount)
axios.post('/api/bank_accounts', this.newBankAccount)
.then(response => {
if (response.data.status === 'success') {
this.fetchBankAccounts();
@@ -455,8 +455,7 @@
transactions.push(txn);
}
axios.post('/api/import_bank_transactions', {
bank_account_id: this.selectedBankAccount,
axios.post(`/api/bank_accounts/${this.selectedBankAccount}/transactions`, {
transactions: transactions
}).then(response => {
this.importResult = response.data;
@@ -471,7 +470,7 @@
},
fetchUnreconciledTransactions() {
if (this.selectedBankAccountForReconciliation) {
axios.get(`/api/get_unreconciled_transactions?bank_account_id=${this.selectedBankAccountForReconciliation}`)
axios.get(`/api/bank_accounts/${this.selectedBankAccountForReconciliation}/unreconciled`)
.then(response => {
this.unreconciledTransactions = response.data;
});
@@ -506,7 +505,7 @@
const journalEntryId = this.selectedJournalEntries[txnId];
if (!journalEntryId) return;
axios.post('/api/reconcile_transaction', {
axios.post('/api/reconciliation', {
transaction_id: txnId,
journal_entry_id: journalEntryId
}).then(response => {
@@ -519,13 +518,13 @@
});
},
fetchReconciliationReports() {
axios.get('/api/reconciliation_reports')
axios.get('/api/reconciliation/reports')
.then(response => {
this.reconciliationReports = response.data;
});
},
createReconciliationReport() {
axios.post('/api/create_reconciliation_report', this.newReport)
axios.post('/api/reconciliation/reports', this.newReport)
.then(response => {
if (response.data.status === 'success') {
this.loadReport(response.data.report_id);
@@ -534,7 +533,7 @@
});
},
loadReport(reportId) {
axios.get(`/api/get_reconciliation_report?report_id=${reportId}`)
axios.get(`/api/reconciliation/reports/${reportId}`)
.then(response => {
if (response.data.status === 'success') {
this.activeReport = response.data.report;
@@ -543,7 +542,7 @@
});
},
acceptMatch(match) {
axios.post('/api/reconcile_transaction', {
axios.post('/api/reconciliation', {
transaction_id: match.transaction_id,
journal_entry_id: match.journal_entry_id
}).then(response => {
@@ -553,21 +552,20 @@
});
},
rejectMatch(match) {
axios.delete(`/api/reconciliation_match/${match.id}`)
axios.delete(`/api/reconciliation/matches/${match.id}`)
.then(() => {
this.loadReport(this.activeReport.id);
});
},
finalizeReconciliation() {
axios.post('/api/finalize_reconciliation', {
report_id: this.activeReport.id
}).then(response => {
if (response.data.status === 'success') {
this.activeReport = null;
this.fetchReconciliationReports();
this.fetchUnreconciledTransactions();
}
});
axios.post(`/api/reconciliation/reports/${this.activeReport.id}/finalize`)
.then(response => {
if (response.data.status === 'success') {
this.activeReport = null;
this.fetchReconciliationReports();
this.fetchUnreconciledTransactions();
}
});
},
cancelReconciliation() {
this.activeReport = null;