feat: implement Freigabesystem for payment approval workflow
Adds a dedicated approval view for PM_Freigabe users to release documents for payment by setting Paperless custom field 15 to a predefined value. - Backend: VIEW_FREIGABE permission mapped to PM_Freigabe OIDC group - Backend: FreigabeErforderlich flag on DocumentType entity (auto-migrated) - Backend: FreigabeModule with endpoints to list documents, fetch field options dynamically from Paperless, and set the approval custom field - Frontend: /freigabe route with filter (default: nicht freigegeben), paginated table, and modal to select approval value - Frontend: Settings checkbox to mark document types as requiring approval - Frontend: Freigabe menu item visible only to PM_Freigabe/PM_Admin users Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import api from './client';
|
||||
|
||||
export interface FreigabeDocument {
|
||||
id: number;
|
||||
title: string;
|
||||
created: string;
|
||||
created_date: string;
|
||||
correspondent: number | null;
|
||||
document_type: number | null;
|
||||
archive_serial_number: number | null;
|
||||
tags: number[];
|
||||
custom_fields: { field: number; value: any }[];
|
||||
}
|
||||
|
||||
export interface FreigabeOption {
|
||||
id: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface FreigabeResult {
|
||||
count: number;
|
||||
results: FreigabeDocument[];
|
||||
}
|
||||
|
||||
export const freigabeApi = {
|
||||
getDocuments: (page = 1, pageSize = 25, nurNichtFreigegeben = true) =>
|
||||
api
|
||||
.get<FreigabeResult>('/api/freigabe/documents', {
|
||||
params: { page, pageSize, nurNichtFreigegeben },
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
setFreigabe: (docId: number, value: string | null) =>
|
||||
api
|
||||
.put<{ success: boolean }>(`/api/freigabe/documents/${docId}/freigabe`, { value })
|
||||
.then((r) => r.data),
|
||||
|
||||
getOptions: () =>
|
||||
api.get<FreigabeOption[]>('/api/freigabe/options').then((r) => r.data),
|
||||
};
|
||||
@@ -6,6 +6,7 @@ export interface SettingDocType {
|
||||
TitelTemplate: string;
|
||||
TagNotReady: number | null;
|
||||
TagReady: number | null;
|
||||
FreigabeErforderlich?: boolean | null;
|
||||
}
|
||||
|
||||
export interface SettingDocField {
|
||||
|
||||
Reference in New Issue
Block a user