mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 02:58:11 +00:00
fix: type errors
This commit is contained in:
@@ -55,7 +55,11 @@ export interface BookingActionDef {
|
||||
|
||||
export type BookingActionContext = Pick<
|
||||
BookingDetail,
|
||||
"status" | "paymentCurrency" | "approvalSteps" | "reference" | "schedulingStatus"
|
||||
| "status"
|
||||
| "paymentCurrency"
|
||||
| "approvalSteps"
|
||||
| "reference"
|
||||
| "schedulingStatus"
|
||||
>;
|
||||
|
||||
const ALLOCATABLE_SCHEDULING_STATUSES = new Set([
|
||||
@@ -67,7 +71,9 @@ const ALLOCATABLE_SCHEDULING_STATUSES = new Set([
|
||||
"",
|
||||
]);
|
||||
|
||||
export function canAllocateBooking(booking: Pick<BookingDetail, "status" | "schedulingStatus">) {
|
||||
export function canAllocateBooking(
|
||||
booking: Pick<BookingDetail, "status" | "schedulingStatus">,
|
||||
) {
|
||||
return (
|
||||
booking.status === "PAID" &&
|
||||
ALLOCATABLE_SCHEDULING_STATUSES.has(booking.schedulingStatus ?? undefined)
|
||||
@@ -286,10 +292,18 @@ export function getBookingActions(
|
||||
actions = [SIGN_CONTRACT_STAFF_ACTION, VIEW_CONTRACT_ACTION];
|
||||
break;
|
||||
case "FULLY_EXECUTED":
|
||||
actions = [{ ...VIEW_CONTRACT_ACTION, label: "View executed contract", primary: true }];
|
||||
actions = [
|
||||
{
|
||||
...VIEW_CONTRACT_ACTION,
|
||||
label: "View executed contract",
|
||||
primary: true,
|
||||
},
|
||||
];
|
||||
break;
|
||||
case "PAID":
|
||||
if (canAllocateBooking({ status, schedulingStatus: ctx.schedulingStatus })) {
|
||||
if (
|
||||
canAllocateBooking({ status, schedulingStatus: ctx.schedulingStatus })
|
||||
) {
|
||||
actions = [
|
||||
{
|
||||
id: "allocateBooking",
|
||||
@@ -384,7 +398,7 @@ export function listRowHasActions(
|
||||
paymentCurrency: row.paymentCurrency,
|
||||
reference: "",
|
||||
approvalSteps: row.approvalSteps ?? undefined,
|
||||
schedulingStatus: row.schedulingStatus,
|
||||
schedulingStatus: row.status,
|
||||
},
|
||||
user,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user