Motivation / 目的
Add favorite (bookmark) functionality for World Heritage sites, backed by a new intermediate table linking users and world_heritage_sites.
ユーザーが世界遺産をお気に入り登録できる機能を追加する。中間テーブルで users と world_heritage_sites を紐付ける。
Scope / スコープ
- Add a favorite (
POST)
- Remove a favorite (
DELETE)
- List my favorites (
GET)
A dedicated "is this heritage favorited by me" check endpoint is intentionally out of scope for this issue — still under separate discussion.
「特定の世界遺産が自分のお気に入りかどうかを確認するAPI」は本Issueのスコープ外(別途壁打ち中)。
API Request / Response
POST /api/v1/users/me/favorites
Request body:
user_id: number — 対象ユーザーID
heritage_id: number — 対象の世界遺産ID
is_liked: boolean — true でお気に入り登録
timestamps: created_at / updated_at(サーバー側で自動設定、クライアントからは渡さない)
Response: 204 No Content
DELETE /api/v1/users/me/favorites/{heritageId}
Request body: なし(URLの heritageId のみで対象を特定)
Response: 204 No Content
Sub-issues / サブIssue
Motivation / 目的
Add favorite (bookmark) functionality for World Heritage sites, backed by a new intermediate table linking
usersandworld_heritage_sites.ユーザーが世界遺産をお気に入り登録できる機能を追加する。中間テーブルで
usersとworld_heritage_sitesを紐付ける。Scope / スコープ
POST)DELETE)GET)A dedicated "is this heritage favorited by me" check endpoint is intentionally out of scope for this issue — still under separate discussion.
「特定の世界遺産が自分のお気に入りかどうかを確認するAPI」は本Issueのスコープ外(別途壁打ち中)。
API Request / Response
POST /api/v1/users/me/favoritesRequest body:
user_id: number — 対象ユーザーIDheritage_id: number — 対象の世界遺産IDis_liked: boolean —trueでお気に入り登録timestamps:created_at/updated_at(サーバー側で自動設定、クライアントからは渡さない)Response:
204 No ContentDELETE /api/v1/users/me/favorites/{heritageId}Request body: なし(URLの
heritageIdのみで対象を特定)Response:
204 No ContentSub-issues / サブIssue