feat(T06): Verkaufsmodul + Rechtsdokumente + DATEV-Export + Sales UI
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { apiFetch, type PaginatedResponse } from './api';
|
||||
|
||||
export interface DATEVExportResponse {
|
||||
id: string;
|
||||
start_date: string;
|
||||
end_date: string;
|
||||
file_path?: string | null;
|
||||
total_amount: number;
|
||||
created_at?: string;
|
||||
}
|
||||
|
||||
export interface DATEVExportCreate {
|
||||
start_date: string;
|
||||
end_date: string;
|
||||
}
|
||||
|
||||
export async function createDatevExport(data: DATEVExportCreate): Promise<DATEVExportResponse> {
|
||||
return apiFetch<DATEVExportResponse>('/datev/export', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
}
|
||||
|
||||
export async function listDatevExports(page = 1, pageSize = 20): Promise<PaginatedResponse<DATEVExportResponse>> {
|
||||
return apiFetch<PaginatedResponse<DATEVExportResponse>>(`/datev/exports?page=${page}&page_size=${pageSize}`);
|
||||
}
|
||||
|
||||
export function getDatevDownloadUrl(id: string): string {
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000/api/v1';
|
||||
return `${baseUrl}/datev/exports/${id}/download`;
|
||||
}
|
||||
Reference in New Issue
Block a user