Hindimovieslink __full__ Review

class MovieDetail(MovieOut): description: Optional[str] genre: List[str] = [] director: Optional[str] cast: List[str] = [] links: List[LinkOut] = []

# ------------------------------------------------- # 5️⃣ Notification subscription (price‑drop) # ------------------------------------------------- @app.post("/me/alerts", response_model=schemas.AlertOut) def create_price_alert( payload: schemas.AlertIn, user: models.User = Depends(auth.get_current_user), db: Session = Depends(auth.get_db) ): return crud.create_price_alert(db, user.id, payload) class MovieOut(BaseModel): id: int title: str year: Optional[int] poster_url: Optional[str] rating_imdb: Optional[float] hindimovieslink

-- Watch‑Later / Favorites CREATE TABLE user_lists ( id BIGSERIAL PRIMARY KEY, user_id BIGINT REFERENCES users(id) ON DELETE CASCADE, movie_id BIGINT REFERENCES movies(id) ON DELETE CASCADE, list_type TEXT CHECK (list_type IN ('watch_later','favorites')), created_at TIMESTAMP DEFAULT now(), UNIQUE(user_id, movie_id, list_type) ); Add pg_trgm indexes for fuzzy title search: user: models.User = Depends(auth.get_current_user)

class WatchlistItemOut(BaseModel): movie_id: int added_at: datetime.datetime list_type TEXT CHECK (list_type IN ('watch_later'

# ------------------------------------------------- # 3️⃣ Rate / Review (Auth required) # ------------------------------------------------- @app.post("/movies/movie_id/rating", response_model=schemas.RatingOut) def rate_movie( movie_id: int, payload: schemas.RatingIn, user: models.User = Depends(auth.get_current_user), db: Session = Depends(auth.get_db) ): return crud.upsert_rating(db, user.id, movie_id, payload)

CREATE TABLE movie_links ( id BIGSERIAL PRIMARY KEY, movie_id BIGINT REFERENCES movies(id) ON DELETE CASCADE, platform_id BIGINT REFERENCES platforms(id), url TEXT NOT NULL, price_usd NUMERIC(5,2), price_local NUMERIC(5,2), currency TEXT, is_free BOOLEAN DEFAULT FALSE, last_checked TIMESTAMP, UNIQUE(movie_id, platform_id) );

class AlertIn(BaseModel): movie_id: int platform_id: int target_price_usd: float # Notify when price <= this

Написать директору