Add treasury document photos, table list, and manage permission.

Income/expense lists are table-or-card with detail, edit, void, and delete; edit/delete require owner, admin, or the new finance manage permission.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-15 12:42:01 +03:30
co-authored by Cursor
parent 3696713443
commit 4409ded0ab
10 changed files with 1383 additions and 451 deletions
+22
View File
@@ -0,0 +1,22 @@
import { api } from '@/lib/api';
export type TreasuryPendingPhoto = {
localId: string;
name: string;
dataUrl: string;
file: File;
};
export async function uploadTreasuryDocumentPhotos(
documentId: string,
photos: TreasuryPendingPhoto[],
): Promise<number> {
let attached = 0;
for (const photo of photos) {
const body = new FormData();
body.append('file', photo.file);
await api.post(`/treasury/documents/${documentId}/attachments`, body);
attached += 1;
}
return attached;
}