mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 18:48:11 +00:00
implement update train details feature: add DTO, service method, and UI modal for editing train name and run numbers
This commit is contained in:
@@ -14,6 +14,7 @@ import { useNavigate } from "react-router-dom";
|
||||
|
||||
import type { Freight } from "@edr/types";
|
||||
|
||||
import { PayClearanceFeeButton } from "@/pages/bookings/payments/PayClearanceFeeButton";
|
||||
import { PayNowButton } from "@/pages/bookings/payments/PayNowButton";
|
||||
import { api } from "@/services/api";
|
||||
import { ContractClearanceAction } from "./ContractClearanceAction";
|
||||
@@ -69,6 +70,17 @@ export function ContractCustomerAction({
|
||||
);
|
||||
}
|
||||
|
||||
if (action.type === "pay-clearance") {
|
||||
return (
|
||||
<PayClearanceFeeButton
|
||||
sourceId={action.contractId}
|
||||
currency={contract.paymentCurrency}
|
||||
label={action.label}
|
||||
size={size}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (action.type === "initiate") {
|
||||
return (
|
||||
<InitiateBookingButton
|
||||
|
||||
@@ -80,6 +80,14 @@ export type ContractCustomerAction =
|
||||
label: string;
|
||||
primary: boolean;
|
||||
icon: LucideIcon;
|
||||
}
|
||||
| {
|
||||
/** Prepaid customs clearance service fee (contract-level, ONE_TIME Path B). */
|
||||
type: "pay-clearance";
|
||||
contractId: string;
|
||||
label: string;
|
||||
primary: boolean;
|
||||
icon: LucideIcon;
|
||||
};
|
||||
|
||||
function findPayableBookingForContract(
|
||||
@@ -137,6 +145,17 @@ export function deriveContractCustomerAction(
|
||||
};
|
||||
}
|
||||
|
||||
// Prepaid clearance service fee gate — must settle before document upload.
|
||||
if (contract.status === "AWAITING_CLEARANCE_PAYMENT") {
|
||||
return {
|
||||
type: "pay-clearance",
|
||||
contractId: id,
|
||||
label: "Pay clearance fee",
|
||||
primary: true,
|
||||
icon: CreditCard,
|
||||
};
|
||||
}
|
||||
|
||||
const payable = findPayableBookingForContract(id, bookings);
|
||||
if (payable) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user