You've already forked AstralRinth
forked from didirus/AstralRinth
Link customer ID to Anrok transaction (#4509)
* Mark transactions with unresolvable addresses as unresolved * Add customer_name + customer_id to anrok transactions * Increase rate of Anrok syn * Remove timer from update_tax_transactions * chore: query cache, clippy, fmt
This commit is contained in:
committed by
GitHub
parent
dbc64afe48
commit
9589e23118
@@ -109,6 +109,8 @@ pub struct TransactionFields {
|
||||
pub accounting_time: DateTime<Utc>,
|
||||
pub accounting_time_zone: AccountingTimeZone,
|
||||
pub line_items: Vec<LineItem>,
|
||||
pub customer_name: Option<String>,
|
||||
pub customer_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
@@ -131,6 +133,19 @@ pub enum AnrokError {
|
||||
Other(#[from] reqwest::Error),
|
||||
}
|
||||
|
||||
impl AnrokError {
|
||||
pub fn is_conflict_and<F>(&self, pred: F) -> bool
|
||||
where
|
||||
F: FnOnce(&str) -> bool,
|
||||
{
|
||||
if let AnrokError::Conflict(message) = self {
|
||||
pred(message)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Client {
|
||||
client: reqwest::Client,
|
||||
|
||||
Reference in New Issue
Block a user