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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* UIC 90918-10 - OSDM
*
* Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information. The following resources are key to get started: - [Processes](https://osdm.io/spec/processes/) - [Models](https://osdm.io/spec/models/) - [Getting started](https://osdm.io/spec/getting-started/)
*
* The version of the OpenAPI document: 3.7.0
* Contact: osdm@uic.org
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct Vat {
/// ISO 3166-1 alpha-2 2 character country code
#[serde(rename = "countryCode")]
pub country_code: String,
/// amount in cents
#[serde(rename = "amount")]
pub amount: i32,
/// scale of the amount - the number of positions after the comma
#[serde(rename = "scale", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub scale: Option<Option<i32>>,
#[serde(rename = "percentage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub percentage: Option<Option<f32>>,
#[serde(rename = "taxId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub tax_id: Option<Option<String>>,
/// scope where the VAT applies. Values from the [Tax Scope Code List](https://osdm.io/spec/catalog-of-code-lists/#TaxScope) Listed values here are examples.
#[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
pub scope: Option<String>,
}
impl Vat {
pub fn new(country_code: String, amount: i32) -> Vat {
Vat {
country_code,
amount,
scale: None,
percentage: None,
tax_id: None,
scope: None,
}
}
}