Members of the Programmable Banking community got together to demo their Transfer API solutions for the Q4 2021 Investec Programmable Banking hackathon. Here Mike White presents his solution, Cache Yo Cash, which helps provisional taxpayers calculate their tax liability.
- Use Cache Yo Cache open-source repo
- Read the original hackathon pitch
- Watch original hackathon submission demo
Transcript of the demo
Nick Benson 0:00
To the next one, by Mike White: Cache Yo Cash. I kind of had a giggle about that name for a while. Forgive me, Mike.
Mike White 0:10
Cool. Let me share my screen quickly. And forgive me because I don't ever use Zoom. I don't know what I'm doing. Can you guys see my screen? Okay, cool. First thing I wanted to show is just the way I dockerise my thing; so basically, you just run Docker-compose build, Docker-compose up, and then everything gets set up.
The reason I wanted to show this, is because when I first did it, which was at the start of this meeting, because I was very busy at work today, it suddenly started failing. And I realised it's because I'm running on my girlfriend's Mac. And they just updated Mac to apparently block Port 5000, which is the default for Flask. It broke my app. But I just quickly fixed that. I thought I'd mention it in case it happened to anyone else with Flask.
The Problem To Be Solved
Anyways, here is my sort of entry. Essentially the idea I had was my dad is a doctor who runs his own practice, so he ends up doing provisional tax. My mom runs his practice and has to do a lot of the bookkeeping, but she's not an accountant.
She has to just fumble her way through it. And it often happens that they wouldn't know exactly what their tax liability is at any point in the year. And they would just end up either having way more saved up or way less saved up, whatever it was. It ended up being quite a stressful thing. And it made me think this is kind of weird; this should be something easy to track. I don't know if there are existing things to do this; I'm sure there probably are.
How to works
But I thought I'd do it with programmable banking. I did have to make some assumptions about the tax calculations, I didn't include things like assets.
These things can be added in, but it was just going to make the actual tax calculation more complicated than it needed to be for proof of concept. So basically, there's the overview page. At the top, you can select when the end of the financial year is and then it will automatically adjust the transactions that it's actually taking into account, based on the year previous to that. And up until this point that you've entered. It will then, based on all the transactions, do a tax calculation and figure out the tax liability. It does that based on just looking at taxable income.
This is all fake data, by the way, or a mixture of real and fake data I should say. But you'll work out your taxable income, your deductible expenses, other deductions, work out profit and then use the corporate tax rate to kind of calculate what the liability there would be. And then it will graph it here compared to your holding account balance, which you can configure, not in the interface, but it can be configured on the back end. And basically, it will give you a view on how prepared you are to actually make your provisional tax payment that you're going to need to make.
Also, to be able to actually interact with that in the interface, you can then also make a transfer over here. And that'll cap out at the maximum amount that would be required to balance out with your tax liability. Okay. You can see here; this is a little bit janky because it doesn't refresh properly. But you can transfer, and it'll reflect over here. It's hard for me to show the transfer actually going through because I don't want to show my bank account.
I will show you that I get a message or something. You can see the R30 there. But it doesn't reflect immediately; I have to refresh. I'm not a front-end dev, so it's not perfect.
But you can see that that's gone up by R30 hopefully on the screen. So yeah, that's that part of it. Then, the next kind of section is the transactions. This interacts with the Investec API to allow you to retrieve [or] import your transactions. We can see here, there's 61 transactions there, and I haven't imported for a few days. If I just import these now, then we should see that increase.
No, I might have actually imported these transactions.
Okay. Either way, I'll move past that. I can see if I can work it out later, make another transfer and then do it. Cool. From here, you can then select any of these transactions. There we go. It's at the bottom now. If it's a debit transaction, you can select over here and say Add Expense, and it will allow you to say whether it's deductible or not. And you can edit the description. And if you submit those, then it will add it to the expenses table later on.
I'll come back here to demonstrate how that works. And then on the flip side, if I do this with a credit transaction, then it'll have the same sort of thing, except you also have this slider over here that allows you to select some amount to transfer, and that again, will go from zero to the amount based on the corporate tax rate.
Okay. Cool. If I go to Income, you can see these are kind of the items that I've got at the moment, you can also manually add in case there's something that doesn't come through your Investec account. We'll do this, then we can see that that has gone over there to Test Demo.
And then the same sort of thing applies for expenses; you can do the same sort of thing. But to show that the transactions are kind of translating into those, I can make one here. If we look for something that hasn't been listed yet; I think this one hasn't been processed yet.
This Cactus Cade, you can see it has been processed in this column. We can go over here. This is an expense. Submit. Over here, we can see it reflects over there. Cool. So then, the next thing you've got is just deductions, and this one doesn't integrate with the transactions page because this would be stuff that doesn't come off your account as an expense directly.
But it's some other sort of form of deduction. But yeah, so all of this will exist, at the moment it exists locally. In a local DynamoDB instance. If there's a Docker image that you can kind of host and then it'll act the same way as if you're connecting. With any AWS command or API, you just provide the host URL as being localhost, whatever.
This is all being done at the moment. Yeah, I don't know if I can show you the transactions actually coming through except by. Oh, I can show you on my phone But you can see the transaction for R30 has gone through. Yeah, I don't know what's kind of interesting about this to kind of further explain.
So maybe I'll just leave it open. If anyone has any questions.
Community Questions
Aretha Cooper 8:49
Mike, I just wanted to know, what does your dad need next?
Mike 8:52
What does he need next, did you say? I think, to be honest, if I was going to develop further on this, the main thing; the base is there, I think, but what would need to happen for this to actually be applied is just a more sophisticated tax calculation in terms of being able to take into account assets and all sorts of stuff like that. But to me, that was the less interesting part to focus on, rather than all the other kinds of features related more to the programmable banking stuff. But yeah, I don't know. I think it would be cool you can build a lot of stuff on top of this. But yeah, I probably could have gotten a lot more done if I didn't try and make the front end look marginally or relatively okay. That took a really long time for me because I'm not a front-end guy.
Aretha 9:51
It looks pretty good. Hey, I would use this. [Laughter]
Mike 9:58
Well, as I say, I think if I had a front-end dev with me, it'd probably look quite a bit better. And it would have been done probably in 75% less time. Because so much of my time was spent on this.
Oh, the other thing I didn't mention, which is maybe interesting, as far as the community goes, is that for the back end, I used Flask, and there's an existing client, for Python, but it hadn't been updated in a while with the programmable cards stuff and the Transfer API.
I created a fork of that. I would have just made a pull request, but I was under a lot of time pressure to actually get anything done for this. I just kind of forked it, and maybe I'll reach out and see if they want to merge it back into their version. But I added support for the Transfer API and stuff for this.
But the base was very good. I don't know who this is, Vincent (Chegwidden)? I've never met them, but it was a very good base to work from. So that's cool. Yeah.
Rijnhardt Kotze 11:29
I think it was Aretha that said that I could really see myself using this. This is applicable to quite a few industries: if you work for yourself, or you are a provisional income earner and a provisional taxpayer, it could be quite nice to do that, and you can even aggregate that across multiple people. If you have sort of a tax practitioner and they give it to their clients to manage on their own, it would be quite cool. But I do think it's phenomenal.
Mike 12:06
Yeah, I think what would be really cool is. I don't know if I heard this mentioned, or if I dreamt it, but I feel like I heard something about Investec having third party integrations at some point, in terms of being able to have something where they can kind of login through your app and give you some sort of permissions to act on someone's behalf so that you could develop something that would operate on someone's account that way. I think with that you can actually develop something. Yeah, that could actually be used, but I don't know.
As I say I was just trying to have fun. I only started doing the programmable banking stuff I think the day of the last meetup.
Anyway, that's me.
Hennie Spies 13:00
Mike, I think that from a documentation perspective, I think well documented. Definitely a real-world application. One thing that I've thought of in terms of evolutionising is to have a simulator almost do a pre-run through the transactions to almost pre-classify what type of, based on previous transactions etc.
Maybe as the thinking taking this forward? But I think it's well done. And I really like your approach in terms of first starting off in AWS remotely, and then doing the DynamoDB locally. From a community perspective, I think that's awesome.
Mike 13:45
Yeah. I work for AWS, I'm kind of biased but I really like the products and stuff. But it can be a little bit annoying sometimes to develop locally, if you don't have a company account that you can just deploy to and not worry about your infrastructure costs as much.
At least not as much. I then realised being able to host locally was quite a benefit. And I developed it in such a way that it would be very easy to now translate this into something that would just use CDK to deploy a bunch of lambdas and a DynamoDB.
Nick 14:27
Cool, thanks, Mike. That was really cool. I really appreciate the effort and everything that you've done. Thanks, man.
Get involved in the Programmable Banking Community.
If you have questions or just want to say hi to the Programmable Banking Community core team, you can pop us a mail and we will get back to you.
If you want to see more from what the community has been up to, you can: