Add daily expense tracking with sort/split and CSV export
Standalone expenses (date, description, category, amount) with the same equal/own/payer split machinery as entry costs, merged into the costs panel and settle-up as a single expense bucket. Self-fetching card with per-day grouping, client-side sorting, and quick-add. CSV export interleaves expenses with priced entries, one share column per member (UTF-8 BOM, RFC 4180, formula-injection guard on text cells). Also fixes trip deletion, which hit a foreign-key violation and rolled back for any trip with checklist items.
This commit is contained in:
@@ -94,6 +94,12 @@ export const api = {
|
||||
addSuggestions: (tripId, keys, personal) =>
|
||||
post(`/api/trips/${tripId}/checklist/suggestions`, personal === undefined ? { keys } : { keys, personal }),
|
||||
},
|
||||
expenses: {
|
||||
list: (tripId) => get(`/api/trips/${tripId}/expenses`),
|
||||
create: (tripId, payload) => post(`/api/trips/${tripId}/expenses`, payload),
|
||||
update: (expenseId, patchBody) => patch(`/api/expenses/${expenseId}`, patchBody),
|
||||
remove: (expenseId) => del(`/api/expenses/${expenseId}`),
|
||||
},
|
||||
};
|
||||
|
||||
export default api;
|
||||
|
||||
Reference in New Issue
Block a user