{"id":50531539,"url":"https://github.com/stopsopa/checkout-kata","last_synced_at":"2026-06-03T14:01:53.947Z","repository":{"id":356306040,"uuid":"1230819875","full_name":"stopsopa/checkout-kata","owner":"stopsopa","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-07T12:58:07.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T14:39:38.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/stopsopa.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-06T10:57:34.000Z","updated_at":"2026-05-07T12:58:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stopsopa/checkout-kata","commit_stats":null,"previous_names":["stopsopa/checkout-kata"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/stopsopa/checkout-kata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Fcheckout-kata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Fcheckout-kata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Fcheckout-kata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Fcheckout-kata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stopsopa","download_url":"https://codeload.github.com/stopsopa/checkout-kata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Fcheckout-kata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33867802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-03T14:01:52.675Z","updated_at":"2026-06-03T14:01:53.941Z","avatar_url":"https://github.com/stopsopa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Original challenge\n\nhttps://github.com/brightsg/checkout-kata\n\n# Requirements\n\n- node version [.nvmrc](./.nvmrc)\n- docker or podman\n\nLink to code coverage: https://stopsopa.github.io/checkout-kata/coverage/\n\n# Description\n\nThere are two implementations of checkout process:\n\n- Ver1 - in memory implementation using in memory rules -\u003e [src/ver1/README.md](src/ver1/)\n\n- Ver2 - implementation using database rules [src/ver2/README.md](src/ver2/)\n\nfollow these readme files for details\n\n# Technical decisions\n\nEntire solution was designed to make it as simple as possible.\n\nSo in this project I use native node.js typesctripping to run \\*.ts files directly.\n\nTypescript compiler is used only for typechecking.\n\nAbove makes entire codebase very clear and easy to follow. (That is at least my hope).\n\nDatabase is ran using podman (it should work with docker but I don't have setup to check - but I believe it should work ;) ). Wrapper shell script should handle both. (edit: it seems to be working with docker in github actions)\n\nIntilially I thought that it will be good to create universal Checkout class implementation and separate Rules finder into swappable separate class. But then once all was build I've realised it would be more readable to absorbe entire logic into [src/interfaces/AbstractCheckout.ts](src/interfaces/AbstractCheckout.ts), it's just easier to follow.\n\nFrom now on any implementation can be created by extending that abstract class and on that level it can be decided what could be reused and what should be reimplemented.\n\nAnd this is the way two above implementations were created.\n\nTests drive both implementations pretty much through the same test cases against two differend implementations of AbstractCheckout.ts pulling rules from two different sources.\n\n# Setup\n\n```\n\nnpm install\nnpm run docker:up\n  # give it a while\n\n# then\nnpm run db:migrate\nnpm run db:fixtures\n\n# then run tests\nnpm run tests\n\n```\n\n# Dev commands\n\nsee `scripts` section in [package.json](package.json)\n\n```\n\nnpm run check\n  # typescript checks\n\nnpm run style:check\n  # check formatting\n\nnpm run style:fix\n  # fix formatting\n\nnpm run style:list\n  # list files with formatting issues\n\nnpm run coverage:server\n  # open coverage in default browser\n\nnpm run server\n  # start server - not really used\n\nnpm run db:generate\n  # generate db migration\n\nnpm run db:migrate\n  # run db migration\n\nnpm run db:fixtures\n  # load db fixtures\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstopsopa%2Fcheckout-kata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstopsopa%2Fcheckout-kata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstopsopa%2Fcheckout-kata/lists"}