Implement coffee machine program and tests (MIL-002) #17

Merged
Tirsvad merged 2 commits from mil-002-coffee-machine into mil-001-project-setup 2026-10-07 04:53:57 +02:00
Owner

Summary

  • Adds Menu/MenuItem, CoffeeMaker and MoneyMachine with the assignment's method names (get_items, find_drink, report, is_resource_sufficient, make_coffee, make_payment).
  • Adds the main loop (drink names, report, off): resources are checked before payment, and payment before the drink is made. python -m coffee_machine runs it.
  • Moves drink prices, ingredient amounts and all message text into constants.py.
  • Adds 25 pytest tests and the code review record RC-007 against QC-PY-001 (Go).

Verification

  • ruff format, ruff check, mypy --strict clean.
  • pytest: 25 passed.
  • doxygen Doxyfile: no warnings.
  • Manual run: a latte paid with $3.00 gives $0.50 change, and report shows the right resources and $2.50.

Notes for the reviewer

  • This PR is based on mil-001-project-setup (PR #16) because Phase 2 needs the Phase 1 skeleton. Retarget it to main once #16 is merged.
  • RC-007 is still Proposed for S01's sign-off. It has one action item: decide whether a DCD or use case is wanted.

Closes #6
Closes #7
Closes #8
Closes #9
Closes #10
Closes #11

## Summary - Adds `Menu`/`MenuItem`, `CoffeeMaker` and `MoneyMachine` with the assignment's method names (`get_items`, `find_drink`, `report`, `is_resource_sufficient`, `make_coffee`, `make_payment`). - Adds the main loop (drink names, `report`, `off`): resources are checked before payment, and payment before the drink is made. `python -m coffee_machine` runs it. - Moves drink prices, ingredient amounts and all message text into `constants.py`. - Adds 25 pytest tests and the code review record RC-007 against QC-PY-001 (Go). ## Verification - `ruff format`, `ruff check`, `mypy --strict` clean. - `pytest`: 25 passed. - `doxygen Doxyfile`: no warnings. - Manual run: a latte paid with $3.00 gives $0.50 change, and `report` shows the right resources and $2.50. ## Notes for the reviewer - This PR is based on `mil-001-project-setup` (PR #16) because Phase 2 needs the Phase 1 skeleton. Retarget it to `main` once #16 is merged. - RC-007 is still `Proposed` for S01's sign-off. It has one action item: decide whether a DCD or use case is wanted. Closes #6 Closes #7 Closes #8 Closes #9 Closes #10 Closes #11
Tirsvad added 2 commits 2026-10-07 04:53:27 +02:00
Add the Menu, MenuItem, CoffeeMaker and MoneyMachine classes with the
assignment's method names, and a main loop that supports drink names,
report and off. Resources are checked before payment, and payment
before the drink is made.

Move drink prices, ingredient amounts and all message text into
constants.py. Add 25 pytest tests for every class and the main loop,
and record the review against QC-PY-001 as RC-007.

Task: MIL-002#1
Task: MIL-002#2
Task: MIL-002#3
Task: MIL-002#4
Task: MIL-002#5
Task: MIL-002#6
Closes #6
Closes #7
Closes #8
Closes #9
Closes #10
Closes #11
Resolve pending commit link for RC-007
CI / test (push) Successful in 46s
CI / test (pull_request) Successful in 48s
0cdc814198
Link the Version History row of RC-007 to commit 2b6b3be and add the
link definition.

Refs #6
Refs #7
Refs #8
Refs #9
Refs #10
Refs #11
Tirsvad merged commit 1cd2a92e45 into mil-001-project-setup 2026-10-07 04:53:57 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Tirsvad-Udemy-100-days-of-code/016-oop-coffee-machine#17