{"id":21004779,"url":"https://github.com/halfzebra/test-react","last_synced_at":"2025-06-20T06:07:38.632Z","repository":{"id":40366569,"uuid":"491559981","full_name":"halfzebra/test-react","owner":"halfzebra","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-12T15:08:02.000Z","size":233,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-20T06:07:20.726Z","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/halfzebra.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":"2022-05-12T15:00:44.000Z","updated_at":"2023-03-10T10:28:54.000Z","dependencies_parsed_at":"2022-08-09T18:23:35.144Z","dependency_job_id":null,"html_url":"https://github.com/halfzebra/test-react","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/halfzebra/test-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halfzebra%2Ftest-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halfzebra%2Ftest-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halfzebra%2Ftest-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halfzebra%2Ftest-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halfzebra","download_url":"https://codeload.github.com/halfzebra/test-react/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halfzebra%2Ftest-react/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260891175,"owners_count":23077913,"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-11-19T08:37:53.801Z","updated_at":"2025-06-20T06:07:33.618Z","avatar_url":"https://github.com/halfzebra.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Running\n\nInstall dependencies using `yarn install`. \n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\u003cbr\u003e\nOpen [http://localhost:3000](http://localhost:3000) to view it in the browser.\n\nThe page will reload if you make edits.\u003cbr\u003e\nYou will also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\u003cbr\u003e\nSee the section about [running tests](#running-tests) for more information.\n\n### The App\n\nThe app allows users to submit items they want to sell. They can either submit auction items or fixed price buy it now items. \nSubmitting items comes with a fee. The fee is calculated according to a set of rules detailed bellow. \n\n### Assignment \n\nThe code in this small app is on purpose quite horrible. Your task is to improve it. You should not spend more than 2-4 hours. Choose 2 areas of improvement and change the code accordingly.\n\n- The calculator code is not very maintainable and has very poor test coverage. Try improving this code. \n- The react App component is a bit messy in many ways. Any ideas for how to refactor and break this apart? \n- Add validation and error handling in the Register new item form so you cannot press submit when form values are not valid or incomplete. \n- Show added items in a card design with information styled nicely. \n\nDuring the technical interview we can talk through your changes and also discuss other changes you would like to do. \n\nWhen you want to submit your changes, remove the node_modules folder, zip the folder and attach it in an email. We kindly ask you not to publish your solution.\n\n## Details on the fee calculator \n\nCalculate the fee for publishing an ad. Refactor the code to something that you're satisfied with - code that you would want to maintain.\n\n### Conditions\n\nIn this example there are two types of ads:\n\n* Auction (bids are placed until an ad ends)\n* Buy it now (an ad is bought directly and thereby ending)\n\nThere's two types of users:\n\n* Company users\n* Non-company users (normal)\n\n#### Calculation rules\n\nThe formula to calculate the sum of fees is:\n\n* Price of the ad + type of ad cost - discount\n\nCosts:\n\n| Ad type       | Cost |\n| ------------- |:----:|\n| Auction       | 25   |\n| Buy It Now    | 35   |\n\nDiscounts:\n\n* If an ad ends today there's a discount of 10.\n* Company users get a discount of 5 when they publish an ad.\n\n## New desired feature:\n\nIn the code example, the end date discount are only implemented for auctions, but we would like it to also work for Buy It Now ads. You only need to do this if you choose to improve the calculator code.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalfzebra%2Ftest-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalfzebra%2Ftest-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalfzebra%2Ftest-react/lists"}