Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Citi OFN Vouchers] As a shopper I can use a voucher created with VINE #12859

Open
RachL opened this issue Sep 13, 2024 · 6 comments · May be fixed by #12949
Open

[Citi OFN Vouchers] As a shopper I can use a voucher created with VINE #12859

RachL opened this issue Sep 13, 2024 · 6 comments · May be fixed by #12949

Comments

@RachL
Copy link
Contributor

RachL commented Sep 13, 2024

⚠️ When working on this use the Clockify code: Citi Food Vouchers: #1A. #11922 Citi OFN Voucher - VINE Integration ⚠️

Description

- As a: a shopper
- On page: payment method step at checkout
- I want to be able to do:

A voucher issued through VINE should work the same as an OFN voucher for the shopper experience:

  • they can add the code at payment step
  • they can see the discount is applied during checkout process

For the hub: all reports handling vouchers are updated accordingly.

the system should first check the OFN vouchers database before the VINE one.

Acceptance Criteria & Tests

  1. Check both guest shoppers and shoppers with an account and a VINE voucher
  2. Check also guest shoppers and shopper with an account, but with an OFN voucher
  3. Check what happens when the voucher has expired
  4. For enterprise users, reports should be accurate

Estimations

For context this is the current voucher "life cycle" :
When a customer enter a voucher code :

  • Check voucher exist in OFN
  • Create order adjustment linked to voucher
  • update adjustment with the correct amount and tax portion if necessary and update order totals and states
  • after payment details are entered, update adjustment and order totals and states
  • voucher adjustment will be closed when the order is finalised, ie: this is when the voucher is considered "redeemed"

VINE voucher "life cycle" :

Assumption:

  • functionality to sign request with a JWT token already exist

Tasks:

  • Check if VINE voucher exists and create voucher in OFN, update voucher model to add voucher_id, voucher_set_id : 0.5 -1 days
  • VINE voucher redeeming and handle potential errors : 1.5 days (high estimate, our checkout logic is complicated)

Total : 2 -2.5 days , add 20% to cover unforeseen issue
Estimation total: 2.4 - 3 days

@github-project-automation github-project-automation bot moved this to All the things 💤 in OFN Delivery board Sep 13, 2024
@RachL RachL changed the title As a shopper I can use a voucher created with VINE [Citi OFN Vouchers] As a shopper I can use a voucher created with VINE Sep 13, 2024
@rioug
Copy link
Collaborator

rioug commented Oct 28, 2024

@RachL a few questions :

  • I am not sure we ended up on an answer regarding diplaying VINE voucher on the voucher admin page. I am hiding them from now as they are going to be managed in VINE
  • Do we need to tell the user if their VINE voucher is invalid ? currently I just return a generic error.

FYI I am going over the estimated time, I realised there are a few scenarios where we need to redeem the voucher other than the normal checkout which I missed in my estimation.
I'll tally up the number tomorrow for the delivery circle.

@RachL
Copy link
Contributor Author

RachL commented Oct 28, 2024

@rioug I'm still unsure how it will look like but I remember Kirsten saying the list of vouchers could end up being pretty long. If so, that would be a strong argument for not listing them on OFN. So let's keep them out for now, and if there is a need in the future we can display them.

Do we need to tell the user if their VINE voucher is invalid ? Currently I just return a generic error.

Do you mean on the checkout page? In this case I think a generic message is enough, the shopper does not need to know the type of voucher.

@rioug rioug linked a pull request Oct 29, 2024 that will close this issue
4 tasks
@rioug
Copy link
Collaborator

rioug commented Oct 29, 2024

Do we need to tell the user if their VINE voucher is invalid ? Currently I just return a generic error.

Do you mean on the checkout page? In this case I think a generic message is enough, the shopper does not need to know the type of voucher.

I meant when adding a voucher to the order, the VINE Api can return an "Invalid voucher" error, ie: it has established the voucher exist in VINE but it's invalid for some reason. I am wondering if we should tell the customer so they can potentially tell whoever gave them the voucher that there is an issue.

@rioug
Copy link
Collaborator

rioug commented Oct 29, 2024

I spent 49.59 hours on this
49.59 / 7.5 => 6.6 days
That's more than double the estimate, some of this time was spent setting User/Voucher in VINE, and there was a couple of scenarios that I missed in my estimate. On top of this, I always underestimate how long it takes to write the test notes for the PR.

@rioug
Copy link
Collaborator

rioug commented Nov 6, 2024

New requirement :

  • a voucher to be able to be redeemed by multiple merchants

@rioug
Copy link
Collaborator

rioug commented Nov 18, 2024

@RachL
Error shown to the customer :
On the checkout page when completing an order, when when redeeming a voucher fails we show an error if :

  • there was an error with the API (ie not available)
  • The redemption failed

Redeeming a voucher can fail for multiple reasons, from the VINE Api:https://github.com/openfoodfoundation/vine/blob/1ec4970b94c3550880e7c3067bf8baf9da62b290/app/Http/Controllers/Api/V1/ApiVoucherRedemptionsController.php#L64-L93
The errors will be written in our log files, so we can use that if we need to investigate issues.
That said, do we want to show more specific errors to the customer ? I don't think we would be sharing information that could lead to someone abusing the VINE Api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: In Progress ⚙
Development

Successfully merging a pull request may close this issue.

2 participants