feat: EMEX VIN decode → DB catalog entegrasyonu
Some checks failed
CI / Lint, Typecheck, Test & Build (push) Has been cancelled
Some checks failed
CI / Lint, Typecheck, Test & Build (push) Has been cancelled
- CATALOG_MAP'e ~40 yeni WMI eklendi (Mitsubishi, Nissan, Volvo, vb.) - brandFromCatalogCode listesi 55 DB kataloğuna genişletildi - brand="UNKNOWN" olsa bile catalogCode varsa EMEX sonucu kabul edilir - emex-catalog: linkPath'li kategorilerde parçalar DB'den yüklenir (scraper bug fix) - VIN cache: emex_vehicle_vins tablosu ile tekrar VIN'lerde emexdwc.ae atlanır - getCategoryTree Step 0: VIN cache lookup (~10ms) - Match sonrası otomatik VIN cache doldurma - Proaktif cache: ilk decode sonrası matchByName + saveVinCache Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -332,13 +332,23 @@ export class EmexService {
|
||||
if (!c) return null;
|
||||
const upper = c.toUpperCase();
|
||||
const prefixes: [string, string][] = [
|
||||
['BMW', 'BMW'], ['MB', 'Mercedes-Benz'], ['AU', 'Audi'],
|
||||
['VW', 'Volkswagen'], ['FFIAT', 'Fiat'], ['RFIAT', 'Alfa Romeo'],
|
||||
['FORD', 'Ford'], ['RENAULT', 'Renault'], ['TOYOTA', 'Toyota'],
|
||||
['BMW', 'BMW'], ['MB', 'Mercedes-Benz'], ['MBS', 'Smart'],
|
||||
['AU', 'Audi'], ['VW', 'Volkswagen'],
|
||||
['FFIAT', 'Fiat'], ['CFIAT', 'Abarth'], ['RFIAT', 'Alfa Romeo'],
|
||||
['LFIAT', 'Lancia'], ['TFIAT', 'Fiat'],
|
||||
['FORD', 'Ford'], ['RENAULT', 'Renault'], ['DACIA', 'Dacia'],
|
||||
['TOYOTA', 'Toyota'], ['LEXUS', 'Lexus'],
|
||||
['HONDA', 'Honda'], ['KIA', 'Kia'], ['HYUNDAI', 'Hyundai'],
|
||||
['PORSCHE', 'Porsche'], ['SUBARU', 'Subaru'], ['MAZDA', 'Mazda'],
|
||||
['CPSA', 'Citroën/Peugeot'], ['VOLVO', 'Volvo'], ['NISSAN', 'Nissan'],
|
||||
['OPEL', 'Opel'],
|
||||
['PO', 'Porsche'], ['SUBARU', 'Subaru'], ['MAZDA', 'Mazda'],
|
||||
['MMC', 'Mitsubishi'], ['NISSAN', 'Nissan'], ['INFINITI', 'Infiniti'],
|
||||
['PEUGEOT', 'Peugeot'], ['CITROEN', 'Citroen'],
|
||||
['VOLVO', 'Volvo'], ['JAGUAR', 'Jaguar'], ['LRE', 'Land Rover'],
|
||||
['MINI', 'Mini'], ['RR', 'Rolls-Royce'],
|
||||
['GM_OP', 'Opel'], ['GM_VX', 'Vauxhall'], ['GM_C', 'Chevrolet'],
|
||||
['GM_B', 'Buick'], ['GM_K', 'Cadillac'], ['GM_G', 'GMC'],
|
||||
['SK', 'Skoda'], ['SE', 'Seat'], ['SY', 'SsangYong'],
|
||||
['ISUZU', 'Isuzu'], ['SUZUKI', 'Suzuki'],
|
||||
['CHRYSLER', 'Chrysler'], ['DODGE', 'Dodge'], ['JEEP', 'Jeep'], ['RAM', 'Ram'],
|
||||
];
|
||||
for (const [prefix, brand] of prefixes) {
|
||||
if (upper.startsWith(prefix)) return brand;
|
||||
|
||||
@@ -234,33 +234,103 @@ export interface CatalogEntry {
|
||||
* WMI (World Manufacturer Identifier) to catalog mapping
|
||||
*/
|
||||
export const CATALOG_MAP: Record<string, CatalogEntry> = {
|
||||
// BMW
|
||||
WBA: { code: 'BMW202501', brand: 'BMW' },
|
||||
WBS: { code: 'BMW202501', brand: 'BMW' },
|
||||
WBY: { code: 'BMW202501', brand: 'BMW' },
|
||||
// Mercedes-Benz
|
||||
WDB: { code: 'MB201810', brand: 'Mercedes-Benz' },
|
||||
WDD: { code: 'MB201810', brand: 'Mercedes-Benz' },
|
||||
WDC: { code: 'MB201810', brand: 'Mercedes-Benz' },
|
||||
WDF: { code: 'MB201810', brand: 'Mercedes-Benz' },
|
||||
// Audi
|
||||
WAU: { code: 'AU1587', brand: 'Audi' },
|
||||
TRU: { code: 'AU1587', brand: 'Audi' },
|
||||
// Volkswagen
|
||||
WVW: { code: 'VW1587', brand: 'Volkswagen' },
|
||||
WVG: { code: 'VW1587', brand: 'Volkswagen' },
|
||||
WV2: { code: 'VW1587', brand: 'Volkswagen' },
|
||||
// Renault
|
||||
VF1: { code: 'RENAULT201910', brand: 'Renault' },
|
||||
VF7: { code: 'CPSA01', brand: 'Peugeot' },
|
||||
VF3: { code: 'CPSA01', brand: 'Peugeot' },
|
||||
ZFA: { code: 'CFIAT84', brand: 'Fiat' },
|
||||
// Peugeot
|
||||
VF3: { code: 'PEUGEOT00', brand: 'Peugeot' },
|
||||
// Citroen/Peugeot (VF7 shared — Peugeot more common)
|
||||
VF7: { code: 'PEUGEOT00', brand: 'Peugeot' },
|
||||
// Fiat
|
||||
ZFA: { code: 'FFIAT84', brand: 'Fiat' },
|
||||
// Alfa Romeo
|
||||
ZAR: { code: 'RFIAT84', brand: 'Alfa Romeo' },
|
||||
// Ford
|
||||
WF0: { code: 'FORD202201', brand: 'Ford' },
|
||||
NM0: { code: 'FORD202201', brand: 'Ford' },
|
||||
// Toyota
|
||||
JTD: { code: 'TOYOTA00', brand: 'Toyota' },
|
||||
JTE: { code: 'TOYOTA00', brand: 'Toyota' },
|
||||
SHH: { code: 'HONDA00', brand: 'Honda' },
|
||||
KNM: { code: 'HYUNDAI00', brand: 'Hyundai' },
|
||||
KNA: { code: 'KIA00', brand: 'Kia' },
|
||||
JTN: { code: 'TOYOTA00', brand: 'Toyota' },
|
||||
// Lexus
|
||||
JTH: { code: 'LEXUS00', brand: 'Lexus' },
|
||||
JTJ: { code: 'LEXUS00', brand: 'Lexus' },
|
||||
// Honda
|
||||
SHH: { code: 'HONDA2017', brand: 'Honda' },
|
||||
// Hyundai
|
||||
KMH: { code: 'HYUNDAI202404', brand: 'Hyundai' },
|
||||
KNM: { code: 'HYUNDAI202404', brand: 'Hyundai' },
|
||||
// Kia
|
||||
KNA: { code: 'KIA202404', brand: 'Kia' },
|
||||
KNE: { code: 'KIA202404', brand: 'Kia' },
|
||||
// Porsche
|
||||
WP0: { code: 'PO799', brand: 'Porsche' },
|
||||
WP1: { code: 'PO799', brand: 'Porsche' },
|
||||
// Subaru
|
||||
JF1: { code: 'SUBARU201802', brand: 'Subaru' },
|
||||
JF2: { code: 'SUBARU201802', brand: 'Subaru' },
|
||||
// Mazda
|
||||
JMZ: { code: 'MAZDA2020', brand: 'Mazda' },
|
||||
JM1: { code: 'MAZDA2020', brand: 'Mazda' },
|
||||
JM3: { code: 'MAZDA2020', brand: 'Mazda' },
|
||||
// Mitsubishi
|
||||
JMY: { code: 'MMC202501', brand: 'Mitsubishi' },
|
||||
JMB: { code: 'MMC202501', brand: 'Mitsubishi' },
|
||||
JA3: { code: 'MMC202501', brand: 'Mitsubishi' },
|
||||
JA4: { code: 'MMC202501', brand: 'Mitsubishi' },
|
||||
JA7: { code: 'MMC202501', brand: 'Mitsubishi' },
|
||||
// Nissan
|
||||
JN1: { code: 'NISSAN201809', brand: 'Nissan' },
|
||||
JN8: { code: 'NISSAN201809', brand: 'Nissan' },
|
||||
VSK: { code: 'NISSAN201809', brand: 'Nissan' },
|
||||
// Volvo
|
||||
YV1: { code: 'VOLVO201410', brand: 'Volvo' },
|
||||
YV4: { code: 'VOLVO201410', brand: 'Volvo' },
|
||||
// MINI
|
||||
WMW: { code: 'MINI202501', brand: 'Mini' },
|
||||
// Jaguar
|
||||
SAJ: { code: 'JAGUAR201701', brand: 'Jaguar' },
|
||||
// Land Rover
|
||||
SAL: { code: 'LRE201412', brand: 'Land Rover' },
|
||||
// Skoda
|
||||
TMB: { code: 'SK1119', brand: 'Skoda' },
|
||||
// SEAT
|
||||
VSS: { code: 'SE1113', brand: 'Seat' },
|
||||
// Dacia
|
||||
UU1: { code: 'DACIA201910', brand: 'Dacia' },
|
||||
// Suzuki
|
||||
JSA: { code: 'SUZUKI201905', brand: 'Suzuki' },
|
||||
TSM: { code: 'SUZUKI201905', brand: 'Suzuki' },
|
||||
// Isuzu
|
||||
JAA: { code: 'ISUZU201702', brand: 'Isuzu' },
|
||||
// Opel
|
||||
W0L: { code: 'GM_OP201809', brand: 'Opel' },
|
||||
// Chevrolet
|
||||
KL1: { code: 'GM_C201809', brand: 'Chevrolet' },
|
||||
// SsangYong
|
||||
KPT: { code: 'SY201502', brand: 'SsangYong' },
|
||||
// Chrysler/Jeep/Dodge/RAM
|
||||
'1C4': { code: 'JEEP202402', brand: 'Jeep' },
|
||||
'3C4': { code: 'CHRYSLER202402', brand: 'Chrysler' },
|
||||
// Rolls-Royce
|
||||
SCA: { code: 'RR202501', brand: 'Rolls-Royce' },
|
||||
// Smart
|
||||
WME: { code: 'MBS201810', brand: 'Smart' },
|
||||
// Infiniti
|
||||
JNK: { code: 'INFINITI201809', brand: 'Infiniti' },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user