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