Feat: Cambios Varios 2

This commit is contained in:
2026-01-05 10:30:04 -03:00
parent 8bc1308bc5
commit 0fa77e4a98
184 changed files with 11098 additions and 6348 deletions

View File

@@ -1,3 +1,4 @@
// src/services/clientService.ts
import api from './api';
export const clientService = {
@@ -5,8 +6,11 @@ export const clientService = {
const res = await api.get('/clients');
return res.data;
},
getHistory: async (id: number) => {
const res = await api.get(`/clients/${id}/history`);
getSummary: async (id: number) => {
const res = await api.get(`/clients/${id}/summary`);
return res.data;
},
update: async (id: number, clientData: any) => {
await api.put(`/clients/${id}`, clientData);
}
};

View File

@@ -7,6 +7,10 @@ export interface DashboardData {
paperOccupation: number;
weeklyTrend: { day: string; amount: number }[];
channelMix: { name: string; value: number }[];
// Campos para vista de cajero o detalle
myRevenue?: number;
myAdsCount?: number;
myPendingAds?: number;
}
export const dashboardService = {

View File

@@ -1,12 +1,16 @@
// src/services/listingService.ts
import api from './api';
import type { ListingDetail } from '../types/Listing';
export const listingService = {
getPendingCount: async (): Promise<number> => {
const response = await api.get<number>('/listings/pending/count');
return response.data;
},
getById: async (id: number) => {
const res = await api.get(`/listings/${id}`);
getById: async (id: number): Promise<ListingDetail> => {
const res = await api.get<ListingDetail>(`/listings/${id}`);
return res.data;
},
updateStatus: async (id: number, status: string): Promise<void> => {
await api.put(`/listings/${id}/status`, JSON.stringify(status), {
headers: { 'Content-Type': 'application/json' }
});
}
};