{"id":28624211,"url":"https://github.com/zypeh/setel-practice","last_synced_at":"2025-09-01T08:44:45.531Z","repository":{"id":42679674,"uuid":"267870982","full_name":"zypeh/setel-practice","owner":"zypeh","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-06T17:09:06.000Z","size":433,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-18T21:02:58.594Z","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/zypeh.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}},"created_at":"2020-05-29T13:56:44.000Z","updated_at":"2024-04-18T21:02:58.595Z","dependencies_parsed_at":"2023-02-06T07:02:23.557Z","dependency_job_id":null,"html_url":"https://github.com/zypeh/setel-practice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zypeh/setel-practice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fsetel-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fsetel-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fsetel-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fsetel-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zypeh","download_url":"https://codeload.github.com/zypeh/setel-practice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zypeh%2Fsetel-practice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259418294,"owners_count":22854188,"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":"2025-06-12T07:11:32.897Z","updated_at":"2025-06-12T07:11:52.679Z","avatar_url":"https://github.com/zypeh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Setel Interview Challange\n\n\u003cdetails\u003eIs okay bro... they ghosted me after I submitted this repo anyway.\u003c/details\u003e\n\n### Notes\n* We are using embedded persistent memory instead of using ORM and database. So the content will be flushed away when the node instance get terminated.\n\n* After 10 seconds the confirmed order will be set to 'DELIVERED' state using Nodejs eventloop mechanism -- `setTimeout` will register the tasklet to eventloop and loop until it reached the time.\n\nBut in real world there are message queues and other solution to get this job right.\n\n* The payment app will randomly reject your order. (like 50/50 percent change you will get unsuccessful order create; if you can't create an order, don't worry)\n\n### API\n\n1. To create an order\n\n```POST http://localhost:3000/order\n{\n    \"id\": \"123\"\n}\n```\n\n2. To check order\n\n```GET http://localhost:3000/order/:order_id```\n\u003e where order_id is the id of the order\n\n\n3. To cancelled an order\n\n```PUT http://localhost:3000/order\n{\n    \"id\": \"123\"\n}\n```\n\u003e This operation will success if it is not set to 'DELIVERED' state\n\n### Run this thing\n\n```\ncd order-app\nyarn\nyarn start\n```\n\nIn another shell:\n```\ncd payment-app\nyarn\nyarn start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzypeh%2Fsetel-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzypeh%2Fsetel-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzypeh%2Fsetel-practice/lists"}