osdm_sys/models/
fee.rs

1/*
2 * UIC 90918-10 - OSDM
3 *
4 * 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/) 
5 *
6 * The version of the OpenAPI document: 3.7.0
7 * Contact: osdm@uic.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Fee : Fees are used to represent additional costs for services or products. In contrast to other offer parts in OSDM, the customer is not free whether to choose a fee or not: fees are generated and applied to other services or products by the providing system. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Fee {
17    #[serde(rename = "id")]
18    pub id: String,
19    /// A human-readable description of the fee. 
20    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub summary: Option<Option<String>>,
22    #[serde(rename = "price")]
23    pub price: Box<models::Price>,
24    #[serde(rename = "applicability", skip_serializing_if = "Option::is_none")]
25    pub applicability: Option<String>,
26    #[serde(rename = "transactionContext", skip_serializing_if = "Option::is_none")]
27    pub transaction_context: Option<String>,
28    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
29    pub status: Option<models::FeeStatus>,
30    /// reference to the booking in the downstream distributor system 
31    #[serde(rename = "distributorBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub distributor_booking_ref: Option<Option<String>>,
33    #[serde(rename = "refundable", skip_serializing_if = "Option::is_none")]
34    pub refundable: Option<models::RefundType>,
35    /// Structured description of the sales or after-sales conditions. 
36    #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
37    pub conditions: Option<Vec<models::Condition>>,
38    /// The product code expressed in the provider system (could be a mapping from an even lower-level provider). 
39    #[serde(rename = "productCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub product_code: Option<Option<String>>,
41    /// Reference to the Product representing the Fee 
42    #[serde(rename = "productRef", skip_serializing_if = "Option::is_none")]
43    pub product_ref: Option<String>,
44    #[serde(rename = "accountingRef", skip_serializing_if = "Option::is_none")]
45    pub accounting_ref: Option<Box<models::AccountingRef>>,
46}
47
48impl Fee {
49    /// Fees are used to represent additional costs for services or products. In contrast to other offer parts in OSDM, the customer is not free whether to choose a fee or not: fees are generated and applied to other services or products by the providing system. 
50    pub fn new(id: String, price: models::Price) -> Fee {
51        Fee {
52            id,
53            summary: None,
54            price: Box::new(price),
55            applicability: None,
56            transaction_context: None,
57            status: None,
58            distributor_booking_ref: None,
59            refundable: None,
60            conditions: None,
61            product_code: None,
62            product_ref: None,
63            accounting_ref: None,
64        }
65    }
66}
67