-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/Preserve data #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STATUS: MILESTONE APPROVED 🥇
Hi @NitBravoA92 and @ahmedeid6842 ,
Great job !!!
To Highlight! 👏 🟢
✔️ Collaborative work 👍 Commits from both team members
✔️ Data is saved into JSON files
✔️ All methods to save data have been added
✔️ App works as expected
Your project is complete! There is nothing else to say other than... it's time to merge it
Congratulations! 🎉
Optional suggestions
Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.
You can also consider:
- N/A
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
🚩Milestone 6: preserve data | read/write - >>branch<< -
Hi there! @NitBravoA92 and @ahmedeid6842 here. 👋
This is the PR for the preserve data activity. The main objective of this Milestone is to learn how to preserve the data from the application and load preserved data on startup.
Here is a summary of what has been done:
Modify the
Book
class to add a new instance variable calledid
and the methodto_json
to convert the Book data into a hash.Modify the
Rental
class to add a new instance variable calledid
.Modify the
Person
,Student
, andTeacher
classes to receive an incrementalid
Modify the
Student
andTeacher
classes to add theto_json
method that converts the data into a hash.Create the
DataRepository
module that contains the following methods:-find_all_books: Read all the books' data from the
books.json
file-find_all_people: Read all the people's data from the
people.json
file-find_all_rentals: Read all the rentals' data from the
rentals.json
file-save_books: Write the books' data into the
books.json
file-save_people: Write the people's data into the
books.json
file-save_rentals: Write the rentals' data into the
rentals.json
file-get_data: This is a helper method that takes the name of a file with its extension, validates that the file exists, and extracts information from it.
-insert_data: This is a helper function that receives the name of a file with its extension and the information to save, and writes or creates a file with that information.
Include the DataRepository module in the App class.
Modify the
App
class to get the books, people, and rental data from the JSON files when the app starts.Modify the
App
class to save the books, people, and rental data into the JSON files when the app finishes its execution.Update the
menu
method in theUserInterfaceActions
class to call thefinish
method of the App class, which persists the data at the end of the application execution.Update the README.md file
⭐To the code reviewer 👨💻
💝 We really thank 🙇♂️ you, dear code reviewer 👨🎨 for dedicating your precious 🥇 time ⌚ to check the PR 🧾 .
We kindly ask 🙏 dear code reviewer 🤵 that if there is any kind of issue 🦯 in this project, please do list 📃 them in a descriptive 💡 manner and give your best suggestions 🎁 if needed.
If you think some big issues are essential to be changed ♻️ please kindly contact 📞 us through Zoom or Slack, We're available on Microverse UTC-6 time zone.