{"id":21558595,"url":"https://github.com/elie29/checkout-kata","last_synced_at":"2026-05-20T19:09:43.332Z","repository":{"id":92000083,"uuid":"194815903","full_name":"elie29/checkout-kata","owner":"elie29","description":"TDD practice of supermarket checkout that calculates the total price of a number of items","archived":false,"fork":false,"pushed_at":"2019-07-02T14:43:11.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T03:43:34.027Z","etag":null,"topics":["java","kata","spring"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elie29.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-02T07:54:17.000Z","updated_at":"2019-07-02T17:23:32.000Z","dependencies_parsed_at":"2023-03-17T05:30:23.404Z","dependency_job_id":null,"html_url":"https://github.com/elie29/checkout-kata","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elie29/checkout-kata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elie29%2Fcheckout-kata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elie29%2Fcheckout-kata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elie29%2Fcheckout-kata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elie29%2Fcheckout-kata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elie29","download_url":"https://codeload.github.com/elie29/checkout-kata/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elie29%2Fcheckout-kata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33271598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T15:12:43.734Z","status":"ssl_error","status_checked_at":"2026-05-20T15:12:42.300Z","response_time":356,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","kata","spring"],"created_at":"2024-11-24T08:15:18.085Z","updated_at":"2026-05-20T19:09:43.313Z","avatar_url":"https://github.com/elie29.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Best practices of OO and Object Calisthenics\n\n## SOLID\n  1. Single responsibility principle\n  2. Open/closed principle\n  3. Liskov substitution principle\n  4. Interface segregation principle\n  5. Dependency inversion principle\n\n## 9 OC Rules\n  1. Only One Level Of Indentation Per Method\n  2. Don't Use The ELSE Keyword\n  3. Wrap All Primitives And Strings\n  4. First-Class Collections\n  5. One Dot Per Line\n  6. Don't Abbreviate\n  7. Keep All Entities Small\n  8. No Classes With More Than Two Instance Variables\n  9. No Getters/Setters/Properties\n\n## TDD\n   1. Write the test\n   2. Make it compile\n   3. Watch it fail\n   4. Make it pass\n   5. Refactor\n      a. SOLID\n      b. 9 OC Rules\n   6. Replay test\n\n## Supermarket Pricing Problem\n\u003e The purpose is to implement the code for a supermarket checkout that calculates the total price of a number of items.\n\n### Acceptance Criteria\n  1. API accepts items in any order\n  2. API accepts the same item several time\n  3. API total method reflects the total amount of scanned items at any time.\n  4. Pricing changes frequently.\n  5. Special discount or others features could be requested later.\n\n#### Checkout Calculation Sample\n    Item  Price TTC  Special Price\n    ----  ----------  -------------\n    A     50          3 for 130\n    B     30          2 for 50\n    C     20\n    D     15\n\n#### API (KISS)\n    Checkout checkout = new Checkout();\n    checkout.scan('A')\n    checkout.scan('B');\n    checkout.total(); // would return 80\n    checkout.scan('D');\n    checkout.total() // would return 95\n\n## Run the tests\nmvn clean test\n\n## Run the program\nmvn clean install \u0026\u0026 java -jar target/checkout-1.0-SNAPSHOT.jar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felie29%2Fcheckout-kata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felie29%2Fcheckout-kata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felie29%2Fcheckout-kata/lists"}