BalanceFlag is a redundant class, though, since there already exists a class BalanceType. However, using BalanceType in its place would require dfpitr_reader() to take an iterable of BalanceType, which is kinda ugly:
It's ugly because there are only two types of balance, individual and consolidated, so taking an iterable makes it seem as though a lot of items are to be passed in to the function, when it will be at most two.
A better approach is to change dfpitr_reader() such that it takes two boolean arguments, individual and consolidated, replacing BalanceFlag:
Description
The class
BalanceFlag
is used as an argument to the functiondfpitr_reader()
to define which kind of statements should be read:BalanceFlag
is a redundant class, though, since there already exists a classBalanceType
. However, usingBalanceType
in its place would requiredfpitr_reader()
to take an iterable ofBalanceType
, which is kinda ugly:It's ugly because there are only two types of balance, individual and consolidated, so taking an iterable makes it seem as though a lot of items are to be passed in to the function, when it will be at most two.
A better approach is to change
dfpitr_reader()
such that it takes two boolean arguments,individual
andconsolidated
, replacingBalanceFlag
:Along with the existing functionality of
dfpitr_reader()
, this refactor will thus allow four possibilities: