UZFKS57SWR5P3BHRONPRANXL5VH5Z6PQRQAFYOHZ2SUD67VBXDCQC
UO34MAAGCLHTUGNRZQUNIS32ZE354N72IMGZ76THUBKR7TDT6L2QC
362NCCMXCBQRRWBRE5G6YLINRAF472PJJF3WSF43B2SULDJBWEHQC
use hashbrown::HashMap;
#[serde(default)] #[builder(field(type = "HashMap<String, Account>"))] pub content_type_expense_accounts: HashMap<String, Account>,
#[serde(default)]
#[builder(field(type = "HashMap<String, Account>"))]
pub content_type_expense_accounts: HashMap<String, Account>,
pub payee: String,
pub const NAME: &str = "apple/transaction-history";
pub const NAME: &'static str = "apple/transaction-history";
} fn lookup_expense_account(&self, content_type: &str, context: &TemplateContext<'_>) -> Account { self.config .content_type_expense_accounts .get(content_type) .cloned() .unwrap_or_else(|| self.config.expense_account.render(context))
}
fn lookup_expense_account(&self, content_type: &str, context: &TemplateContext<'_>) -> Account {
self.config
.content_type_expense_accounts
.get(content_type)
.cloned()
.unwrap_or_else(|| self.config.expense_account.render(context))
.build_posting(self.config.expense_account.render(&context), |_posting| {});
.build_posting( self.lookup_expense_account(record.content_type, &context), |_posting| {}, );
.build_posting(
self.lookup_expense_account(record.content_type, &context),
|_posting| {},
);
pub fn try_add_content_type_expense_account<A>( &mut self, name: impl Into<String>, account: A, ) -> Result<&mut Self, A::Error> where A: TryInto<Account>, { self.content_type_expense_accounts .insert(name.into(), account.try_into()?); Ok(self) }}impl ImporterBuilder {
pub fn try_add_content_type_expense_account<A>(
&mut self,
name: impl Into<String>,
account: A,
) -> Result<&mut Self, A::Error>
where
A: TryInto<Account>,
{
self.content_type_expense_accounts
.insert(name.into(), account.try_into()?);
Ok(self)
impl ImporterBuilder {
content_type_expense_accounts: self.content_type_expense_accounts.clone(),
payee: self.payee.clone().context(UninitializedFieldSnafu { field: "payee", importer: Importer::NAME, })?,
payee: self.payee.clone().context(UninitializedFieldSnafu {
field: "payee",
importer: Importer::NAME,
})?,
#[serde(rename = "Content Type")] content_type: &'r str,
#[serde(rename = "Content Type")]
content_type: &'r str,
hashbrown.workspace = true