Commit graph

12 commits

Author SHA1 Message Date
Juerd Waalboer
8c94410924 Move and extend statiegeld documentation 2023-01-20 18:42:04 +01:00
Juerd Waalboer
4603a1569f statiegeld: don't allow manual entry of hidden addons 2023-01-20 18:37:00 +01:00
Juerd Waalboer
e1aed5cbdf statiegeld: document deposit command 2023-01-19 03:35:14 +01:00
Juerd Waalboer
a2fd94241a statiegeld: better prompt hijacking 2023-01-19 03:05:36 +01:00
Juerd Waalboer
16d530ae16 Allow hook_prompt to mutate the prompt, like before, and use that
This functionality was accidentally broken by eed0db78

Also: ignore readline terminal sequence (\x01...\x02) in detection of ">"
2023-01-19 03:04:35 +01:00
Juerd Waalboer
5e91aaff3d statiegeld: support statiegeld-only products 2023-01-19 01:51:40 +01:00
Juerd Waalboer
5b0c85d770 Refactor read_products and its callers
- Promote to public function since it's used in other plugins anyway
- Move resolving of addons to read_products (print errors immediately)
- Cache product list based on mtime; mostly to reduce the amount of spam
  from errors as performance was never an issue.
- Cache product object in cart entry, so statiegeld_tokens plugin
  doesn't have to do the lookup all over again.
2023-01-17 20:28:35 +01:00
Juerd Waalboer
d44654e98a statiegeld_tokens: reuse code
Since that logic was factored into its own sub and is basically the same
as what was used here, let's use it here too.

This is still somewhat duplicated functionality from products::command.
Should adding addons be done in _read_products instead?
2023-01-16 04:53:50 +01:00
Juerd Waalboer
e17c092efe Allow statiegeld return via deposit command
May come in handy if there the bottle return revbank machine is dead.
2023-01-16 04:38:10 +01:00
Juerd Waalboer
ca03cb95d4 New plugin statiegeld_tokens
Activating statiegeld_tokens will limit the use of the statiegeld plugin
for container deposit refunds to what was bought at this venue.

Still needs documentation.

Changes to 'statiegeld' and 'undo' were made to support the new
plugin, specifically:

- metadata (attributes) added in $cart->add, for the statiegeld_tokens
  plugin to use.
- statiegeld plugin now shares a global variable (configuration).
- undo can now be rolled back during hook_checkout.
2023-01-16 03:08:42 +01:00
Juerd Waalboer
2836a5a671 Make GitHub do syntax highlighting 2023-01-09 03:43:39 +01:00
Juerd Waalboer
83c008dd61 Add 'statiegeld' plugin 2023-01-08 22:36:37 +01:00