aboutsummaryrefslogtreecommitdiff
path: root/apps/koffice/invoice/src/pfile.rs
blob: ec99e5ab3049668be94b58f554b03f0eb622e4d4 (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
29
30
31
32
33
use crate::{Account, Address, Worker, InvoiceId};
use chrono::NaiveDate;
use serde::{Serialize, Deserialize};

/// Describes invoice metadata
#[derive(Serialize, Deserialize)]
pub struct InvoiceFile {
    invoice_id: InvoiceId,
    date: NaiveDate,
    author: Worker,
    account: Account,
    client: Address,
    vat: u8,
    service: Vec<ServiceEntry>,
    currency: String,
    lang: String,
}

/// A service description
#[derive(Serialize, Deserialize)]
pub enum ServiceEntry {
    Line(String),
    Hash {
        description: String,
        price: usize,
        details: Vec<String>,
    }
}

pub fn data_templ() -> String {

    todo!()
}