2026-01-12 16:37:41 +03:00

52 lines
995 B
TypeScript

import { request } from "./http";
export interface TimelineActivity {
id: number;
client_id: number;
actor_type: string;
actor_name: string;
event_type: string;
entity_type: string | null;
entity_id: number | null;
title: string;
description: string | null;
metadata: any;
created_at: string;
time_ago: string;
icon: string;
color: string;
}
export interface TimelineResponse {
data: TimelineActivity[];
meta: {
current_page: number;
last_page: number;
per_page: number;
total: number;
};
}
export const ClientTimelineService = {
/**
* Get timeline activities for a client
*/
async getTimeline(
clientId: number,
params?: {
page?: number;
per_page?: number;
}
): Promise<TimelineResponse> {
const response = await request<TimelineResponse>({
url: `/api/clients/${clientId}/timeline`,
method: "get",
params,
});
return response;
},
};
export default ClientTimelineService;