From 7bbec7ad5fae7b138f5d8e12cae849d315e40173 Mon Sep 17 00:00:00 2001 From: mohamad Date: Thu, 8 May 2025 23:38:07 +0200 Subject: [PATCH] Add cost summary feature to ListDetailPage; implement API endpoints for costs and enhance UI with a dialog for displaying cost details, including user balances and total costs. --- fe/src/config/api-config.ts | 7 ++ fe/src/pages/ListDetailPage.vue | 142 +++++++++++++++++++++++++++++++- 2 files changed, 148 insertions(+), 1 deletion(-) diff --git a/fe/src/config/api-config.ts b/fe/src/config/api-config.ts index 3a13080..abe3347 100644 --- a/fe/src/config/api-config.ts +++ b/fe/src/config/api-config.ts @@ -86,6 +86,13 @@ export const API_ENDPOINTS = { HISTORY: '/ocr/history', }, + // Costs + COSTS: { + BASE: '/costs', + LIST_SUMMARY: (listId: string | number) => `/costs/lists/${listId}/cost-summary`, + GROUP_BALANCE_SUMMARY: (groupId: string | number) => `/costs/groups/${groupId}/balance-summary`, + }, + // Financials FINANCIALS: { EXPENSES: '/financials/expenses', diff --git a/fe/src/pages/ListDetailPage.vue b/fe/src/pages/ListDetailPage.vue index e41c2c9..b2142bd 100644 --- a/fe/src/pages/ListDetailPage.vue +++ b/fe/src/pages/ListDetailPage.vue @@ -19,6 +19,13 @@

{{ list.name }}

+ + + + + +
List Cost Summary
+
+ + + +

Loading cost summary...

+
+ + + + {{ costSummaryError }} + + + +
+
Total List Cost: {{ formatCurrency(listCostSummary.total_list_cost) }}
+
Equal Share Per User: {{ formatCurrency(listCostSummary.equal_share_per_user) }}
+
Participating Users: {{ listCostSummary.num_participating_users }}
+
+ + + + + + + +
+ + + + +
+
+
@@ -204,7 +271,7 @@