Skip to content
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

Build the "Catalog of my things" app #50

Merged
merged 118 commits into from
Dec 23, 2023
Merged

Build the "Catalog of my things" app #50

merged 118 commits into from
Dec 23, 2023

Conversation

George7h
Copy link
Owner

@George7h George7h commented Dec 22, 2023

This PR Consists of the entire project.

Link to the project:Click here

Link to the Kanban board:Click here .

In this PR the following were implemented and this is the project requirements:

logic

  • Each class from the UML class diagram should be created in a separate .rb file.
  • All associations (1-to-many relationships) and aggregations (parent-child relationships) between classes should be implemented.
  • All properties visible in the diagram should be defined and set up in the constructor method. Exception: properties for the 1-to-many relationships should NOT be set in the constructor method. Instead, they should have a custom setter method created.
  • All methods visible in the diagram should be implemented:
    • add_item method (in all classes that have that method)
      • should take an instance of the Item class as an input.
      • should add the input item to the collection of items.
      • should add self as a property of the item object (by using the correct setter from the item object).
    • can_be_archived?() in the Item class
      • should return true if published_date is older than 10 years.
      • otherwise, it should return false.
    • move_to_archive() in the Item class
      • should reuse can_be_archived?() method.
      • should change the archived property to true if the result of the can_be_archived?() method is true.
      • should do nothing if the result of the can_be_archived?() method is false.
    • can_be_archived?() in the Book class
      • should override the method from the parent class.
      • should return true if parent's method returns true OR if cover_state equals to "bad".
      • otherwise, it should return false.
    • can_be_archived?() in the MusicAlbum class
      • should override the method from the parent class.
      • should return true if parent's method returns true AND if on_spotify equals true.
      • otherwise, it should return false.
    • can_be_archived?() in the Movie class
      • should override the method from the parent class.
      • should return true if parent's method returns true OR if silent equals true.
      • otherwise, it should return false.
    • can_be_archived?() in the Game class
      • should override the method from the parent class.
      • should return true if parent's method returns true AND if last_played_at is older than 2 years.
      • otherwise, it should return false.
  • Add unit tests for all implemented methods.

User interface

  • Create a main.rb file that will serve as your console app entry-point.
  • Your console app, at the start, should:
    • Present the user with a list of options to perform.
    • Let users choose an option.
    • If needed, ask for parameters for the option.
    • Have a way to quit the app.
  • The following options should be available:
    • List all books
    • List all music albums
    • List all movies
    • List of games
    • List all genres (e.g 'Comedy', 'Thriller')
    • List all labels (e.g. 'Gift', 'New')
    • List all authors (e.g. 'Stephen King')
    • List all sources (e.g. 'From a friend', 'Online shop')
    • Add a book
    • Add a music album
    • Add a movie
    • Add a game
  • All data should be preserved by saving collections in .json files.

Database

  • Create a schema.sql file with tables that will be analogical to the structure of the classes in your app. As you cannot implement inheritance in the database tables - add all properties and associations from the parent Item class as table columns to all tables based on the child classes. Thanks to that it can be used to store data in the future.

George7h and others added 30 commits December 18, 2023 10:30
Item Management - Implementing Item Class and Console App
- Added an add_item method in the Author class to take an instance of the Item class as input, adding the item to the collection of items, and setting self as the property of the item using the appropriate setter.
- Overrode the can_be_archived? method in the Game class to return true if the parent's method returns true and the last_played_at attribute is older than 2 years; otherwise, it returns false.
Copy link

@Olamarx Olamarx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Team,

Good job so far, indeed you have spent time on this project!
There are some issues that you still need to work on to go to the next project but you are almost there!

Highlights

  • Linters passed ✔️
  • Readme file professional ✔️
  • All methods in place ✔️

Required Changes ♻️

Check the comments under the review.

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.

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.

Comment on lines 1 to 6
# spec/game_spec.rb

require 'rspec'
require_relative '../classes/game'

describe Game do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • An error pops while trying to verify this test, I figured it is because of the path, just as others, it should be 1 dot but you added 2, also, the rspec is not needed, I dont know why you added it but when I did it as the image below, it passed.
    image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have resolved the path input.

Copy link

@Olamarx Olamarx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Team,

Your project is complete! There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉

Highlights

  • Changes fixed ✔️
  • All tests passed ✔️
  • Git and GitHub flow ✔️

Optional suggestions

Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.

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.


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.

@Obimbo07 Obimbo07 merged commit be9fa0e into main Dec 23, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants