mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
add reports module with controller, service, and repository
This commit is contained in:
@@ -32,6 +32,7 @@ import {
|
||||
YAxis,
|
||||
} from "recharts";
|
||||
import * as XLSX from "xlsx";
|
||||
import { ALL_TRADE_DIRECTIONS, TRADE_DIRECTION_LABELS } from "@edr/types";
|
||||
|
||||
import { KpiStrip, PageContainer, PageHeader } from "@/components/page";
|
||||
import { overviewChartColors } from "@/components/overview/overview.styles";
|
||||
@@ -351,7 +352,10 @@ export default function ReportPage() {
|
||||
label="Direction"
|
||||
size="xs"
|
||||
clearable
|
||||
data={["IMPORT", "EXPORT"]}
|
||||
data={ALL_TRADE_DIRECTIONS.map((d) => ({
|
||||
value: d,
|
||||
label: TRADE_DIRECTION_LABELS[d],
|
||||
}))}
|
||||
value={params.get("direction")}
|
||||
onChange={(v) => setParam("direction", v)}
|
||||
placeholder="All"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { BookingStatus } from "@edr/types";
|
||||
|
||||
export type ReportDomain = "Commercial" | "Operations" | "Finance" | "Data";
|
||||
|
||||
export type ReportColumnUnit = "ETB" | "t" | "%" | "min";
|
||||
@@ -37,29 +39,37 @@ export interface ReportConfig {
|
||||
columns: ReportColumn[];
|
||||
}
|
||||
|
||||
const BOOKING_STATUSES = [
|
||||
"SUBMITTED",
|
||||
"PENDING_APPROVAL",
|
||||
"APPROVED",
|
||||
"INVOICED",
|
||||
"PAID",
|
||||
"IN_TRANSIT",
|
||||
"ARRIVED",
|
||||
"COMPLETED",
|
||||
"CANCELLED",
|
||||
"REJECTED",
|
||||
];
|
||||
// Full enum from @edr/types; Set dedupes the deprecated AwaitingPayment alias.
|
||||
const BOOKING_STATUSES = [...new Set(Object.values(BookingStatus))];
|
||||
|
||||
// Full list mirroring CONTRACT_STATUSES in contract.entity.ts (no shared enum
|
||||
// in @edr/types yet).
|
||||
const CONTRACT_STATUSES = [
|
||||
"DRAFT",
|
||||
"SUBMITTED",
|
||||
"PRICE_CHANGED_PENDING_CONFIRM",
|
||||
"CHANGES_REQUESTED",
|
||||
"PENDING_APPROVAL",
|
||||
"APPROVED",
|
||||
"APPROVED_PENDING_SIGNATURE",
|
||||
"CONTRACT_READY",
|
||||
"SIGNED_CUSTOMER",
|
||||
"FULLY_EXECUTED",
|
||||
"CONTRACT_ACTIVE",
|
||||
"AWAITING_CLEARANCE_DOCUMENTS",
|
||||
"CLEARANCE_UNDER_REVIEW",
|
||||
"CLEARANCE_READY_FOR_BOOKING",
|
||||
"ACTIVE_SHIPMENT_IN_PROGRESS",
|
||||
"SUSPENDED",
|
||||
"CONTRACT_CLOSED",
|
||||
"EXPIRED",
|
||||
"REJECTED",
|
||||
"CANCELLED",
|
||||
"RENEWAL_DRAFT",
|
||||
"RENEWAL_SUBMITTED",
|
||||
"RENEWAL_PENDING_APPROVAL",
|
||||
"AMENDMENTS_PROPOSED",
|
||||
"ARCHIVED",
|
||||
];
|
||||
|
||||
const INVOICE_STATUSES = [
|
||||
|
||||
Reference in New Issue
Block a user