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

Netflix Assigment #3

Open
Faizahmadfaiz opened this issue Oct 5, 2022 · 1 comment
Open

Netflix Assigment #3

Faizahmadfaiz opened this issue Oct 5, 2022 · 1 comment

Comments

@Faizahmadfaiz
Copy link

Faizahmadfaiz commented Oct 5, 2022

Take Home Exercise

Design the class Diagram and database Schema for a system like Netflix with following Use Cases.

  • Netflix has users.
  • Every user has an email and a password.
  • Users can create profiles to have separate independent environments.
  • Each profile has a name and a type. Type can be KID or ADULT.
  • There are multiple videos on netflix.
  • For each video, there will be a title, description and a cast.
  • A cast is a list of actors who were a part of the video. For each actor we need to know their name and list of videos they were a part of.
  • For every video, for any profile who watched that video, we need to know the status (COMPLETED/ IN PROGRESS).
  • For every profile for whom a video is in progress, we want to know their last watch timestamp.

MY SOLUTION

NETFLIX

Class Diagram

classDiagram
direction TB
    class User {
        -String email
        -String password
    }
    
    class Profile {
        -User user
        -String name
        -ProfileType type
        -Video[] videos
    }
    
    class ProfileType {
        <<enumeration>>
        ADULT
        KID
    }
    
    class VideoStatus {
        <<enumeration>>
        COMPLETED
        IN_PROGRESS
    }
    
    class Video {
        -String title
        -String descripiton
        -Actor[] cast
    }
    
    class Actor {
        -String name
    }
    
    class ProfileVideo {
        Profile profile
        Video video
        VideoStatus status
        DateTime timeStamp
    }
    
    User "1" *-- "*" Profile
    Actor "*" o-- "*" Video
    Video "*" o-- "*" Profile
    Profile *-- ProfileVideo
    Video *-- ProfileVideo
Loading
erDiagram
    USER {
        int id PK
        String email
        String passoword
    }
    
    PROFILE {
        int id PK
        String type
        int user_id FK
    }
    
    ACTOR {
        int id PK
        String name
    }
    
    VIDEO {
        int id PK
        String title
        String description
    }
    
    ACTOR_VIDEO {
        int actor_id FK "Composite PK"
        int video_id FK "Composite PK"
    }
    
    VIDEOSTATUS {
        int id PK
        String name
    }
    
    PROFILE_VIDEO {
        int profile_id FK "Composte PK"
        int video_id FK "Composite PK"
        int video_status_id FK
        DateTime timestamp 
    }
Loading
@Faizahmadfaiz
Copy link
Author

Faizahmadfaiz commented Oct 5, 2022

Above tables are very small. How to make it bigger (using mermaid)?

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

No branches or pull requests

1 participant