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:
François-Xavier Talbot
2025-10-06 17:06:57 +01:00
committed by GitHub
parent dbc64afe48
commit 9589e23118
6 changed files with 97 additions and 51 deletions

View File

@@ -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,