Skip to main content

finance_core/
entity.rs

1// ═══════════════════════════════════════════════════════════════════════════
2// Entity — the canonical "company" primitive shared across the suite.
3//
4// Historical name is `Issuer` (a company that ISSUES invoices); we keep the
5// type name `Issuer` for now since invoice-cli is the only consumer and
6// renaming every call-site adds churn for no gain. Later tools (receipt-cli
7// for merchants, ledger-cli for counterparties) will query the same table.
8// ═══════════════════════════════════════════════════════════════════════════
9
10use serde::{Deserialize, Serialize};
11
12use crate::tax::Jurisdiction;
13
14#[derive(Debug, Clone, Serialize, Deserialize)]
15pub struct Issuer {
16    pub id: i64,
17    pub slug: String,
18    pub name: String,
19    pub legal_name: Option<String>,
20    pub jurisdiction: Jurisdiction,
21    pub tax_registered: bool,
22    pub tax_id: Option<String>,
23    pub company_no: Option<String>,
24    pub tagline: Option<String>,
25    pub address: Vec<String>,
26    pub email: Option<String>,
27    pub phone: Option<String>,
28    pub bank_name: Option<String>,
29    pub bank_iban: Option<String>,
30    pub bank_bic: Option<String>,
31    pub default_template: String,
32    pub currency: Option<String>,
33    pub symbol: Option<String>,
34    pub number_format: String,
35    /// Filesystem path to a logo image (PNG/SVG/JPG). Rendered in template
36    /// header when set.
37    pub logo_path: Option<String>,
38}