feat(defter): harcama kayıtları — ekle, düzenle, sil, geri al (backend)
- /periods/{id}/entries (from/to filtresi), /entries/{id}, /entries/{id}/restore
- Grup kategoriden türetilir; kategori/ödeme türü hane ve aktiflik kontrolü
- Yalnızca açık dönem; soft delete + geri al; sürüm çakışmasında 409
- 6 entegrasyon testi (izolasyon, kapalı dönem, doğrulama, önceki dönem önerisi)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
//! `entries` koleksiyonu — günlük defterdeki harcamalar (DATA_MODEL.md §3.9).
|
||||
|
||||
use mongodb::bson::Uuid;
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::models::group::Group;
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct Entry {
|
||||
#[serde(rename = "_id")]
|
||||
pub id: Uuid,
|
||||
pub period_id: Uuid,
|
||||
/// `"YYYY-MM-DD"`
|
||||
pub date: String,
|
||||
/// Kuruş, > 0
|
||||
pub amount: i64,
|
||||
/// Kategoriden türetilir (rapor ve bütçe toplamları için ayrıca saklanır)
|
||||
pub group: Group,
|
||||
pub category_id: Uuid,
|
||||
#[serde(default)]
|
||||
pub payment_method_id: Option<Uuid>,
|
||||
#[serde(default)]
|
||||
pub description: Option<String>,
|
||||
pub created_by: Uuid,
|
||||
pub version: i32,
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
//! Şema: `docs/DATA_MODEL.md`
|
||||
|
||||
pub mod common;
|
||||
pub mod entry;
|
||||
pub mod group;
|
||||
pub mod household;
|
||||
pub mod invite;
|
||||
|
||||
Reference in New Issue
Block a user