Files
sase.tr/README.md
Fusion 65daf99b2e
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
chore(payments): remove EFT/bank-transfer method, keep Stripe only
Removes the EFT (havale) payment surface across API, web, i18n, and docs.
Card payment via Stripe is now the only checkout path.

API (apps/api/src):
- Delete payments/bank-accounts/ module (controller + service + module)
- payments.service: drop EFT methods (createEftPayment, uploadEftReceipt,
  approveEft, rejectEft, getActiveBankInfo, getPendingEftPayments) and the
  BankAccountsService dependency
- payments.controller: drop /payments/eft, /payments/eft/:id/{receipt,approve,reject},
  /payments/bank-info, /payments/pending; keep /payments/me
- payments.module: drop BankAccountsModule import
- admin.service: drop pending EFT counter from getDashboardStats; drop
  getPendingPayments (admin EFT approval list)
- admin.controller: drop /admin/payments/pending endpoint
- admin.service.spec: drop the getPendingPayments + pendingPayments assertions

Web (apps/web/src):
- Delete components/payment/bank-transfer-card.tsx
- Delete routes/dashboard/admin/payments.tsx (EFT approval page); regenerate
  routeTree.gen.ts
- subscription/index.tsx: drop EFT tab from PaymentMethodSection, drop the
  paymentMethod state + handleEftCompleted, simplify ConfirmationCard to the
  Stripe-only path, drop unused imports (Tabs, BankTransferCard, Building2)
- billing.tsx: drop "eft" from method filter chips; keep methodLabels.eft and
  the legacy receipt download so historical EFT records still display
- dashboard.tsx + admin/index.tsx: drop /dashboard/admin/payments from the
  sidebar + admin quick-link grid; trim unused icon imports; KEYS_6 → KEYS_5
  for the now-5-card admin stats skeleton
- messages/{tr,en}.json: strip every EFT-only key under payment.* (eftTransfer,
  eftConfirmationDescription, eftPaid, eftStatus, bank.*, uploadReceipt* etc.)

Schema (apps/api/src/database/schema):
- bankAccounts table + payments.bankAccountId column are kept as-is: legacy
  EFT payments remain visible on the billing page and the schema preserves
  historical records.

Docs:
- README.md: "Stripe (kart) + EFT" → "Stripe (kart)"
- CLAUDE.md: stack table + PaymentsModule row + payments table note + route
  list updated; admin EFT approval route removed

Verification:
- pnpm typecheck: green (api + web + shared + config + ui)
- pnpm lint: green
- pnpm test: 20 web tests pass, 173 api tests pass
2026-05-16 11:03:30 +03:00

124 lines
3.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Sase
VIN/şase numarası sorgulama ve otomotiv yedek parça katalog platformu (Türkiye).
**Site:** https://sase.tr · **Staging:** https://dev.sase.tr
---
## Stack
| Katman | Teknoloji |
|---|---|
| Monorepo | pnpm 10 + Turborepo |
| Backend | NestJS 10, TypeScript 5.7, Node 22 |
| DB | PostgreSQL 17 + Drizzle ORM |
| Cache / Queue | Redis 7 + BullMQ |
| Auth | Better Auth (cookie session) |
| Frontend | Vite 6, React 19, TanStack Router + Query |
| UI | Tailwind v4, shadcn/ui (Radix) |
| Ödeme | Stripe (kart) |
| Email | Postal |
| Storage | MinIO (S3) |
| Analitik | PostHog |
| Test | Vitest, Playwright |
| Deploy | GitHub Actions → SSH → PM2 |
---
## Yapı
```
ss/
├── apps/
│ ├── api/ NestJS (port 4000, /api)
│ └── web/ Vite + React (port 3000)
├── packages/
│ ├── shared/ Tipler, Zod şemaları
│ ├── config/ Env şeması (Zod)
│ └── ui/ Paylaşılan shadcn bileşenleri
├── docker/ docker-compose + nginx
├── scripts/ Deploy + bakım scriptleri
└── docs/ Detay dökümantasyon (INDEX.md)
```
---
## Komutlar
```bash
pnpm dev # tüm app'ler (Turbo)
pnpm build
pnpm test # Vitest
pnpm lint # Biome
pnpm typecheck
# DB (apps/api/)
pnpm db:push # şemayı push
pnpm db:studio # Drizzle Studio
pnpm db:generate # migration üret
# Tek app
pnpm dev --filter=api
pnpm dev --filter=web
```
---
## VIN Decode Akışı
```
Corgi (offline WMI) → PartsCatalogs API → PL24 API → EMEX scraper → NHTSA
```
Birden fazla araç eşleşmesi gelirse frontend seçim modalı gösterir.
---
## Katalog Mimarisi
- **PL24 P5 Modern** (REST/JSON) — VW Group, BMW, Mercedes, Renault, Toyota...
- **PL24 P4 Legacy** (HTML scrape) — Ford, PSA, Hyundai/Kia, Nissan, Opel, Volvo
- **PartsCatalogs** (REST + Playwright JWT) — geniş VIN kapsamı
- **EMEX** (Playwright scrape, `emexdwc.ae`) — async BullMQ worker
---
## EMEX & PartsCatalogs Türkçeleştirme
EMEX ve PartsCatalogs kaynakları kategori/parça isimlerini İngilizce (zaman zaman Rusça) döner. Çeviri akışı:
1. **`TranslationsService`** (`apps/api/src/translations/`) — Redis cache → DB lookup (`emex_category_translations`) → orijinal döndür. Dictionary tabanlı word-by-word replace **devre dışı** (yarı-İngilizce çıktı yaratıyordu).
2. **Hot path** (`categories.service.ts`) — EMEX/PCAT insert noktalarında `translateMany()` ile bulk lookup yapılır; cache miss varsa orijinal yazılır, sonraki bootstrap pass'inde LLM ile çevrilir.
3. **Bootstrap script** (`scripts/emex-translate-bootstrap.ts`) — DB'deki tüm unique `name_original` değerlerini OpenRouter üzerinden DeepSeek V3 ile çevirir, `emex_category_translations` tablosuna yazar.
4. **Backfill script** (`scripts/emex-backfill-tr-names.ts`) — translation tablosuna göre mevcut `categories.name` ve `parts.name` değerlerini günceller, Redis cache flush eder.
```bash
# 1) Tüm yeni terimleri çevir (~$0.50, ~30 dk)
pnpm exec tsx scripts/emex-translate-bootstrap.ts --dry-run
pnpm exec tsx scripts/emex-translate-bootstrap.ts
# 2) DB kayıtlarını güncelle
pnpm exec tsx scripts/emex-backfill-tr-names.ts --dry-run
pnpm exec tsx scripts/emex-backfill-tr-names.ts
# 3) API restart (yeni hot-path translateMany için)
pm2 restart sase-api
```
**Env:** `OPENROUTER_API_KEY` (`apps/api/.env`).
---
## Test Bilgileri
- Admin: `admin@sase.tr` / `Sase2026`
- Test VIN (VW): `WVWZZZ1JZ3W597935`
- Login: `POST /api/auth/sign-in/email` → cookie `better-auth.session_token`
---
## Daha Fazla
- `docs/INDEX.md` — kapsamlı proje rehberi (rotalar, API, DB şeması, bileşenler)
- `CLAUDE.md` — Claude Code için proje rehberi