use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TokenResponse { pub access: String, pub access_expires: i32, pub refresh: Option, pub refresh_expires: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Requisition { pub id: String, pub status: String, pub accounts: Option>, pub reference: Option, pub agreement: Option, // EUA ID associated with this requisition } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct EndUserAgreement { pub id: String, pub created: Option, pub accepted: Option, // When user accepted the agreement pub access_valid_for_days: Option, // Validity period (default 90) pub institution_id: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaginatedResponse { pub count: Option, pub next: Option, pub previous: Option, pub results: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Account { pub id: String, pub created: Option, pub last_accessed: Option, pub iban: Option, pub institution_id: Option, pub status: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionsResponse { pub transactions: TransactionBookedPending, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionBookedPending { pub booked: Vec, pub pending: Option>, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Transaction { #[serde(rename = "transactionId")] pub transaction_id: Option, #[serde(rename = "entryReference")] pub entry_reference: Option, #[serde(rename = "endToEndId")] pub end_to_end_id: Option, #[serde(rename = "mandateId")] pub mandate_id: Option, #[serde(rename = "checkId")] pub check_id: Option, #[serde(rename = "creditorId")] pub creditor_id: Option, #[serde(rename = "bookingDate")] pub booking_date: Option, #[serde(rename = "valueDate")] pub value_date: Option, #[serde(rename = "bookingDateTime")] pub booking_date_time: Option, #[serde(rename = "valueDateTime")] pub value_date_time: Option, #[serde(rename = "transactionAmount")] pub transaction_amount: TransactionAmount, #[serde(rename = "currencyExchange")] pub currency_exchange: Option>, #[serde(rename = "creditorName")] pub creditor_name: Option, #[serde(rename = "creditorAccount")] pub creditor_account: Option, #[serde(rename = "ultimateCreditor")] pub ultimate_creditor: Option, #[serde(rename = "debtorName")] pub debtor_name: Option, #[serde(rename = "debtorAccount")] pub debtor_account: Option, #[serde(rename = "ultimateDebtor")] pub ultimate_debtor: Option, #[serde(rename = "remittanceInformationUnstructured")] pub remittance_information_unstructured: Option, #[serde(rename = "remittanceInformationUnstructuredArray")] pub remittance_information_unstructured_array: Option>, #[serde(rename = "remittanceInformationStructured")] pub remittance_information_structured: Option, #[serde(rename = "remittanceInformationStructuredArray")] pub remittance_information_structured_array: Option>, #[serde(rename = "additionalInformation")] pub additional_information: Option, #[serde(rename = "purposeCode")] pub purpose_code: Option, #[serde(rename = "bankTransactionCode")] pub bank_transaction_code: Option, #[serde(rename = "proprietaryBankTransactionCode")] pub proprietary_bank_transaction_code: Option, #[serde(rename = "internalTransactionId")] pub internal_transaction_id: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionAmount { pub amount: String, pub currency: String, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CurrencyExchange { #[serde(rename = "sourceCurrency")] pub source_currency: Option, #[serde(rename = "exchangeRate")] pub exchange_rate: Option, #[serde(rename = "unitCurrency")] pub unit_currency: Option, #[serde(rename = "targetCurrency")] pub target_currency: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AccountDetails { pub iban: Option, pub bban: Option, pub pan: Option, #[serde(rename = "maskedPan")] pub masked_pan: Option, pub msisdn: Option, pub currency: Option, }