Example of fee flow by index

from absbox import Generic

test01 = Generic(
    "deal with bond schedule by index"
    ,{"collect":["2021-03-01","2021-06-30"],"pay":["2021-06-15","2021-07-20"]
     ,"payFreq":["DayOfMonth",20],"poolFreq":"MonthEnd","stated":"2030-01-01"}
    ,{'assets':[["Mortgage"
        ,{"originBalance":2200,"originRate":["fix",0.045],"originTerm":30
          ,"freq":"Monthly","type":"Level","originDate":"2021-02-01"}
          ,{"currentBalance":2200
          ,"currentRate":0.08
          ,"remainTerm":30
          ,"status":"current"}]]
     ,'issuanceStat':{"IssuanceBalance":2300}}
    ,(("acc01",{"balance":0}),)
    ,(("A1",{"balance":1000
             ,"rate":0.07
             ,"originBalance":1000
             ,"originRate":0.07
             ,"startDate":"2020-01-03"
             ,"rateType":{"Fixed":0.08}
             ,"bondType": "Sequential"
            })
      ,("B",{"balance":1000
             ,"rate":0.0
             ,"originBalance":1000
             ,"originRate":0.07
             ,"startDate":"2020-01-03"
             ,"rateType":{"Fixed":0.00}
             ,"bondType":{"Equity":None}
             }))
    ,(("feeByIndex",{"type":{"flowByBondPeriod": [ [1,80],[2,120],[3,300] ]},"feeStart":"2021-06-15"}),)
    ,{"amortizing":[
         ["calcAndPayFee","acc01",['feeByIndex']]
         ,["accrueAndPayInt","acc01",["A1"]]
         ,["payPrin","acc01",["A1"]]
         ,["payPrin","acc01",["B"]]
         ,["payIntResidual","acc01","B"]
     ]}
    ,[["CollectedInterest","acc01"]
      ,["CollectedPrincipal","acc01"]
      ,["CollectedPrepayment","acc01"]
      ,["CollectedRecoveries","acc01"]]
    ,None
    ,None
    ,None
    ,None
    ,"Amortizing"
    ,None
    ,None
    ,None
    ,{"BondPaidPeriod": 0,"PoolCollectedPeriod":0}
    )
from absbox import API,EnginePath

localAPI = API(EnginePath.DEV, check=False)
Connecting engine server -> https://absbox.org/api/dev
/home/docs/checkouts/readthedocs.org/user_builds/absbox-doc/envs/stable/lib/python3.11/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'absbox.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
✅Connected, local lib:0.52.3, server:0.52.3
r = localAPI.run(test01,read=True)
r['fees']['feeByIndex']
/home/docs/checkouts/readthedocs.org/user_builds/absbox-doc/envs/stable/lib/python3.11/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'absbox.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
Warning Message from server:Bond B is not paid off
balance payment due
date
2021-07-20 0.00 80.00 0
2021-08-20 0.00 40.00 0
2021-09-20 98.85 81.15 0
2021-10-20 116.55 81.15 0
2021-11-20 53.10 81.15 0
2021-12-20 0.00 53.10 0
2022-01-20 0.00 0.00 0
2022-02-20 0.00 0.00 0
2022-03-20 0.00 0.00 0
2022-04-20 0.00 0.00 0
2022-05-20 0.00 0.00 0
2022-06-20 0.00 0.00 0
2022-07-20 0.00 0.00 0
2022-08-20 0.00 0.00 0
2022-09-20 0.00 0.00 0
2022-10-20 0.00 0.00 0
2022-11-20 0.00 0.00 0
2022-12-20 0.00 0.00 0
2023-01-20 0.00 0.00 0
2023-02-20 0.00 0.00 0
2023-03-20 0.00 0.00 0
2023-04-20 0.00 0.00 0
2023-05-20 0.00 0.00 0
2023-06-20 0.00 0.00 0
2023-07-20 0.00 0.00 0
2023-08-20 0.00 0.00 0
2023-09-20 0.00 0.00 0