mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
Add ContractCourtBadge component and integrate into contract pages
- Introduced ContractCourtBadge to display the responsible party for contract actions. - Updated ContractStatusBadge to include new court badge. - Enhanced ClearanceDocumentsPage with additional filters for trade direction, freight type, and ownership. - Modified ContractRequestDetailPage and ContractRequestsPage to utilize ContractCourtBadge.
This commit is contained in:
@@ -270,6 +270,41 @@ export const CONTRACT_STATUS_META: Record<string, StatusMeta> = {
|
||||
},
|
||||
};
|
||||
|
||||
/** Statuses where the next action sits with the customer (portal side). */
|
||||
const WITH_CUSTOMER_STATUSES = new Set([
|
||||
"DRAFT",
|
||||
"PRICE_CHANGED_PENDING_CONFIRM",
|
||||
"CHANGES_REQUESTED",
|
||||
"CONTRACT_READY", // generated contract awaits the customer's signature
|
||||
"AWAITING_CLEARANCE_DOCUMENTS",
|
||||
"RENEWAL_DRAFT",
|
||||
]);
|
||||
|
||||
/** Statuses where the next action sits with EDR staff. */
|
||||
const WITH_EDR_STATUSES = new Set([
|
||||
"SUBMITTED",
|
||||
"PENDING_APPROVAL",
|
||||
"APPROVED",
|
||||
"APPROVED_PENDING_SIGNATURE",
|
||||
"SIGNED_CUSTOMER",
|
||||
"CLEARANCE_UNDER_REVIEW",
|
||||
"CLEARANCE_READY_FOR_BOOKING",
|
||||
"RENEWAL_SUBMITTED",
|
||||
"RENEWAL_PENDING_APPROVAL",
|
||||
]);
|
||||
|
||||
/**
|
||||
* Whose court the contract is in. Null for states with no pending party
|
||||
* (active, closed, rejected…).
|
||||
*/
|
||||
export function contractCourt(
|
||||
status: ContractStatus | string,
|
||||
): "customer" | "edr" | null {
|
||||
if (WITH_CUSTOMER_STATUSES.has(status)) return "customer";
|
||||
if (WITH_EDR_STATUSES.has(status)) return "edr";
|
||||
return null;
|
||||
}
|
||||
|
||||
export const CONTRACT_LIST_TABS = [
|
||||
{ key: "all", label: "All contracts", statuses: null as string[] | null },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user