feat(blog): add city_id to blogs for city-specific scoping
- Introduced a new nullable city_id column in the blogs table to allow scoping of blog posts to specific cities. - Updated Blog entity to include a ManyToOne relationship with the City entity. - Enhanced BlogController to handle city_id in the request, allowing filtering of posts by city. - Modified BlogRepository to support querying published posts based on city_id. - Added tests to ensure correct behavior for city-scoped and nationwide posts, including creation and updating of posts with city associations.
This commit is contained in:
@@ -428,6 +428,8 @@ export interface Blog {
|
||||
image_url: string | null;
|
||||
status: "draft" | "published";
|
||||
author?: { uuid: string; name: string } | null;
|
||||
/** null = مقاله سراسری (روی همه دامنهها، canonical روی دامنه اصلی) */
|
||||
city?: { id: string; name: string } | null;
|
||||
tags: string[];
|
||||
created_at: string;
|
||||
updated_at?: string;
|
||||
|
||||
Reference in New Issue
Block a user