feat(catalog): OEM oyları detay sayfasına taşındı + topluluk muadil önerileri
Parça tablosu sadeleşti: Uyum ve Adet kolonları kalktı, liste açılışındaki toplu istekler (/oem-votes/lookup ve /p/matched) tamamen kaldırıldı. Her OEM kodu artık koşulsuz /dashboard/oem/$code'a linklenir — P eşleşmesi olmayan kodda da sayfa dolu: topluluk oyu kartı, muadil önerileri ve ters katalog. OEM detay sayfası: OemVoteCard (uyumlu/uyumsuz, sayaçlar, puan toast'ı, puanlama özeti + Parça Uzmanları linki) ve OemSuggestionsSection — eşleşme bulunamayan kodlar için kullanıcıdan marka + parça kodu önerisi toplar. Öneriler oem_suggestions tablosunda (kullanıcı+kod+normalize öneri başına tek satır, ON CONFLICT yutulur), markaya+normalize koda göre gruplanıp "× N kullanıcı" rozetiyle listelenir; önerilen kod kendi detayına linklenir. Şimdilik öneri puan kazandırmaz; status kolonu moderasyon kancası. API: oem-suggestions modülü (POST 10/dk throttle, GET ?code=), migration 0016_oem_suggestions. Eski tablo-içi OemVoteButtons bileşeni silindi. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
18
apps/api/drizzle/0016_oem_suggestions.sql
Normal file
18
apps/api/drizzle/0016_oem_suggestions.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- Community OEM cross-reference suggestions, collected on the OEM detail page
|
||||
-- ("muadil parça öner": brand + code). Primarily for codes the P snapshot has
|
||||
-- no match for. suggested_code_norm (upper alphanumerics) powers grouping and
|
||||
-- the per-user dedup; status is a moderation hook (active|hidden).
|
||||
CREATE TABLE "oem_suggestions" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"user_id" uuid NOT NULL,
|
||||
"oem_code" varchar(100) NOT NULL,
|
||||
"brand" varchar(80) NOT NULL,
|
||||
"suggested_code" varchar(100) NOT NULL,
|
||||
"suggested_code_norm" varchar(100) NOT NULL,
|
||||
"status" varchar(16) DEFAULT 'active' NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "oem_suggestions" ADD CONSTRAINT "oem_suggestions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX "oem_suggestions_user_oem_code_idx" ON "oem_suggestions" USING btree ("user_id","oem_code","suggested_code_norm");--> statement-breakpoint
|
||||
CREATE INDEX "oem_suggestions_oem_code_idx" ON "oem_suggestions" USING btree ("oem_code");
|
||||
@@ -113,6 +113,13 @@
|
||||
"when": 1781222400000,
|
||||
"tag": "0015_oem_votes",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 16,
|
||||
"version": "7",
|
||||
"when": 1781308800000,
|
||||
"tag": "0016_oem_suggestions",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user