From 05dffca6a093665ca79c38542f60cf56af36e170 Mon Sep 17 00:00:00 2001 From: Shane Huston Date: Wed, 8 Jun 2022 12:37:27 +0100 Subject: [PATCH] Generically hide Revolut top ups from AIB output --- transactions/aibTransaction.go | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/transactions/aibTransaction.go b/transactions/aibTransaction.go index 15d8563..61a9189 100644 --- a/transactions/aibTransaction.go +++ b/transactions/aibTransaction.go @@ -108,22 +108,7 @@ func (t aibTransaction) shouldHide() bool { return true } - if t.details == "VDP-Revolut**2734*" || - t.details == "VDP-Revolut**4772*" || - t.details == "VDP-REVOLUT*4772*" || - t.details == "VDP-REVOLUT*2484*" || - t.details == "VDP-Revolut* - 477" || - t.details == "VDP-Revolut - 477" || - t.details == "VDP-Revolut - 107" || - t.details == "VDP-Revolut - 652" || - t.details == "VDP-Revolut - 281" || - t.details == "VDP-Revolut - 230" || - t.details == "VDP-Revolut - 246" || - t.details == "VDP-Revolut - 385" || - t.details == "VDP-Revolut - 975" || - t.details == "VDP-Revolut - 341" || - t.details == "VDP-Revolut - 973" || - t.details == "VDP-Revolut**9510*" { + if t.isRevolutTopUp() { return true } @@ -143,3 +128,11 @@ func (t aibTransaction) shouldHide() bool { return false } + +func (t aibTransaction) isRevolutTopUp() bool { + return strings.HasPrefix(t.details, "VDP-Revolut**") || + strings.HasPrefix(t.details, "VDP-Revolut* - ") || + strings.HasPrefix(t.details, "VDP-Revolut - ") || + strings.HasPrefix(t.details, "VDP-REVOLUT*") || + t.details == "VDP-Revolut" +}