-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
[Feature] Reserve multiple bags at once #567
base: dev
Are you sure you want to change the base?
Conversation
d12be9f
to
a589c92
Compare
Would it be possible to put the number before the bag name instead of after? When on my phone the number is truncated in Telegram. Also, I think it would be useful to put "1" if only one bag is reserved. |
@danwie thanks for your feedback. I've noticed this issue as well even before my changes. I think that the majority of reservations will still consist of 1 bag only, so I made no changes in this case not to make already long names even longer. I'm not sure if adding Also, I don't like putting the amount of bags in front of the store name. Unfortunately, Telegram view is not consistent across different devices for this matter. For example, on desktop it displays long button names as In the meantime, I think the best solution would be to cut the middle part from long button names as it's done in Telegram desktop. But then I'll have to make it consistent everywhere and update Another option might be to use I would like to get a second opinion on this change before actually implementing it. |
@danwie I added the shortening of long text on buttons with an ellipsis in the middle to a maximum of 50 characters. @Der-Henning I'm not sure if |
Updated reservations logic to allow reserving multiple bags at once, referring #510
Please note that this PR includes #564 as well because reservations are currently broken.
If you don't want to split reservations fix and reservation of multiple bags into separate PRs, you can merge only this PR and drop #564.
Docker images I used for testing are available at
gorus5/tgtg-scanner:latest-reserve-multiple-bags
andgorus5/tgtg-scanner:latest-alpine-reserve-multiple-bags
(multi-arch).I tried reserving multiple bags, creating and canceling orders with multiple bags in different real-life scenarios; everything worked fine.
Explanation of the feature:
Currently, each reservation consists of 1 bag only. So, if you want to reserve multiple bags from the same store it will create many separate reservations with 1 bag each. This means that it will reserve only 1 bag per scan and you'll have to wait until the next scan to reserve the next bag (they might be sold out until the next scan and you'll also need to cancel and buy each bag separately).
My change allows creating reservations with multiple bags at once:
To reserve several bags from the same store click several times on this item as before.
If a reservation/order consists of more than one bag it will be shown respectively e.g.
Starbucks (2 bags)
When bags become available, it will reserve as many bags as you have in your queue in one order.
If there are fewer available bags than you have in your queue it will reserve all available bags and the reservation will remain active with the remaining bags that haven't been reserved yet.
If the order fails (e.g. sold out), the reservation amount will remain the same.
Cancelling a reservation/order will delete the reservation/order with all the bags in it.
Examples:
Important!
Based on my testing, certain stores may have a maximum limit on bags per customer.
Please ensure that the desired quantity for reservation from this store is allowed first.
Otherwise, your reservation will keep failing with this log message (until canceled or reserved in smaller chunks):
Pull Request Checklist
make test
make lint
make images
make executable