add contracts overview tab with KPIs, recent contracts, and charts

- Introduced OverviewContractKpisDto and OverviewRecentContractDto for contract metrics.
- Implemented OverviewContractsTabDto to structure the contracts tab response.
- Added contract-related constants for status groupings and pipeline stages.
- Created OverviewContractsTabPanel and OverviewRecentContractsTable components for UI representation.
- Updated OverviewService and OverviewRepository to fetch contract data.
- Integrated contracts tab into OverviewController and OverviewTabContent.
- Added hooks for fetching contracts data in useOverview.
- Updated types in the overview module to include contracts.
- Enhanced the contract detail page with a "View contract" button for generated PDFs.
This commit is contained in:
Marshal
2026-06-28 17:54:03 +00:00
parent 11c7f1bb74
commit a34e846d90
18 changed files with 688 additions and 11 deletions

View File

@@ -32,8 +32,17 @@ export interface IOverviewStaffKpis {
activeUsers: number;
}
export interface IOverviewContractKpis {
totalActive: number;
needsAction: number;
inApproval: number;
inClearance: number;
createdToday: number;
}
export interface IOverviewKpis {
bookings: IOverviewBookingKpis;
contracts: IOverviewContractKpis;
operations: IOverviewOperationsKpis;
customers: IOverviewCustomerKpis;
billing: IOverviewBillingKpis;
@@ -72,6 +81,18 @@ export interface IOverviewRecentBooking {
createdAt: string;
}
export interface IOverviewRecentContract {
id: string;
reference: string;
customerLabel: string;
status: string;
contractKind: string;
freightType: string;
paymentCurrency: string | null;
validUntil: string | null;
createdAt: string;
}
export interface IOverviewDashboard {
kpis: IOverviewKpis;
bookingTrend: IOverviewTrendPoint[];
@@ -110,6 +131,17 @@ export interface IOverviewBookingsTab {
generatedAt: string;
}
export interface IOverviewContractsTab {
kpis: IOverviewContractKpis;
contractTrend: IOverviewTrendPoint[];
contractsByStatus: IOverviewStatusCount[];
contractsByPipeline: IOverviewPipelineCount[];
contractsByKind: IOverviewLabelCount[];
contractsByFreightType: IOverviewLabelCount[];
recentContracts: IOverviewRecentContract[];
generatedAt: string;
}
export interface IOverviewBillingTab {
kpis: IOverviewBillingKpis;
paymentTrend: IOverviewPaymentTrendPoint[];
@@ -146,6 +178,7 @@ export interface IOverviewStaffTab {
export type OverviewTabKey =
| 'bookings'
| 'contracts'
| 'billing'
| 'operations'
| 'customers'