{"id":18986044,"url":"https://github.com/deanpdx/receipt-processor-api","last_synced_at":"2026-03-10T09:02:24.316Z","repository":{"id":246835241,"uuid":"823450097","full_name":"DeanPDX/receipt-processor-api","owner":"DeanPDX","description":"A contrived API that implements a contrived challenge","archived":false,"fork":false,"pushed_at":"2024-07-03T04:13:39.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T21:28:55.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/DeanPDX.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":"2024-07-03T04:13:06.000Z","updated_at":"2024-07-27T15:15:12.000Z","dependencies_parsed_at":"2024-07-06T14:15:44.404Z","dependency_job_id":null,"html_url":"https://github.com/DeanPDX/receipt-processor-api","commit_stats":null,"previous_names":["deanpdx/receipt-processor-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DeanPDX/receipt-processor-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Freceipt-processor-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Freceipt-processor-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Freceipt-processor-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Freceipt-processor-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeanPDX","download_url":"https://codeload.github.com/DeanPDX/receipt-processor-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Freceipt-processor-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30328272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: 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":[],"created_at":"2024-11-08T16:29:21.284Z","updated_at":"2026-03-10T09:02:24.005Z","avatar_url":"https://github.com/DeanPDX.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# receipt-processor-api\nThis is a contrived API and an implementation of [the receipt processor challenge](https://github.com/fetch-rewards/receipt-processor-challenge). See [this reddit thread](https://www.reddit.com/r/golang/comments/1dtvolz/feedback_after_being_rejected_for_my_take_home/) for more info.\n\n## Notes about this project / feedback\n- Due to time constraints, not a lot of validation is being done on data posted.\n- It's odd that numbers are being represented in incoming JSON as strings. I probably would have implemented a custom [Unmarshal](https://pkg.go.dev/encoding/json#Unmarshal) to normalize the data if I had more time to keep my downstream logic more pristine.\n- I found it odd that there was a total at the receipt level when it could be calculated by the items. Perhaps an attempt to get developers to make note of that?\n- I have been writing software professionally for almost 20 years and I have yet to see a requirement like \"If the trimmed length of the item description is a multiple of 3, multiply the price by `0.2` and round up to the nearest integer\". I understand the rationale, but, it would have been more fun if they had attempted to find real-world stuff like \"if the receipt originated in WA, apply a tax rate of X to the total\".\n- Some things were (probably intentionally) ambiguous. Like \"If the trimmed length of `some string`...\". Length in what sense? String length is complicated. From [the docs](https://go.dev/blog/strings): \"But what about the lower case grave-accented letter ‘A’, à? That’s a character, and it’s also a code point (U+00E0), but it has other representations. For example we can use the “combining” grave accent code point, U+0300, and attach it to the lower case letter a, U+0061, to create the same character à\".\n- I clearly decided to go the barebones route. A single file and very few dependencies. I think this is [inline with idiomatic code for small projects](https://go.dev/doc/modules/layout#basic-command).\n\n## Running the project\nMake sure you have [Go installed](https://go.dev/dl/). Then run the following commands:\n\n```bash\n# First, download dependencies\ngo mod tidy\n# Next, run the project.\ngo run main.go\n```\n\nTo test, you can use curl to post data:\n\n```bash\ncurl -d '{ \"retailer\": \"M\u0026M Corner Market\", \"purchaseDate\": \"2022-03-20\", \"purchaseTime\": \"14:33\", \"items\": [ { \"shortDescription\": \"Gatorade\", \"price\": \"2.25\" },{ \"shortDescription\": \"Gatorade\", \"price\": \"2.25\" },{ \"shortDescription\": \"Gatorade\", \"price\": \"2.25\" },{ \"shortDescription\": \"Gatorade\", \"price\": \"2.25\" } ], \"total\": \"9.00\" }' -H \"Content-Type: application/json\" -X POST http://localhost:8080/receipts/process\n```\n\nTake note of the returned ID. You can either just open `http://localhost:8080/receipts/{the ID you recorded}/points` in your browser, or use another curl command to check it:\n\n```bash\ncurl localhost:8080/receipts/{the ID you recorded}/points\n```\n\n## Testing the project\nRun `go test` to run unit tests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanpdx%2Freceipt-processor-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeanpdx%2Freceipt-processor-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanpdx%2Freceipt-processor-api/lists"}