feat(canonical): 2-level serving — taksonomi endpoint + araç sub-gruplama
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

GET /categories/canonical/taxonomy: kova→alt-yaprak + populasyon sayısı (B2C API
kontratı). getCanonicalTree (vehicle + catalog) artık subLeaves geçip her kovayı
alt-gruplara böler (materialize + on-the-fly sub fallback). jant-tire slug fix
(jant-lastik üst-kova ile çakışıyordu). Kategori sub-kapsama: Filtre %88, Fren/
Aydınlatma %74, Motor/Süsp/Elektrik %60-66. Eşleşmeyen → Genel/SP manuel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 16:40:39 +03:00
parent 9dd3b2c858
commit 2d5e2d04a9
17 changed files with 251 additions and 108 deletions

View File

@@ -1,3 +1,4 @@
import { createHmac, timingSafeEqual } from "node:crypto";
import {
Body,
Controller,
@@ -15,7 +16,6 @@ import {
} from "@nestjs/common";
import { ConfigService } from "@nestjs/config";
import type { Request, Response } from "express";
import { createHmac, timingSafeEqual } from "node:crypto";
import { Public } from "../common/decorators/public.decorator";
import { InternalTokenGuard } from "../common/guards/internal-token.guard";
import { ImpersonationService } from "./impersonation.service";
@@ -66,9 +66,8 @@ export class ImpersonationController {
ttlMinutes: body.ttlMinutes ?? 15,
reason,
ipAddress: this.getIp(req),
userAgent: typeof req.headers["user-agent"] === "string"
? req.headers["user-agent"]
: undefined,
userAgent:
typeof req.headers["user-agent"] === "string" ? req.headers["user-agent"] : undefined,
});
const baseUrl = this.configService.get<string>("auth.url") ?? "";
@@ -149,8 +148,7 @@ export class ImpersonationController {
private consumeSecret(): string {
const secret =
process.env.INTERNAL_IMPERSONATION_SECRET ??
this.configService.get<string>("auth.secret");
process.env.INTERNAL_IMPERSONATION_SECRET ?? this.configService.get<string>("auth.secret");
if (!secret) throw new Error("INTERNAL_IMPERSONATION_SECRET or auth.secret required");
return secret;
}