Files
kakeibo/backend/api.http
T
suphicakir b269411823 feat(giriş): giriş ve kayıt ekranları
- Giriş: satır içi doğrulama, şifre göster/gizle, beni hatırla, hoş geldin bildirimi
- Kayıt: yeni hane kur / davetle katıl, /kayit?davet=KOD bağlantısı
- Sunucu hataları ilgili alanda gösterilir (kayıtlı e-posta, geçersiz davet)
- react-hook-form + zod, sonner bildirimleri, shadcn input/label/checkbox/card
- Ortak form bileşenleri (FormField, PasswordInput, FormError)
- 8 form kuralı testi (toplam 47); api.http demo hesaplara güncellendi
- Faz 2 tamamlandı

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 00:52:13 +03:00

131 lines
3.8 KiB
HTTP
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.
### Kakeibo API — örnek istekler (VS Code REST Client eklentisi)
### Satırın üstündeki "Send Request" bağlantısına tıklayın.
### Yerel demo hesapları: demo@ornek.com / demo12345 (hane sahibi) · es@ornek.com / demo12345 (üye)
@baseUrl = http://localhost:8080/api
### Sağlık kontrolü (DB erişilemezse 503 + "db": "error")
GET {{baseUrl}}/health
# ─────────────────────────── Kimlik doğrulama ───────────────────────────
# REST Client cookie'leri otomatik saklar: kayıt/giriş sonrası diğer istekler oturumlu gider.
### Kayıt (kullanıcı + hane + örnek kategoriler/ödeme türleri oluşur)
POST {{baseUrl}}/auth/register
Content-Type: application/json
{
"name": "Suphi",
"email": "yeni@ornek.com",
"password": "gizli-sifre-123",
"household_name": "Çakır Hanesi"
}
### Davet koduyla kayıt (mevcut haneye "member" olarak katılır; household_name yok sayılır)
# Kod büyük/küçük harf ve tireden bağımsızdır: "abcd-efgh" = "ABCDEFGH"
POST {{baseUrl}}/auth/register
Content-Type: application/json
{
"name": "Ayşe",
"email": "ayse@ornek.com",
"password": "gizli-sifre-123",
"invite_code": "BURAYA-KOD"
}
### Giriş ("remember_me": true → 30 gün, false → tarayıcı kapanınca biter)
POST {{baseUrl}}/auth/login
Content-Type: application/json
{
"email": "demo@ornek.com",
"password": "gizli-sifre-123",
"remember_me": true
}
### Ben kimim? (oturum yoksa 401)
GET {{baseUrl}}/auth/me
### Çıkış
POST {{baseUrl}}/auth/logout
# ─────────────────────────── Hane ve davetler ───────────────────────────
### Hane bilgisi ve üyeler
GET {{baseUrl}}/household
### Yeni davet kodu (yalnızca hane sahibi; 7 gün geçerli, tek kullanımlık)
POST {{baseUrl}}/household/invites
### Aktif davetler (yalnızca hane sahibi)
GET {{baseUrl}}/household/invites
### Daveti iptal et (yalnızca hane sahibi) — id'yi yukarıdaki listeden alın
DELETE {{baseUrl}}/household/invites/BURAYA-ID
# ─────────────────────────── Kategoriler ───────────────────────────
# Gruplar: needs (Zorunlu) · wants (İstek) · culture (Kültürel) · unexpected (Beklenmeyen)
# Silme yok; "is_active": false ile pasife alınır.
### Kategoriler (aktif olanlar; pasifler için ?include_inactive=true)
GET {{baseUrl}}/categories
### Kategori ekle (grubun sonuna eklenir)
POST {{baseUrl}}/categories
Content-Type: application/json
{
"group": "needs",
"name": "Aidat",
"emoji": "🏢"
}
### Kategori düzenle / pasife al — "version": listede gördüğünüz sürüm (başkası değiştirdiyse 409)
PATCH {{baseUrl}}/categories/BURAYA-ID
Content-Type: application/json
{
"name": "Site Aidatı",
"is_active": true,
"version": 1
}
### Grup içi sıralama — gruptaki TÜM kimlikler (pasifler dahil), istenen sırada
PUT {{baseUrl}}/categories/order
Content-Type: application/json
{
"group": "culture",
"ids": ["ID-1", "ID-2", "ID-3"]
}
# ─────────────────────────── Ödeme türleri ───────────────────────────
### Ödeme türleri
GET {{baseUrl}}/payment-methods
### Ödeme türü ekle
POST {{baseUrl}}/payment-methods
Content-Type: application/json
{
"name": "Yemek Kartı",
"emoji": "🍽️"
}
### Ödeme türü düzenle / pasife al
PATCH {{baseUrl}}/payment-methods/BURAYA-ID
Content-Type: application/json
{
"is_active": false
}
### Ödeme türü sıralama — TÜM kimlikler
PUT {{baseUrl}}/payment-methods/order
Content-Type: application/json
{
"ids": ["ID-1", "ID-2", "ID-3", "ID-4"]
}