breatheco-de / breatheco-de

https://breatheco-de.vercel.app
1.17k stars 2.44k forks source link

With paid plan, can't join workshops/schedule mentorships if 0 consumables from Basic plan #7659

Closed KonnorThatcher closed 1 month ago

KonnorThatcher commented 3 months ago

Bug description

With a user created from a basic plan that I then upgraded to a paid plan, I am unable to join a workshop or schedule a mentorship if the amount of the workshop/mentorship consumable generated from the basic plan is set to 0, even if I have available consumables that were generated from the paid plan.

Screenshot 2024-07-31 174231

In the example above, I set the amount of this workshop consumable that was generated from the basic plan to 0, and the other workshop consumable from the paid plan to -1 (infinite). Even though I have an infinite amount of workshop tokens available thanks to the paid plan consumable, I get told that I've run out of workshops.

If instead I set the amount of the paid plan consumables for workshops/mentorships to 0 and the basic plan consumables to any number, this doesn't happen; it will still let me click the button to join the meeting or schedule a mentorship. This also doesn't seem to be an issue with paid plan consumables themselves, as this isn't an issue at all if I have a user that only has the paid plan.

Steps to reproduce

Expected behavior

I should still be able to click the button to join an event or schedule a mentoring session if I still have consumables available, even if I have none from the basic plan.

Anything else?

No response

tommygonzaleza commented 2 months ago
tommygonzaleza commented 2 months ago

I added a review in the PR

tommygonzaleza commented 2 months ago
tommygonzaleza commented 1 month ago

I added a code review

WinstonLesuT commented 1 month ago

Tests:

Note: tested with this User and this consumables for the workshops. The subscription doesn't include the type of event esGeekforce Gratis so an event with that type was created event with that type was created; during the free trial or as long as the user doesn't belong to a bootcamp we get this message "This is a private event; you don't have access to this event". Once the user belongs to a bootcamp, they give access to join. (Event is free for bootcamps)

tommygonzaleza commented 1 month ago

Screenshot 2024-09-24 at 10 48 38 AM

lumi-tip commented 1 month ago

This change was already included in: https://github.com/breatheco-de/app/pull/1607#pullrequestreview-2325554659