feat(katalog): kategori ve ödeme türü uç noktaları, hane izolasyonu entegrasyon testleri
- /api/categories ve /api/payment-methods: listele, ekle, düzenle, sırala, pasife al - Sürüm kontrolü ile eşzamanlı düzenleme çakışması (409) - Backend lib + bin yapısına ayrıldı (entegrasyon testleri için) - tests/: hane izolasyonu (3) ve katalog (4) entegrasyon testleri - db:reset artık artık test veritabanlarını da siler - api.http tamamlandı; Faz 1 tamamlandı Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
//! API route'larının tek giriş noktası. Tüm uç noktalar `/api` altında.
|
||||
|
||||
mod auth;
|
||||
mod catalog;
|
||||
mod health;
|
||||
mod household;
|
||||
|
||||
use axum::{
|
||||
Router,
|
||||
routing::{delete, get, post},
|
||||
routing::{delete, get, patch, post, put},
|
||||
};
|
||||
|
||||
use crate::state::AppState;
|
||||
|
||||
/// Tüm API route'ları. Testler de bu fonksiyonu kullanır.
|
||||
pub fn router(state: AppState) -> Router {
|
||||
let api = Router::new()
|
||||
.route("/health", get(health::health))
|
||||
@@ -23,7 +25,25 @@ pub fn router(state: AppState) -> Router {
|
||||
"/household/invites",
|
||||
get(household::list_invites).post(household::create_invite),
|
||||
)
|
||||
.route("/household/invites/{id}", delete(household::revoke_invite));
|
||||
.route("/household/invites/{id}", delete(household::revoke_invite))
|
||||
.route(
|
||||
"/categories",
|
||||
get(catalog::list_categories).post(catalog::create_category),
|
||||
)
|
||||
.route("/categories/order", put(catalog::reorder_categories))
|
||||
.route("/categories/{id}", patch(catalog::update_category))
|
||||
.route(
|
||||
"/payment-methods",
|
||||
get(catalog::list_payment_methods).post(catalog::create_payment_method),
|
||||
)
|
||||
.route(
|
||||
"/payment-methods/order",
|
||||
put(catalog::reorder_payment_methods),
|
||||
)
|
||||
.route(
|
||||
"/payment-methods/{id}",
|
||||
patch(catalog::update_payment_method),
|
||||
);
|
||||
|
||||
Router::new().nest("/api", api).with_state(state)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user