Improve the frontend and repository layer

This commit is contained in:
Urtzi Alfaro
2025-10-23 07:44:54 +02:00
parent 8d30172483
commit 07c33fa578
112 changed files with 14726 additions and 2733 deletions

View File

@@ -250,12 +250,38 @@ export class POSService {
async getPOSTransaction(params: {
tenant_id: string;
transaction_id: string;
}): Promise<{
transaction: POSTransaction;
}> {
}): Promise<POSTransaction> {
const { tenant_id, transaction_id } = params;
const url = `/tenants/${tenant_id}${this.basePath}/transactions/${transaction_id}`;
return apiClient.get(url);
}
/**
* Get POS transactions dashboard summary
*/
async getPOSTransactionsDashboard(params: {
tenant_id: string;
}): Promise<{
total_transactions_today: number;
total_transactions_this_week: number;
total_transactions_this_month: number;
revenue_today: number;
revenue_this_week: number;
revenue_this_month: number;
average_transaction_value: number;
status_breakdown: Record<string, number>;
payment_method_breakdown: Record<string, number>;
sync_status: {
synced: number;
pending: number;
failed: number;
last_sync_at?: string;
};
}> {
const { tenant_id } = params;
const url = `/tenants/${tenant_id}${this.basePath}/operations/transactions-dashboard`;
return apiClient.get(url);
}