{"id":19483531,"url":"https://github.com/librity/ignite_flightex","last_synced_at":"2026-06-12T04:31:07.753Z","repository":{"id":99703897,"uuid":"348243678","full_name":"librity/ignite_flightex","owner":"librity","description":"Rocket Seat - Ignite - Elixir - Challenge 5 - An airline manager w/ Structs and Agents. ","archived":false,"fork":false,"pushed_at":"2022-02-25T12:07:20.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T17:46:13.439Z","etag":null,"topics":["challenge","elixir","rocketseat-ignite"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/librity.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":"2021-03-16T06:52:55.000Z","updated_at":"2021-03-17T05:03:40.000Z","dependencies_parsed_at":"2023-07-31T13:00:49.257Z","dependency_job_id":null,"html_url":"https://github.com/librity/ignite_flightex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/librity/ignite_flightex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librity%2Fignite_flightex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librity%2Fignite_flightex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librity%2Fignite_flightex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librity%2Fignite_flightex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/librity","download_url":"https://codeload.github.com/librity/ignite_flightex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librity%2Fignite_flightex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34229624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"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":["challenge","elixir","rocketseat-ignite"],"created_at":"2024-11-10T20:15:26.780Z","updated_at":"2026-06-12T04:31:07.738Z","avatar_url":"https://github.com/librity.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flightex\n\n## Table of Contents\n\n- [About](#about)\n- [Bash Commands](#bash_commands)\n- [Elixir Commands](#elixir_commands)\n- [Libs](#libs)\n- [Docs](#docs)\n- [Resources](#resources)\n\n## About \u003ca name = \"about\"\u003e\u003c/a\u003e\n\nA demo Elixir program that uses `Structs` as `Data Transfer Objects`,\nand `Agents` to persist state between precesses.\n\nChallenge 5 of Ignite Elixir, a bootcamp by Rocket Seat.\n\n## Bash Commands \u003ca name = \"bash_commands\"\u003e\u003c/a\u003e\n\n```bash\n# Create new Elixir project\n$ mix new project_name\n# Intall dependencies\n$ mix deps.get\n# Generate linter config\n$ mix credo gen.config\n# Run linter\n$ mix credo --strict\n# Start your project as an Interactive Elixir session\n$ iex -S mix\n# Run tests\n$ mix test\n```\n\n## Elixir Commands \u003ca name = \"elixir_commands\"\u003e\u003c/a\u003e\n\nExpected behavior:\n\n```elixir\n\u003e Flightex.create_user(params)\n{:ok, user_id}\n\n\u003e Flightex.create_booking(user_id, params)\n{:ok, booking_id}\n\n\u003e Flightex.create_booking(invalid_user_id, params)\n{:error, \"User not found\"}\n\n\u003e Flightex.get_booking(booking_id)\n{:ok, %Booking{...}}\n\n\u003e Flightex.get_booking(invalid_booking_id)\n{:error, \"Flight Booking not found\"}\n```\n\nNaive Date Time (Date-time without timezone):\n\n```elixir\n\u003e NaiveDateTime.from_iso8601(\"2015-01-23 23:50:07\")\n{:ok, ~N[2015-01-23 23:50:07]}\n\u003e NaiveDateTime.from_iso8601!(\"2015-01-23 23:50:07\")\n~N[2015-01-23 23:50:07]\n\u003e dt = %DateTime{year: 2000, month: 2, day: 29, zone_abbr: \"CET\",\n\u003e                hour: 23, minute: 0, second: 7, microsecond: {0, 0},\n\u003e                utc_offset: 3600, std_offset: 0, time_zone: \"Europe/Warsaw\"}\n#DateTime\u003c2000-02-29 23:00:07+01:00 CET Europe/Warsaw\u003e\n\u003e NaiveDateTime.to_erl(dt)\n{{2000, 2, 29}, {23, 0, 7}}\n```\n\nUUID4 validation:\n\n```elixir\n\u003e {:ok, [{:uuid, valid_uuid} | _tails]} = UUID.uuid4() |\u003e UUID.info()\n{:ok,\n [\n   uuid: \"52224694-3cee-48f9-938c-ab99830c2881\",\n   binary: \u003c\u003c82, 34, 70, 148, 60, 238, 72, 249, 147, 140, 171, 153, 131, 12, 40,\n     129\u003e\u003e,\n   type: :default,\n   version: 4,\n   variant: :rfc4122\n ]}\n\u003e valid_uuid\n\"52224694-3cee-48f9-938c-ab99830c2881\"\n\u003e {:error, message} = \"SOFUNKY\" |\u003e UUID.info()\n{:error, \"Invalid argument; Not a valid UUID: sofunky\"}\n```\n\nUser Agent and Creator:\n\n```elixir\n\u003e Flightex.start_agents()\n\u003e user_params = Flightex.Factory.build(:user)\n\n\u003e {:ok, user_id} = Flightex.create_user(user_params)\n{:ok, \"9a68c5da-2f51-4e5e-a2b8-21b7dee48105\"}\n\n\u003e Flightex.update_user(user_id, user_params)\n{:ok, \"9a68c5da-2f51-4e5e-a2b8-21b7dee48105\"}\n\u003e Flightex.update_user(\"SOFUNKY\", user_params)\n{:error, \"User not found.\"}\n\n\u003e Flightex.get_user(user_id)\n{:ok,\n %Flightex.Users.User{\n   cpf: \"1234567\",\n   email: \"iggy@murderbusiness.org\",\n   id: \"9a68c5da-2f51-4e5e-a2b8-21b7dee48105\",\n   name: \"Iggy Azalea\"\n }}\n\u003e Flightex.get_user(\"SOFUNKY\")\n{:error, \"User not found.\"}\n\n\u003e Flightex.get_users\n%{\n  \"9a68c5da-2f51-4e5e-a2b8-21b7dee48105\" =\u003e %Flightex.Users.User{\n    cpf: \"1234567\",\n    email: \"iggy@murderbusiness.org\",\n    id: \"9a68c5da-2f51-4e5e-a2b8-21b7dee48105\",\n    name: \"Iggy Azalea\"\n  }\n}\n```\n\nBooking Agent and Creator:\n\n```elixir\n\u003e Flightex.start_agents()\n\u003e booking_params = Flightex.Factory.build(:booking_params)\n\u003e user_params = Flightex.Factory.build(:user_params)\n\u003e {:ok, user_id} = Flightex.create_user(user_params)\n{:ok, \"02cf4d12-38bc-46fe-9785-af179fd7053f\"}\n\n\u003e {:ok, booking_id} = Flightex.create_booking(user_id, booking_params)\n{:ok, \"5c16bda3-d637-4790-b073-7fc00d9b3fea\"}\n\n\u003e Flightex.update_booking(booking_id, user_id, booking_params)\n{:ok, \"5c16bda3-d637-4790-b073-7fc00d9b3fea\"}\n\u003e Flightex.update_booking(\"SOFUNKY\", user_id, booking_params)\n{:error, \"Booking not found.\"}\n\n\u003e Flightex.get_booking(booking_id)\n{:ok,\n %Flightex.Bookings.Booking{\n   departure: ~N[2014-03-04 23:59:59],\n   going_to: \"Tokyo\",\n   id: \"5c16bda3-d637-4790-b073-7fc00d9b3fea\",\n   leaving_from: \"LAX\",\n   user_id: \"02cf4d12-38bc-46fe-9785-af179fd7053f\"\n }}\n\u003e Flightex.get_booking(\"SOFUNKY\")\n{:error, \"Booking not found.\"}\n)\u003e Flightex.get_bookings\n%{\n  \"5c16bda3-d637-4790-b073-7fc00d9b3fea\" =\u003e %Flightex.Bookings.Booking{\n    departure: ~N[2014-03-04 23:59:59],\n    going_to: \"Tokyo\",\n    id: \"5c16bda3-d637-4790-b073-7fc00d9b3fea\",\n    leaving_from: \"LAX\",\n    user_id: \"02cf4d12-38bc-46fe-9785-af179fd7053f\"\n  }\n}\n```\n\n## Libs \u003ca name = \"libs\"\u003e\u003c/a\u003e\n\n- https://github.com/rrrene/credo\n- https://github.com/zyro/elixir-uuid\n- https://github.com/bitwalker/timex\n- https://github.com/thoughtbot/ex_machina\n\n## Docs \u003ca name = \"docs\"\u003e\u003c/a\u003e\n\n- https://elixir-lang.org/crash-course.html\n- https://hexdocs.pm/elixir/NaiveDateTime.html#from_iso8601/2\n- https://hexdocs.pm/elixir/Date.html#from_iso8601/2\n- https://hexdocs.pm/elixir/Time.html#t:t/0\n- https://hexdocs.pm/timex/getting-started.html\n- https://hexdocs.pm/ex_machina/readme.html\n\n## Resources \u003ca name = \"resources\"\u003e\u003c/a\u003e\n\n- https://marketplace.visualstudio.com/items?itemName=pantajoe.vscode-elixir-credo\n- https://stackoverflow.com/questions/51600416/elixir-add-timezone-data-to-naive-date-time\n- https://stackoverflow.com/questions/40444970/how-to-convert-a-string-into-an-ecto-datetime-in-elixir\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrity%2Fignite_flightex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibrity%2Fignite_flightex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrity%2Fignite_flightex/lists"}