feat(T06): Verkaufsmodul + Rechtsdokumente + DATEV-Export + Sales UI

This commit is contained in:
2026-07-17 01:58:34 +02:00
parent a38d340ddc
commit 6603e411e9
33 changed files with 3481 additions and 107 deletions
+31
View File
@@ -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`;
}