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

solution #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VolodymyrSemchysyn
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on implementing the Movie Theater API endpoints! 🎉 While there are a few minor areas for improvement, such as ensuring consistency in date field types and refining error handling, your code meets the core requirements and functions as expected. Keep up the good work and consider the feedback for future enhancements! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


db.add(movie)
try:
db.commit()

Choose a reason for hiding this comment

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

Consider adding more specific error handling for database operations, especially for potential IntegrityError exceptions that might arise from constraints other than those already checked.


db.delete(movie)
db.commit()
return {"detail": "Movie deleted successfully."}

Choose a reason for hiding this comment

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

Returning a JSON response with a detail message is not typical for a 204 No Content response. Consider removing the return statement or changing the status code to 200 if you want to return a message.

Comment on lines +108 to +118
name: str = None
date: date = None
score: float = None
overview: str = None
status: MovieStatusEnum = None
budget: float = None
revenue: float = None
country: str = None
genres: List[str] = None
actors: List[str] = None
languages: List[str] = None

Choose a reason for hiding this comment

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

The MovieCreateOptional class sets all fields to optional, which might lead to confusion or unintended behavior. Ensure that the application logic properly handles cases where fields are not provided.

class MovieDetailResponseSchema(BaseModel):
name: str
description: Optional[str] = None
release_date: Optional[datetime] = None

Choose a reason for hiding this comment

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

The release_date field is of type Optional[datetime], which might be inconsistent with the date field used elsewhere in the schemas. Consider using a consistent type for date fields across different schemas.

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.

2 participants