osdm_sys/models/
refund_offer.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct RefundOffer {
16    /// id of the refund offer 
17    #[serde(rename = "id")]
18    pub id: String,
19    /// A human-readable description of the refund offer. 
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 = "createdOn")]
23    pub created_on: String,
24    #[serde(rename = "validFrom")]
25    pub valid_from: String,
26    /// time until the offer can be used 
27    #[serde(rename = "validUntil")]
28    pub valid_until: String,
29    #[serde(rename = "confirmedOn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub confirmed_on: Option<Option<String>>,
31    #[serde(rename = "status")]
32    pub status: models::RefundStatus,
33    #[serde(rename = "reimbursementStatus", skip_serializing_if = "Option::is_none")]
34    pub reimbursement_status: Option<models::ReimbursementStatus>,
35    #[serde(rename = "reimbursementDateTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub reimbursement_date_time: Option<Option<String>>,
37    /// Reason for and type of an after sale, code list in IRS 90918-10. The PRM_SUPPORT_UNAVAILABLE overrule code shall only be used by the UIC PRM ABT tool. Values from the [Overrule Codes Code List](https://osdm.io/spec/catalog-of-code-lists/#OverruleCode) Listed values here are examples.    - 'CONNECTION_BROKEN' - 'DEATH' - 'EQUIPMENT_FAILURE' - 'PAYMENT_FAILURE' - 'PRM_SUPPORT_UNAVAILABLE' - 'SALES_STAFF_ERROR' - 'STOP_NOT_SERVED' - 'STRIKE' - 'TECHNICAL_FAILURE' - 'TICKET_NOT_USED' - 'INABILITY_TO_TRAVEL': Inability to travel due to accident or sickness. - 'EXTERNAL_COMPENSATION': Offer has been compensated outside of the provider system in another way. - 'DISRUPTION': Inability to operate due to disruption. - 'JOURNEY_OBSOLETE': Due to external factors it's senseless to start the trip, thus the travel is obsolete. - 'CERTIFIED_MEDICAL_CONDITION': A medical certificate certifies that the passenger is unable to travel. - 'DELAY_COMPENSATION': Allows to override conditions in context of passenger rights regulation (PRR). 
38    #[serde(rename = "appliedOverruleCode", skip_serializing_if = "Option::is_none")]
39    pub applied_overrule_code: Option<String>,
40    /// fulfillments to be refunded or replaced
41    #[serde(rename = "fulfillments")]
42    pub fulfillments: Vec<models::Fulfillment>,
43    /// new fulfillments issued with this offer (only available after confirmation)
44    #[serde(rename = "issuedFulfillments", skip_serializing_if = "Option::is_none")]
45    pub issued_fulfillments: Option<Vec<models::Fulfillment>>,
46    #[serde(rename = "issuedVouchers", skip_serializing_if = "Option::is_none")]
47    pub issued_vouchers: Option<Vec<models::VoucherInformation>>,
48    #[serde(rename = "refundFee")]
49    pub refund_fee: Box<models::Price>,
50    #[serde(rename = "accountingRef", skip_serializing_if = "Option::is_none")]
51    pub accounting_ref: Option<Box<models::AccountingRef>>,
52    #[serde(rename = "refundableAmount")]
53    pub refundable_amount: Box<models::Price>,
54    /// breakdown of the refund offer 
55    #[serde(rename = "refundOfferBreakdown", skip_serializing_if = "Option::is_none")]
56    pub refund_offer_breakdown: Option<Vec<models::RefundOfferBreakdownItem>>,
57    #[serde(rename = "reimbursementMethod", skip_serializing_if = "Option::is_none")]
58    pub reimbursement_method: Option<Box<models::ReimbursementMethod>>,
59    /// Java Property Name: 'links' 
60    #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
61    pub _links: Option<Vec<models::Link>>,
62}
63
64impl RefundOffer {
65    pub fn new(id: String, created_on: String, valid_from: String, valid_until: String, status: models::RefundStatus, fulfillments: Vec<models::Fulfillment>, refund_fee: models::Price, refundable_amount: models::Price) -> RefundOffer {
66        RefundOffer {
67            id,
68            summary: None,
69            created_on,
70            valid_from,
71            valid_until,
72            confirmed_on: None,
73            status,
74            reimbursement_status: None,
75            reimbursement_date_time: None,
76            applied_overrule_code: None,
77            fulfillments,
78            issued_fulfillments: None,
79            issued_vouchers: None,
80            refund_fee: Box::new(refund_fee),
81            accounting_ref: None,
82            refundable_amount: Box::new(refundable_amount),
83            refund_offer_breakdown: None,
84            reimbursement_method: None,
85            _links: None,
86        }
87    }
88}
89