osdm_sys/models/tip.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/// Tip : Tips for staff can be included e.g. for taxi drivers. The tip is part of the payment in a post payment scenario.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Tip {
17 #[serde(rename = "id")]
18 pub id: String,
19 /// A human-readable description of the tip.
20 #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
21 pub summary: Option<String>,
22 #[serde(rename = "bookingPartRef", skip_serializing_if = "Option::is_none")]
23 pub booking_part_ref: Option<Box<models::BookingPartReference>>,
24 #[serde(rename = "price")]
25 pub price: Box<models::Price>,
26 /// reference to the booking in the downstream distributor system
27 #[serde(rename = "distributorBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28 pub distributor_booking_ref: Option<Option<String>>,
29 #[serde(rename = "accountingRef", skip_serializing_if = "Option::is_none")]
30 pub accounting_ref: Option<Box<models::AccountingRef>>,
31}
32
33impl Tip {
34 /// Tips for staff can be included e.g. for taxi drivers. The tip is part of the payment in a post payment scenario.
35 pub fn new(id: String, price: models::Price) -> Tip {
36 Tip {
37 id,
38 summary: None,
39 booking_part_ref: None,
40 price: Box::new(price),
41 distributor_booking_ref: None,
42 accounting_ref: None,
43 }
44 }
45}
46