{"id":15622755,"url":"https://github.com/nbaztec/exercise-cart-checkout","last_synced_at":"2025-03-29T16:27:54.617Z","repository":{"id":145695381,"uuid":"91810402","full_name":"nbaztec/exercise-cart-checkout","owner":"nbaztec","description":"Simple coding execise","archived":false,"fork":false,"pushed_at":"2017-05-19T14:02:12.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-04T17:28:20.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/nbaztec.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":"2017-05-19T13:46:05.000Z","updated_at":"2017-05-19T14:02:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5420b15-1b5a-4871-8c1a-b4131288bd28","html_url":"https://github.com/nbaztec/exercise-cart-checkout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbaztec%2Fexercise-cart-checkout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbaztec%2Fexercise-cart-checkout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbaztec%2Fexercise-cart-checkout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbaztec%2Fexercise-cart-checkout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbaztec","download_url":"https://codeload.github.com/nbaztec/exercise-cart-checkout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246210789,"owners_count":20741230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-03T09:55:07.839Z","updated_at":"2025-03-29T16:27:54.575Z","avatar_url":"https://github.com/nbaztec.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Exercise - Cart Checkout Calculator\nCalculates the total price based on the cart and multiple offers applied to each item.\n\n### Example\nIf the inventory consists of 2 items:\n\n* Beer, EUR 5 (Offers: 2 for EUR 6, 6 for EUR 20)\n* Water, EUR 2 (Offers: 5 for EUR 8)\n\nAnd the cart looks like:\n\n* Beer x 10\n* Water x 6\n\nThen the total should be:\n\n* Beer: 6 for EUR 20 +  4 for EUR 12 (EUR 6 per 2 units)\n* Water: 5 for EUR 8 + 1 for EUR 2\n\nSo the total comes out to be: **EUR 42**\n### Install\n```\nnpm install\n```\n\n### Start\nUpdate the item, offers \u0026 inventory mocks within the `mocks/` directory. Then run `index.js`.\n```\nnpm start\n```\n\n### Test\n```\nnpm test\n```\n\n### Coverage\n```\nnpm run test-coverage\n```\nTip: 100% test coverage","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbaztec%2Fexercise-cart-checkout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbaztec%2Fexercise-cart-checkout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbaztec%2Fexercise-cart-checkout/lists"}