Org Web Adapter

hungryroot/jira/be_7028_update_v2_order_skip_logic_to_match_v1.org

ID
7dde582e-3b95-4c9a-8883-237de9be7c61

BE-7028 Update V2 order skip logic to match V1

- source :: https://hungryroot.atlassian.net/browse/BE-7028

- tags :: Hungryroot API Project

- epic :: EP-411 Eng Parking Lot

- sprint :: HR BE Sprint 102

- status :: Status - Needs QA

Tasks

DONE Review whether this actually needs work

workprojectep411be7028unskiphungryrootapiv2
ID
fc38e14e-d4f1-499a-78e2-729bafe07740

Related to BE-6512 Update CX tool to use v2 unskip order endpoint

DONE Open pull request with any changes needed

workprojectep411be7028unskiphungryrootapiv2
ID
787e4d89-e09a-dbff-1555-fb25b7832042

Description

After moving the skip order logic in the CX tool to the V2 endpoint in

https://hungryroot.atlassian.net/browse/BE-6512, some discrepancies were

discovered between the V1 and V2 logic. Ellen Reed those differences are:

v2 does not validate whether order is past cutoff and therefore unskippable

calculate preferred date gets a schedule but schedule could be past cutoff;

preferred_date validation just checks if it's valid for the zipcode

I think our UI in both the CX tool and web/mobile hide the "unskip" button if

it's past cutoff, but people can likely still unskip if they're on a stale page.

The API should validate that the order is not past cutoff.

V1 logs a DatadogMetric for ORDER_UNSKIP. I don't know if we still use those, so

this might be fine

V2 hard codes is_cx_action = False. Unless you know they no longer use this

attribute, my understanding is that they use this in Braze to email the customer

about the status change but only if it originated from CX

Ref: https://github.com/hungryroot/hungryroot/pull/12983/changes#r2723012787

Acceptance Criteria

When an order status is changed to unskipped by a PATCH to the V2 order detail

endpoint an error should be returned if the order is past cutoff

(order.is_editable == False)

The V2 endpoint should accept a GET parameter is_cx_action boolean rather than

using a default False value. This is already passed to braze events in the view.