AG Scroll Settings Budget Push und Rechnungsdokumente umsetzen
All checks were successful
CI / Build and Deploy (push) Successful in 2m20s
All checks were successful
CI / Build and Deploy (push) Successful in 2m20s
This commit is contained in:
@@ -2,12 +2,13 @@ import { redirect } from "next/navigation";
|
||||
|
||||
import { DashboardShell } from "@/components/dashboard/dashboard-shell";
|
||||
import { getCurrentAccountingPeriod } from "@/lib/accounting-periods";
|
||||
import { getAppSettings, toApprovalThresholdNumber } from "@/lib/app-settings";
|
||||
import { getAppSettings, serializeAppSettings } from "@/lib/app-settings";
|
||||
import { getRollbackMetadata } from "@/lib/audit-log";
|
||||
import type {
|
||||
DashboardAccountingPeriod,
|
||||
DashboardAuditLog,
|
||||
DashboardManagedUser,
|
||||
DashboardSettings,
|
||||
DashboardViewer,
|
||||
DashboardWorkingGroup
|
||||
} from "@/lib/dashboard-types";
|
||||
@@ -78,6 +79,19 @@ export default async function DashboardPage() {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
documents: {
|
||||
orderBy: {
|
||||
createdAt: "asc"
|
||||
},
|
||||
include: {
|
||||
uploadedBy: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,8 +199,20 @@ export default async function DashboardPage() {
|
||||
recurrenceStartAt,
|
||||
paidAt: expense.paidAt?.toISOString() ?? null,
|
||||
documentedAt: expense.documentedAt?.toISOString() ?? null,
|
||||
invoiceDate: expense.invoiceDate?.toISOString() ?? null,
|
||||
proofUrl: expense.proofUrl,
|
||||
documents: expense.documents.map((document) => ({
|
||||
id: document.id,
|
||||
invoiceDate: document.invoiceDate.toISOString(),
|
||||
proofUrl: document.proofUrl,
|
||||
storedFileName: document.storedFileName,
|
||||
originalFileName: document.originalFileName,
|
||||
mimeType: document.mimeType,
|
||||
size: document.size,
|
||||
createdAt: document.createdAt.toISOString(),
|
||||
uploadedBy: {
|
||||
id: document.uploadedBy.id,
|
||||
name: document.uploadedBy.username
|
||||
}
|
||||
})),
|
||||
createdAt: expense.createdAt.toISOString(),
|
||||
creator: {
|
||||
id: expense.creator.id,
|
||||
@@ -226,6 +252,8 @@ export default async function DashboardPage() {
|
||||
isCurrent: period.isCurrent
|
||||
}));
|
||||
|
||||
const serializedSettings: DashboardSettings = serializeAppSettings(appSettings);
|
||||
|
||||
const serializedAuditLogs: DashboardAuditLog[] = auditLogs.map((entry) => ({
|
||||
id: entry.id,
|
||||
action: entry.action,
|
||||
@@ -253,7 +281,7 @@ export default async function DashboardPage() {
|
||||
auditLogs={serializedAuditLogs}
|
||||
accountingPeriods={serializedPeriods}
|
||||
currentPeriodId={currentPeriod.id}
|
||||
approvalThreshold={toApprovalThresholdNumber(appSettings.approvalThreshold)}
|
||||
settings={serializedSettings}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user