revenue.rs (1921B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2025, 2026 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Affero General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 12 13 You should have received a copy of the GNU Affero General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 17 //! Type for the Taler Wire Gateway HTTP API <https://docs.taler.net/core/api-bank-wire.html#taler-wire-gateway-http-api> 18 19 use serde::{Deserialize, Serialize}; 20 use taler_macros::api_config; 21 22 use crate::types::{ 23 amount::{Amount, Currency}, 24 payto::PaytoURI, 25 timestamp::TalerTimestamp, 26 }; 27 28 /// <https://docs.taler.net/core/api-bank-revenue.html#tsref-type-RevenueConfig> 29 #[api_config("taler-revenue")] 30 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] 31 pub struct RevenueConfig<'a> { 32 pub currency: Currency, 33 } 34 35 /// <https://docs.taler.net/core/api-bank-revenue.html#tsref-type-RevenueIncomingHistory> 36 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] 37 pub struct RevenueIncomingHistory { 38 pub incoming_transactions: Vec<RevenueIncomingBankTransaction>, 39 pub credit_account: PaytoURI, 40 } 41 42 /// <https://docs.taler.net/core/api-bank-revenue.html#tsref-type-RevenueIncomingBankTransaction> 43 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] 44 pub struct RevenueIncomingBankTransaction { 45 pub row_id: u64, 46 pub date: TalerTimestamp, 47 pub amount: Amount, 48 pub credit_fee: Option<Amount>, 49 pub debit_account: PaytoURI, 50 pub subject: String, 51 }