{"id":31841929,"url":"https://github.com/robertobatts/busy-flights-api","last_synced_at":"2025-10-12T05:55:30.992Z","repository":{"id":38381226,"uuid":"499147544","full_name":"robertobatts/busy-flights-api","owner":"robertobatts","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-05T18:24:43.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-06T21:22:11.928Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/robertobatts.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-06-02T13:31:26.000Z","updated_at":"2022-06-02T13:32:50.000Z","dependencies_parsed_at":"2022-08-25T05:51:51.965Z","dependency_job_id":null,"html_url":"https://github.com/robertobatts/busy-flights-api","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/robertobatts/busy-flights-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fbusy-flights-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fbusy-flights-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fbusy-flights-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fbusy-flights-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertobatts","download_url":"https://codeload.github.com/robertobatts/busy-flights-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertobatts%2Fbusy-flights-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010337,"owners_count":26084738,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":"2025-10-12T05:55:23.199Z","updated_at":"2025-10-12T05:55:30.985Z","avatar_url":"https://github.com/robertobatts.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://github.com/robertobatts/busy-flights-api/actions/workflows/maven.yml/badge.svg)\n# Busy Flights Api\n\n## Introduction\nThe purpose of this document is to describe the behaviour and the design of busy-flights-api.\nThe requirements are described in [requirements.md](./requirements.md).\n\n## Assumptions\nDuring the development, a few assumptions have been made that are not covered by the requirements:\n- All the request objects are supposed to be consumed as query parameters, not as request bodies by the apis\n- All the fields in `BusyFlightsRequest` are all required, except for `returnDate` which is optional\n- `ToughGetRequest.discount` is a percentage in the format 0 to 100 (0% to 100%)\n- CrazyAir and ToughJet responses are a list of `CrazyAirResponse` and `ToughJetResponse` since no other data structure is defined for it in the requirement. Even if it doesn't follow best practises, I left it like this because I cannot have control on the structure of external services\n- BusyFlights response is instead `BusyFlightsResponseList`, which is a wrapper of `BusyFlightsResponse` following best practises. This allows to add new parameters in the response in the future (such as paging), maintaining backward compatibility\n\n## Changes to initial codebase\n- I upgraded the java version from 8 to 11 to use the updated api of List and Files\n- All the domain objects have been modified with Lombok to reduce boilerplate code\n- I upgraded spring boot version to the latest stable release\n\n## Flow\nFor each request all the suppliers apis are fetched asynchronously following reactive programming paradigms.\nIf the request fails, SuppliersFacade applies a fallback strategy, it retrieves the value from a cache if present.\nAfter fetching all the suppliers, the responses are merged in a single object.\n\n![flowDiagram](./docs/flowDiagram.png)\n\n## How to integrate new suppliers\n### SupplierService\nCreate a class that extends `SupplierService`, which has the duty of converting BusyFlights objects to the supplier objects,\nand fetching the suppliers.\n\nThe constructor of this implementation should pass the name of the supplier to its superclass, therefore you need to add the new supplier to the enum `Supplier`\n\n### application.yml\nYou need to add the new supplier name and url in `application.yml`. This configuration will be injected in the bean `FindFlightsProperties`,\nand the url will be automatically matched by `SupplierService`.\n\nThe only key configurable per supplier is url at the moment, but if the new suppliers need new properties, e.g. apiKey, you can easily integrate it by modifying the application properties\n```yml\nfind-flights:\n  suppliers:\n    NEW_SUPPLIER: \n      url: \u003cset_url_here\u003e\n      apiKey: \u003cset_api_key_here\u003e\n```\nand then add the new apiKey field to the class `SupplierProperties`. Doing this will make the new properties automatically accessible by `SupplierService`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertobatts%2Fbusy-flights-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertobatts%2Fbusy-flights-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertobatts%2Fbusy-flights-api/lists"}