Compare commits
No commits in common. "a505ce6ca7fece98842efeac03d76edbcf37dec1" and "f35a84084b723d4b24f87c90f9706f3999899d62" have entirely different histories.
a505ce6ca7
...
f35a84084b
|
|
@ -88,7 +88,7 @@ export const getClientInvitationStateFromOrderGroupStatus = (
|
|||
deliveryStatus: string | null | undefined,
|
||||
invitationState: string | null | undefined,
|
||||
): DeliveryInvitationPublicState => {
|
||||
if (deliveryStatus === "agreed" || deliveryStatus === "driver_assigned") {
|
||||
if (deliveryStatus === "agreed") {
|
||||
return "agreed";
|
||||
}
|
||||
|
||||
|
|
@ -96,10 +96,6 @@ export const getClientInvitationStateFromOrderGroupStatus = (
|
|||
return "delivered";
|
||||
}
|
||||
|
||||
if (deliveryStatus === "paid_storage") {
|
||||
return "paid_storage";
|
||||
}
|
||||
|
||||
if (["awaiting_choice", "opened", "reminder_sent"].includes(String(invitationState || ""))) {
|
||||
return invitationState as DeliveryInvitationPublicState;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,14 +20,6 @@ import {
|
|||
|
||||
const MAX_BODY_BYTES = 8 * 1024;
|
||||
|
||||
// Order groups a client may still self-book (choose delivery date+time) on.
|
||||
// manual_confirmation_required (ручная обработка) stays bookable until the
|
||||
// order leaves these states (date assigned / paid storage / finished).
|
||||
const CLIENT_BOOKABLE_STATUSES = new Set([
|
||||
"pending_confirmation",
|
||||
"manual_confirmation_required",
|
||||
]);
|
||||
|
||||
type ConfirmBody = {
|
||||
token?: string;
|
||||
deliveryDate?: string;
|
||||
|
|
@ -199,9 +191,7 @@ Deno.serve(async (request) => {
|
|||
? "agreed"
|
||||
: "requires_address";
|
||||
|
||||
const bookingBlocked = !CLIENT_BOOKABLE_STATUSES.has(currentGroup.delivery_status || "");
|
||||
|
||||
if (!isActiveInvitationState(invitation.state) || bookingBlocked) {
|
||||
if (!isActiveInvitationState(invitation.state) || currentGroup.delivery_status !== "pending_confirmation") {
|
||||
return jsonResponse(
|
||||
{
|
||||
ok: false,
|
||||
|
|
|
|||
Loading…
Reference in New Issue