{"id":19863757,"url":"https://github.com/danyst/swift-keepcoding-exam","last_synced_at":"2025-02-28T23:16:34.779Z","repository":{"id":179786304,"uuid":"664109633","full_name":"DanyST/swift-keepcoding-exam","owner":"DanyST","description":"Keepcoding FullStack Mobile Apps Bootcamp XVI Edition Swift Exam","archived":false,"fork":false,"pushed_at":"2023-07-09T04:46:26.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T15:25:01.720Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/DanyST.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":"2023-07-09T00:05:42.000Z","updated_at":"2023-07-09T03:30:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"520d9368-4729-42a1-974a-c8c2cac49678","html_url":"https://github.com/DanyST/swift-keepcoding-exam","commit_stats":null,"previous_names":["danyst/swift-keepcoding-exam"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanyST%2Fswift-keepcoding-exam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanyST%2Fswift-keepcoding-exam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanyST%2Fswift-keepcoding-exam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanyST%2Fswift-keepcoding-exam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanyST","download_url":"https://codeload.github.com/DanyST/swift-keepcoding-exam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241272626,"owners_count":19937091,"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-12T15:15:58.815Z","updated_at":"2025-02-28T23:16:34.773Z","avatar_url":"https://github.com/DanyST.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keepcoding FullStack Mobile Apps Bootcamp XVI Edition: Swift Exam\n\n## Description\nHotel Luchadores Reservation Management\n\n## Requirements\n\n* Model the structs: _Client_, _Reservation_, and _ReservationError_.\n\n    * Client: name, age, height (cm).\n    * Reservation: unique ID, hotel name, list of clients, duration \n    (days), price, breakfast option (true/false).\n    * ReservationError: An enum that implements Error with three possible \n    errors (cases): duplicate reservation ID found, reservation found for a \n    client, and reservation not found.\n\n\n* Manage the reservations with the class HotelReservationManager.\n    * Create a list to store reservations.\n    * Create a method to add a reservation. Add a reservation with the \n    following parameters: list of clients, duration, breakfast option. Assign \n    a unique ID (you can use a counter, for example), calculate the price, and \n    add the hotel name.\n    * Verify that the reservation is unique by ID and client before adding \n    it to the list. If it's not valid, throw or return the corresponding \n    ReservationError. There should not be another reservation with the same \n    ID, and no client should have a matching reservation.\n    * The price calculation is as follows: number of clients * base price \n    per client (e.g., 20 euros) * days in the hotel * 1.25 if they have \n    breakfast or 1 if they don't. Example: 3 (clients) * 20 euros (base price) \n    * 2 (days in hotel) * 1.25 (because they have breakfast) = 3 * 20 * 2 * \n    1.25 = 150.\n    * Add the reservation to the list of reservations.\n    * Return the reservation.\n* Create a method to cancel a reservation. Cancel the reservation given \nits ID and throw a ReservationError if it doesn't exist. To cancel a \nreservation, simply remove it from the list of reservations based on its \nID.\n* Create a method (or read-only property) to get a list of all current \nreservations.\n\n## Unit Tests\n\nTo test your own code, create the following functions and execute them in \nthe Playground:\n\n* _testAddReservation_: Verify errors when adding duplicate reservations \n(by ID or if another client is already in another reservation) and ensure \nthat new reservations are added correctly.\n* _testCancelReservation_: Verify that reservations are canceled correctly \n(removed from the list) and that canceling a non-existent reservation \nresults in an error.\n* _testReservationPrice_: Ensure that the system calculates prices \nconsistently. For example, if you make two reservations with the same \nparameters except for the names of the clients, they should give you the \nsame price.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanyst%2Fswift-keepcoding-exam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanyst%2Fswift-keepcoding-exam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanyst%2Fswift-keepcoding-exam/lists"}