summaryrefslogtreecommitdiff
path: root/schist_core/schist_models/src/transaction.rs
blob: ef0a0ab346b467976f9e3b4ac317cda46f666f5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use derive_builder::Builder;
use diesel::prelude::{Associations, Identifiable, Insertable, Queryable, Selectable};

use crate::{account::Account, date_utc::DateUtc};

#[derive(
    Builder,
    Clone,
    Queryable,
    Identifiable,
    Selectable,
    Insertable,
    Associations,
    Debug,
    PartialEq,
    Eq,
)]
#[diesel(table_name = crate::schema::transactions)]
#[diesel(belongs_to(Account))]
pub struct Transaction {
    pub id: i32,
    pub account_id: i32,
    pub amount: i32,
    pub bucket_id: Option<i32>,
    pub counterparty: String,
    pub date: DateUtc,
    pub description: String,
}