{"id":18860176,"url":"https://github.com/bilginnet/api-task","last_synced_at":"2026-02-08T19:30:18.502Z","repository":{"id":222408160,"uuid":"756897149","full_name":"bilginnet/api-task","owner":"bilginnet","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-14T02:06:50.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T20:17:50.482Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/bilginnet.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}},"created_at":"2024-02-13T14:21:56.000Z","updated_at":"2024-02-13T14:22:02.000Z","dependencies_parsed_at":"2024-02-14T03:21:38.932Z","dependency_job_id":"ffa5be55-d5f5-42ed-a982-95a1a154b14a","html_url":"https://github.com/bilginnet/api-task","commit_stats":null,"previous_names":["bilginnet/api-task"],"tags_count":0,"template":false,"template_full_name":"VERO-Digital-Solutions/api-tasks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilginnet%2Fapi-task","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilginnet%2Fapi-task/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilginnet%2Fapi-task/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilginnet%2Fapi-task/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bilginnet","download_url":"https://codeload.github.com/bilginnet/api-task/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239800487,"owners_count":19699127,"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-08T04:22:05.201Z","updated_at":"2026-02-08T19:30:18.437Z","avatar_url":"https://github.com/bilginnet.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hello dear API creator!\n\nThis repository is a playground for your submission.\n\nBefore getting started, please hit the `Use this template button` to create a new repository on which you commit and push your code regularly for your task. Once you are done, please mail us the link to your repository.\n\nIf you encounter a problem or have questions about the task, feel free to email us under christian.schaefers@vero.de\n\nGood luck and have fun ☘️\n\n## Prerequisites:\nThe already built up code frame in this repo is a very basic API with limited functionality. Your task is to pick it up and develop new features on top of it.\n\nYou can change existing code structure however you can't add any external frameworks and third party classes.\n\nThere is an SQLite database (`testDb.db`) which is created and filled on the fly.\n\nThere is a basic routing in `index.php` which supports `GET` and `POST` calls in particular:\n- `GET constructionStages`\n- `GET constructionStages/{id}`\n- `POST constructionStages`\n\nThe API serves data and accepts payload only in JSON format.\n\n## Task 1:\nAdd a new API call `PATCH constructionStages/{id}` which to allow the API users to edit an arbitrary field of a selected (by id) construction stage. The API should touch only the fields which are sent by the user. Add validation which to ensure that if `status` field is sent it is either `NEW`, `PLANNED` or `DELETED` and throw a proper error if it is not.\n\nAdd another `DELETE constructionStages/{id}` API call which changes the `status` of the selected resource to `DELETED`.\n\n## Task 2:\nWrite a validation system which checks every posted field against a set of rules as follows:\n- `name` is maximum of 255 characters in length\n- `start_date` is a valid date\u0026time in iso8601 format i.e. `2022-12-31T14:59:00Z`\n- `end_date` is either `null` or a valid datetime which is later than the `start_date`\n- `duration` is skipped because it should be automatically calculated based on `start_date`, `end_date` and `durationUnit`\n- `durationUnit` is one of `HOURS`, `DAYS`, `WEEKS` or can be skipped (which fallbacks to default value of `DAYS`)\n- `color` is either `null` or a valid HEX color i.e. `#FF0000`\n- `externalId` is `null` or any string up to 255 characters in length\n- `status` is one of `NEW`, `PLANNED` or `DELETED` and the default value is `NEW`.\n\nYou should throw proper errors if a rule is not met.\n\n## Task 3:\nSet a logic which automatically calculates `duration` based on `start_date`, `end_date` and `durationUnit` as you know that:\n- `start_date` is required and is a valid date\u0026time in iso8601 format i.e. `2022-12-31T14:59:00Z`\n- `end_date` is either `null` (then `duration` is also `null`) or a valid datetime which is later than the `start_date`\n- `durationUnit` is one of `HOURS`, `DAYS`, `WEEKS` where `DAYS` is the default fallback.\n- `duration` is a positive float value calculated in precision of whole hours (ignore minutes and seconds if any)\n- a week has 7 days and one day has 24 hours\n\n## Default task:\nAdd a nice phpDoc to every method you create!\n\n## Bonus task:\nAdd a system which generates a documentation out of your API!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilginnet%2Fapi-task","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbilginnet%2Fapi-task","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilginnet%2Fapi-task/lists"}