Proje: Okul B2B App · Hub: Okul B2B App — Conventions

NotesService Detayları

services/NotesService.ts — Lead notları CRUD servisi.

API Endpoint’ler

GET    /customer/notes?cid={customerId}&lead_id={leadId}
POST   /customer/notes
PUT    /customer/notes/{id}
DELETE /customer/notes/{id}

createNote Request

interface StorePipedriveNoteRequest {
  lead_id: number,
  content: string,
  customer_id?: number  // Optional, logging için
}

customer_id body’de değil, x-cid header’ında gönderilir (ApiClient tarafından).

updateNote Request

interface UpdatePipedriveNoteRequest {
  content: string  // Sadece content değiştirilebilir
}

Hata Yönetimi

createNote ve updateNote throw eder — çağıran servis try/catch ile ele almalı. getLeadNotes boş array döner (throw etmez).

NotesManager Component

components/ui/NotesManager.tsx — Lead detay modal içindeki not CRUD UI. NotesService servisini kullanır.