summaryrefslogtreecommitdiff
path: root/schist_core/schist_fakes/src/transaction.rs
blob: cd613e39b73d39092c605cbd841344a573be3eb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use schist_models::{DateUtc, Transaction, TransactionBuilder};
use schist_traits::Nowlike;

pub fn make_fake_transaction(id: i32) -> Transaction {
    make_fake_transaction_builder(id).build().unwrap()
}

pub fn make_fake_transaction_builder(id: i32) -> TransactionBuilder {
    let mut builder = TransactionBuilder::default();
    builder
        .id(id)
        .account_id(0)
        .amount(0)
        .bucket_id(None)
        .counterparty(String::from("Fake payee"))
        .date(DateUtc::now())
        .description(String::from("Fake transaction"))
        .account_id(0);
    builder
}