Skip to main content

firefly_iii/models/
transaction_split_update.rs

1/*
2 * Firefly III API v6.4.14
3 *
4 * This is the documentation of the Firefly III API. Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. <br><br> Please keep in mind that the demo site does **not** accept requests from `curl`, `colly`, `wget`, etc. You must use a browser or a tool like Insomnia to make your test requests. <br><br> To learn more about the idiosyncrasies of this API, please read about the API in the [Firefly III API documentation](https://docs.firefly-iii.org/references/firefly-iii/api/). <br><br> <small>This file was last generated on 2025-12-26 @ 15:17:41 (Europe/Amsterdam)</small>
5 *
6 * The version of the OpenAPI document: v6.4.14
7 * Contact: james@firefly-iii.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11#![allow(unused_imports)]
12
13use crate::models::{self, *};
14use std::fmt;
15
16#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
17pub struct TransactionSplitUpdate {
18    /// Transaction journal ID of current transaction (split).
19    #[serde(
20        rename = "transaction_journal_id",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub transaction_journal_id: Option<String>,
24    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
25    pub r#type: Option<models::TransactionTypeProperty>,
26    /// Date of the transaction
27    #[serde(rename = "date", skip_serializing_if = "Option::is_none")]
28    pub date: Option<String>,
29    /// Amount of the transaction.
30    #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
31    pub amount: Option<String>,
32    /// Description of the transaction.
33    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
34    pub description: Option<String>,
35    /// Order of this entry in the list of transactions.
36    #[serde(rename = "order", skip_serializing_if = "Option::is_none")]
37    pub order: Option<i32>,
38    /// Currency ID. Default is the source account's currency, or the user's financial administration's primary currency. Can be used instead of currency_code.
39    #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")]
40    pub currency_id: Option<String>,
41    /// Currency code. Default is the source account's currency, or the user's financial administration's primary currency. Can be used instead of currency_id.
42    #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")]
43    pub currency_code: Option<String>,
44    #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")]
45    pub currency_symbol: Option<String>,
46    #[serde(rename = "currency_name", skip_serializing_if = "Option::is_none")]
47    pub currency_name: Option<String>,
48    /// Number of decimals used in this currency.
49    #[serde(
50        rename = "currency_decimal_places",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub currency_decimal_places: Option<i32>,
54    /// The amount in a foreign currency.
55    #[serde(rename = "foreign_amount", skip_serializing_if = "Option::is_none")]
56    pub foreign_amount: Option<String>,
57    /// Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount.
58    #[serde(
59        rename = "foreign_currency_id",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub foreign_currency_id: Option<String>,
63    /// Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount.
64    #[serde(
65        rename = "foreign_currency_code",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub foreign_currency_code: Option<String>,
69    #[serde(
70        rename = "foreign_currency_symbol",
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub foreign_currency_symbol: Option<String>,
74    /// Number of decimals in the currency
75    #[serde(
76        rename = "foreign_currency_decimal_places",
77        skip_serializing_if = "Option::is_none"
78    )]
79    pub foreign_currency_decimal_places: Option<i32>,
80    /// The budget ID for this transaction.
81    #[serde(rename = "budget_id", skip_serializing_if = "Option::is_none")]
82    pub budget_id: Option<String>,
83    /// The name of the budget to be used. If the budget name is unknown, the ID will be used or the value will be ignored.
84    #[serde(rename = "budget_name", skip_serializing_if = "Option::is_none")]
85    pub budget_name: Option<String>,
86    /// The category ID for this transaction.
87    #[serde(rename = "category_id", skip_serializing_if = "Option::is_none")]
88    pub category_id: Option<String>,
89    /// The name of the category to be used. If the category is unknown, it will be created. If the ID and the name point to different categories, the ID overrules the name.
90    #[serde(rename = "category_name", skip_serializing_if = "Option::is_none")]
91    pub category_name: Option<String>,
92    /// ID of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account.
93    #[serde(rename = "source_id", skip_serializing_if = "Option::is_none")]
94    pub source_id: Option<String>,
95    /// Name of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. Can be used instead of the source_id. If the transaction is a deposit, the source_name can be filled in freely: the account will be created based on the name.
96    #[serde(rename = "source_name", skip_serializing_if = "Option::is_none")]
97    pub source_name: Option<String>,
98    #[serde(rename = "source_iban", skip_serializing_if = "Option::is_none")]
99    pub source_iban: Option<String>,
100    /// ID of the destination account. For a deposit or a transfer, this must always be an asset account. For withdrawals this must be an expense account.
101    #[serde(rename = "destination_id", skip_serializing_if = "Option::is_none")]
102    pub destination_id: Option<String>,
103    /// Name of the destination account. You can submit the name instead of the ID. For everything except transfers, the account will be auto-generated if unknown, so submitting a name is enough.
104    #[serde(rename = "destination_name", skip_serializing_if = "Option::is_none")]
105    pub destination_name: Option<String>,
106    #[serde(rename = "destination_iban", skip_serializing_if = "Option::is_none")]
107    pub destination_iban: Option<String>,
108    /// If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user.
109    #[serde(rename = "reconciled", skip_serializing_if = "Option::is_none")]
110    pub reconciled: Option<bool>,
111    /// Optional. Use either this or the bill_name
112    #[serde(rename = "bill_id", skip_serializing_if = "Option::is_none")]
113    pub bill_id: Option<String>,
114    /// Optional. Use either this or the bill_id
115    #[serde(rename = "bill_name", skip_serializing_if = "Option::is_none")]
116    pub bill_name: Option<String>,
117    /// Array of tags.
118    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
119    pub tags: Option<Vec<String>>,
120    #[serde(rename = "notes", skip_serializing_if = "Option::is_none")]
121    pub notes: Option<String>,
122    /// Reference to internal reference of other systems.
123    #[serde(rename = "internal_reference", skip_serializing_if = "Option::is_none")]
124    pub internal_reference: Option<String>,
125    /// Reference to external ID in other systems.
126    #[serde(rename = "external_id", skip_serializing_if = "Option::is_none")]
127    pub external_id: Option<String>,
128    /// External, custom URL for this transaction.
129    #[serde(rename = "external_url", skip_serializing_if = "Option::is_none")]
130    pub external_url: Option<String>,
131    /// SEPA Clearing Code
132    #[serde(rename = "sepa_cc", skip_serializing_if = "Option::is_none")]
133    pub sepa_cc: Option<String>,
134    /// SEPA Opposing Account Identifier
135    #[serde(rename = "sepa_ct_op", skip_serializing_if = "Option::is_none")]
136    pub sepa_ct_op: Option<String>,
137    /// SEPA end-to-end Identifier
138    #[serde(rename = "sepa_ct_id", skip_serializing_if = "Option::is_none")]
139    pub sepa_ct_id: Option<String>,
140    /// SEPA mandate identifier
141    #[serde(rename = "sepa_db", skip_serializing_if = "Option::is_none")]
142    pub sepa_db: Option<String>,
143    /// SEPA Country
144    #[serde(rename = "sepa_country", skip_serializing_if = "Option::is_none")]
145    pub sepa_country: Option<String>,
146    /// SEPA External Purpose indicator
147    #[serde(rename = "sepa_ep", skip_serializing_if = "Option::is_none")]
148    pub sepa_ep: Option<String>,
149    /// SEPA Creditor Identifier
150    #[serde(rename = "sepa_ci", skip_serializing_if = "Option::is_none")]
151    pub sepa_ci: Option<String>,
152    /// SEPA Batch ID
153    #[serde(rename = "sepa_batch_id", skip_serializing_if = "Option::is_none")]
154    pub sepa_batch_id: Option<String>,
155    #[serde(rename = "interest_date", skip_serializing_if = "Option::is_none")]
156    pub interest_date: Option<String>,
157    #[serde(rename = "book_date", skip_serializing_if = "Option::is_none")]
158    pub book_date: Option<String>,
159    #[serde(rename = "process_date", skip_serializing_if = "Option::is_none")]
160    pub process_date: Option<String>,
161    #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")]
162    pub due_date: Option<String>,
163    #[serde(rename = "payment_date", skip_serializing_if = "Option::is_none")]
164    pub payment_date: Option<String>,
165    #[serde(rename = "invoice_date", skip_serializing_if = "Option::is_none")]
166    pub invoice_date: Option<String>,
167}
168
169impl TransactionSplitUpdate {
170    pub fn new() -> TransactionSplitUpdate {
171        TransactionSplitUpdate {
172            transaction_journal_id: None,
173            r#type: None,
174            date: None,
175            amount: None,
176            description: None,
177            order: None,
178            currency_id: None,
179            currency_code: None,
180            currency_symbol: None,
181            currency_name: None,
182            currency_decimal_places: None,
183            foreign_amount: None,
184            foreign_currency_id: None,
185            foreign_currency_code: None,
186            foreign_currency_symbol: None,
187            foreign_currency_decimal_places: None,
188            budget_id: None,
189            budget_name: None,
190            category_id: None,
191            category_name: None,
192            source_id: None,
193            source_name: None,
194            source_iban: None,
195            destination_id: None,
196            destination_name: None,
197            destination_iban: None,
198            reconciled: None,
199            bill_id: None,
200            bill_name: None,
201            tags: None,
202            notes: None,
203            internal_reference: None,
204            external_id: None,
205            external_url: None,
206            sepa_cc: None,
207            sepa_ct_op: None,
208            sepa_ct_id: None,
209            sepa_db: None,
210            sepa_country: None,
211            sepa_ep: None,
212            sepa_ci: None,
213            sepa_batch_id: None,
214            interest_date: None,
215            book_date: None,
216            process_date: None,
217            due_date: None,
218            payment_date: None,
219            invoice_date: None,
220        }
221    }
222}
223
224impl fmt::Display for TransactionSplitUpdate {
225    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
226        match serde_json::to_string(self) {
227            Ok(json) => write!(f, "{}", json),
228            Err(_) => write!(f, "{{{{}}}}"),
229        }
230    }
231}