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:
hamed
2026-07-19 08:23:57 +03:30
parent bd66b213c2
commit a4b07c2f80
10 changed files with 535 additions and 178 deletions
+2
View File
@@ -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;