import {
	RequestStatusEnum,
	type STATUS_CODE,
} from "@hooks/apis/useRequestStatus";

export function getOrderStatus(statusCode: STATUS_CODE) {
	const isPending =
		statusCode < RequestStatusEnum.EXTRACTED || statusCode === undefined;

	const inProgress = statusCode === RequestStatusEnum.EXTRACTED;

	const isCompleted =
		statusCode >= RequestStatusEnum.FULFILLED &&
		statusCode < RequestStatusEnum.EXPIRED;

	const isExpired = statusCode === RequestStatusEnum.EXPIRED;

	return { isPending, inProgress, isCompleted, isExpired };
}
