-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Bug Description
Two helper functions normalize_user_id and compute_tax are defined but never called anywhere in the codebase, leading to incorrect cart file handling and missing tax calculation at checkout.
To Reproduce
Steps to reproduce the behavior:
For normalize_user_id:
- Launch the app
- Type Student1 in the User ID field and add items to cart
- Switch user, type student1 and add items
- Notice two separate cart files are created: cart_Student1.json and cart_student1.json, instead of one
For compute_tax:
- Launch the app
- Add any items to cart
- Click Checkout
- Notice the total shown and saved to CSV has no tax applied
Expected behavior
normalize_user_id should be called when creating a CartManager so that Student1, STUDENT1, and student1 all map to the same cart file
compute_tax should be called in checkout() so that the final bill includes tax.
Additional context
Both functions have the comment # helper function for practice (UI does not depend on this) suggesting they were intentionally left unconditioned as a practice exercise, but in a real deployment both would cause data integrity issues.